Skip to content

Commit 91554c9

Browse files
Added test type selection to run_tests
1 parent 6a16375 commit 91554c9

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

run_tests

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ else
1010
fi
1111
SCRIPT_DIR=`(cd $SCRIPT_DIRNAME; pwd)`
1212

13+
TEST_SET=2 # 0 for unit tests, 1 for integration tests, 2 for both
1314

1415
# source read ravenrc script
1516
RAVEN_RC_SCRIPT=$SCRIPT_DIR/raven/scripts/read_ravenrc.sh
@@ -19,6 +20,25 @@ source $RAVEN_RC_SCRIPT
1920
# set up installation manager
2021
INSTALLATION_MANAGER=$(read_ravenrc "INSTALLATION_MANAGER")
2122

23+
# read command-line arguments
24+
ARGS=()
25+
for A in "$@"; do
26+
case $A in
27+
--unit-tests)
28+
TEST_SET=0
29+
;;
30+
--integration-tests)
31+
TEST_SET=1
32+
;;
33+
--all-tests)
34+
TEST_SET=2
35+
;;
36+
*)
37+
ARGS+=("$A")
38+
;;
39+
esac
40+
done
41+
2242

2343
echo 'Loading libraries ...'
2444
if [[ "$INSTALLATION_MANAGER" == "CONDA" ]];
@@ -57,7 +77,19 @@ echo "**************************************************************************
5777
echo
5878
echo 'Running FORCE tests ...'
5979

60-
$PYTHON_COMMAND $SCRIPT_DIR/raven/rook/main.py --config-file=$SCRIPT_DIR/developer_tools/rook.ini --testers-dir $RAVEN_DIR/scripts/TestHarness/testers,$RAVEN_DIR/../HERON/src/Testers "${ARGS[@]}"
80+
case $TEST_SET in
81+
0)
82+
TEST_DIR=tests/unit_tests
83+
;;
84+
1)
85+
TEST_DIR=tests/integration_tests
86+
;;
87+
2)
88+
TEST_DIR=tests
89+
;;
90+
esac
91+
92+
$PYTHON_COMMAND $SCRIPT_DIR/raven/rook/main.py --config-file=$SCRIPT_DIR/developer_tools/rook.ini --test-dir $TEST_DIR --testers-dir $RAVEN_DIR/scripts/TestHarness/testers,$RAVEN_DIR/../HERON/src/Testers "${ARGS[@]}"
6193

6294
# store return codes individually (rc) and combined (ALL_PASS)
6395
rc=$?

0 commit comments

Comments
 (0)