diff options
Diffstat (limited to 'scripts/run_functional_tests')
-rwxr-xr-x | scripts/run_functional_tests | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/run_functional_tests b/scripts/run_functional_tests new file mode 100755 index 00000000..c43224af --- /dev/null +++ b/scripts/run_functional_tests @@ -0,0 +1,37 @@ +#!/bin/bash + +INPUT_ARGS=${@//--python[23]/} + +if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then + source find_python.sh --python2 + cd automation/regression + + # Python 2 + echo Python2 test + $PYTHON trex_unit_test.py --functional $INPUT_ARGS + if [ $? -eq 0 ]; then + printf "\n$PYTHON test succeeded\n\n" + else + printf "\n*** $PYTHON test failed\n\n" + exit -1 + fi + cd - +fi + +if [[ $@ =~ '--python3' || ! $@ =~ '--python2' ]]; then + source find_python.sh --python3 + cd automation/regression + + # Python 3 + echo Python3 test + $PYTHON trex_unit_test.py --functional $INPUT_ARGS + if [ $? -eq 0 ]; then + printf "\n$PYTHON test succeeded\n\n" + else + printf "\n*** $PYTHON test failed\n\n" + exit -1 + fi + cd - +fi + + |