diff options
Diffstat (limited to 'scripts/run_functional_tests')
-rwxr-xr-x | scripts/run_functional_tests | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/scripts/run_functional_tests b/scripts/run_functional_tests index 6212b40b..9ec1bd39 100755 --- a/scripts/run_functional_tests +++ b/scripts/run_functional_tests @@ -1,30 +1,36 @@ #!/bin/bash -source find_python.sh --python2 -cd automation/regression -# Python 2 -echo Python2 test -$PYTHON trex_unit_test.py --functional $@ -if [ $? -eq 0 ]; then - printf "\n$PYTHON test succeeded\n\n" -else - printf "\n*** $PYTHON test failed\n\n" - exit -1 +if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then + source find_python.sh --python2 + cd automation/regression + + # Python 2 + echo Python2 test + $PYTHON trex_unit_test.py --functional $@ + if [ $? -eq 0 ]; then + printf "\n$PYTHON test succeeded\n\n" + else + printf "\n*** $PYTHON test failed\n\n" + exit -1 + fi + cd - fi -cd - -source find_python.sh --python3 -cd - +if [[ $@ =~ '--python3' || ! $@ =~ '--python2' ]]; then + source find_python.sh --python3 + cd automation/regression -# Python 3 -echo Python3 test -$PYTHON trex_unit_test.py --functional $@ -if [ $? -eq 0 ]; then - printf "\n$PYTHON test succeeded\n\n" -else - printf "\n*** $PYTHON test failed\n\n" - exit -1 + # Python 3 + echo Python3 test + $PYTHON trex_unit_test.py --functional $@ + if [ $? -eq 0 ]; then + printf "\n$PYTHON test succeeded\n\n" + else + printf "\n*** $PYTHON test failed\n\n" + exit -1 + fi + cd - fi |