Merge changes Ic53c9f04,Iae5644f6,Ib3975607
[transportpce.git] / tests / launch_tests.sh
1 #!/bin/sh
2
3 if [ "$USE_LIGHTY" != "True" ]; then
4     ./build_karaf_for_tests.sh
5 fi
6
7 for arg in $@; do
8     if [ -z "$test_suite" ]; then
9         test_suite=$1
10     else
11 # Tox reinterprets "olm" and "pce" by "../olm" "../pce" because of the
12 # changedir directive and the presence of modules folders "olm" and pce"
13 # at project root.
14         if [ "$arg" = "../olm" ]; then
15             arglist=$arglist" olm"
16         elif [ "$arg" = "../pce" ]; then
17             arglist=$arglist" pce"
18         else
19             arglist=$arglist" "$arg
20         fi
21     fi
22 done
23
24 scriptlist=""
25 if [ -z "$arglist" ]; then
26     scriptlist="transportpce_tests/$test_suite/test[0-9][0-9]_*.py"
27 else
28     for test in $arglist; do
29         scriptlist=$scriptlist" transportpce_tests/$test_suite/test[0-9][0-9]_$test.py"
30     done
31 fi
32 if [ -z "$LAUNCHER" ]; then
33     LAUNCHER="nosetests --with-xunit";
34 fi
35
36 for script in $scriptlist; do
37     echo $LAUNCHER $(ls $script)
38     $LAUNCHER $script || exit 1
39 done