Skip to content

Commit

Permalink
Added test type selection to run_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-sitton-inl committed Jul 2, 2024
1 parent 6a16375 commit 91554c9
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ]];
Expand Down Expand Up @@ -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=$?
Expand Down

0 comments on commit 91554c9

Please sign in to comment.