Turn ServiceDataStoreOperationsImpl into Component
[transportpce.git] / tests / launch_tests.sh
1 #!/bin/sh
2
3 if [ -n "$USE_ODL_ALT_KARAF_ENV" ]; then
4     echo "using environment variables from $USE_ODL_ALT_KARAF_ENV"
5     . $USE_ODL_ALT_KARAF_ENV
6 fi
7
8 for arg in $@; do
9     if [ -z "$test_suite" ]; then
10         test_suite=$1
11     else
12 # Tox reinterprets "olm" and "pce" by "../olm" "../pce" because of the
13 # changedir directive and the presence of modules folders "olm" and pce"
14 # at project root.
15         if [ "$arg" = "../olm" ]; then
16             arglist=$arglist" olm"
17         elif [ "$arg" = "../pce" ]; then
18             arglist=$arglist" pce"
19         else
20             arglist=$arglist" "$arg
21         fi
22     fi
23 done
24
25 scriptlist=""
26 if [ -z "$arglist" ]; then
27     scriptlist="transportpce_tests/$test_suite/test[0-9][0-9]_*.py"
28 else
29     for test in $arglist; do
30         scriptlist=$scriptlist" transportpce_tests/$test_suite/test[0-9][0-9]_$test.py"
31     done
32 fi
33 if [ -z "$LAUNCHER" ]; then
34     if [ `which pytest-3` ]; then
35             LAUNCHER="pytest-3"
36     else
37         if [ `which pytest` ]; then
38             LAUNCHER="pytest"
39         else
40             LAUNCHER="python3 -m pytest"
41         fi
42     fi
43     if [ -d "allure-report" ]; then
44         LAUNCHER="$LAUNCHER --alluredir=allure-report/"
45     fi
46     LAUNCHER="$LAUNCHER -q"
47 fi
48
49 for script in $scriptlist; do
50     echo $LAUNCHER $(ls $script)
51     $LAUNCHER $script || exit 1
52 done