summaryrefslogtreecommitdiffstats
path: root/scripts/run_regression
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/run_regression')
-rwxr-xr-xscripts/run_regression40
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/run_regression b/scripts/run_regression
new file mode 100755
index 00000000..407b7f84
--- /dev/null
+++ b/scripts/run_regression
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+ARGS=()
+for var in "$@"; do
+ [[ "$var" != '--python2' && "$var" != '--python3' ]] && ARGS+=("$var")
+done
+
+if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then
+ source find_python.sh --python2
+ cd automation/regression
+
+ # Python 2
+ echo Python2 test
+ $PYTHON trex_unit_test.py "${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' ]]; then
+ source find_python.sh --python3
+ cd automation/regression
+
+ # Python 3
+ echo Python3 test
+ $PYTHON trex_unit_test.py "${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
+
+