Skip to content

Commit a2e0070

Browse files
committed
Use separate script file to test conda package.
1 parent f48f48d commit a2e0070

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

conda-recipe/meta.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@ requirements:
2626

2727
test:
2828
requires:
29+
- cxxtest
2930
- scons
3031

31-
commands:
32-
# Run unit-test program with the installed shared library.
33-
# Make sure tests cannot use library file from the source directory.
34-
- scons -C "$SRC_DIR" --clean lib
35-
- ALLTESTSFAST=$(ls -t ${SRC_DIR}/build/fast*/tests/alltests | head -1)
36-
- "${ALLTESTSFAST}"
32+
# commands:
33+
# Execute the run_test.sh script.
3734

3835
about:
3936
home: https://github.com/diffpy/libdiffpy

conda-recipe/run_test.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
MYNCPU=$(( (CPU_COUNT > 8) ? 8 : CPU_COUNT ))
4+
5+
# Remove unit tests from the build phase.
6+
scons -C "$SRC_DIR" --clean lib alltests
7+
8+
# Build the unit tests program using the installed library.
9+
scons -C "$SRC_DIR" -j $MYNCPU alltests prefix=$PREFIX test_installed=true
10+
11+
# Execute the unit tests.
12+
MYALLTESTSFAST=$(ls -t ${SRC_DIR}/build/fast*/tests/alltests | head -1)
13+
${MYALLTESTSFAST}

0 commit comments

Comments
 (0)