Salome HOME
Restrict test cases for Jenkins
[modules/shaper.git] / test_squish.sh
1 #!/bin/bash -x
2
3 a_dir=$(dirname $0)
4
5 set -e
6
7 if [ "$#" = 1 ]; then
8   SQUISHSERVER_PORT=$1
9 elif [ -z ${SQUISHSERVER_PORT} ]; then
10   SQUISHSERVER_PORT=4320
11 fi
12
13 export TEST_DATA_DIR=$(cd ${a_dir}; pwd)/test.squish/shared/testdata
14
15 source ${a_dir}/env_squish.sh
16
17 for aut in linux_run.sh salome_run.sh; do
18   squishserver --config addAUT ${aut} $(pwd)
19 done
20 squishserver --config setAUTTimeout 60
21 squishserver --verbose --port=${SQUISHSERVER_PORT} --stop
22 squishserver --verbose --port=${SQUISHSERVER_PORT} 2>server.err &
23
24 squishrunner --port=${SQUISHSERVER_PORT} --config setCursorAnimation off
25
26 RETVAL=0
27
28 squishrunner_run() {
29   local suite=$1
30   local tests=$2
31
32   set +x
33   local tests_arg=
34   for test in ${tests}; do
35     tests_arg="${tests_arg} --testcase ${test}"
36   done
37   set -x
38
39   set +e
40   squishrunner --port=${SQUISHSERVER_PORT} --testsuite ${suite} ${tests_arg} --reportgen stdout --exitCodeOnFail 1
41   EXIT_CODE=$?
42   set -e
43   if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
44 }
45
46 squishrunner_run ./test.squish/suite_ISSUES 'tst_BASE tst_DISTANCE tst_PARALLEL_1 tst_PARALLEL_2 tst_RADIUS tst_c tst_common_1 tst_crash_1 tst_818'
47
48 squishserver --verbose --port=${SQUISHSERVER_PORT} --stop
49 for aut in linux_run.sh salome_run.sh; do
50   squishserver --config removeAUT ${aut} $(pwd)
51 done
52
53 exit ${RETVAL}