From 91554c9cfd5754dd2fc40af7e205002d2d48ac78 Mon Sep 17 00:00:00 2001 From: Caleb Sitton Date: Tue, 2 Jul 2024 11:45:28 -0600 Subject: [PATCH] Added test type selection to run_tests --- run_tests | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/run_tests b/run_tests index 0297293c..f491a9da 100755 --- a/run_tests +++ b/run_tests @@ -10,6 +10,7 @@ else fi SCRIPT_DIR=`(cd $SCRIPT_DIRNAME; pwd)` +TEST_SET=2 # 0 for unit tests, 1 for integration tests, 2 for both # source read ravenrc script RAVEN_RC_SCRIPT=$SCRIPT_DIR/raven/scripts/read_ravenrc.sh @@ -19,6 +20,25 @@ source $RAVEN_RC_SCRIPT # set up installation manager INSTALLATION_MANAGER=$(read_ravenrc "INSTALLATION_MANAGER") +# read command-line arguments +ARGS=() +for A in "$@"; do + case $A in + --unit-tests) + TEST_SET=0 + ;; + --integration-tests) + TEST_SET=1 + ;; + --all-tests) + TEST_SET=2 + ;; + *) + ARGS+=("$A") + ;; + esac +done + echo 'Loading libraries ...' if [[ "$INSTALLATION_MANAGER" == "CONDA" ]]; @@ -57,7 +77,19 @@ echo "************************************************************************** echo echo 'Running FORCE tests ...' -$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[@]}" +case $TEST_SET in + 0) + TEST_DIR=tests/unit_tests + ;; + 1) + TEST_DIR=tests/integration_tests + ;; + 2) + TEST_DIR=tests + ;; +esac + +$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[@]}" # store return codes individually (rc) and combined (ALL_PASS) rc=$?