Salome HOME
Improve Linux scripts, activate all SQUISH tests
[modules/shaper.git] / test_squish.sh
1 #!/bin/bash
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 120
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 cases="$2"
31
32   echo "Running suite ${suite}"
33   if [ ${cases} != "" ]; then echo "Cases ${cases}"; fi
34
35   set +e
36   squishrunner --port=${SQUISHSERVER_PORT} --testsuite ${suite} ${cases} --reportgen stdout --exitCodeOnFail 1
37   EXIT_CODE=$?
38   set -e
39   if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
40 }
41
42 squishrunner_batch() {
43   local suite=$1
44   local tests=$2
45
46   set +x
47   local tests_arg=
48   for test in ${tests}; do
49     tests_arg="${tests_arg} --testcase ${test}"
50   done
51   set -x
52
53   echo ${tests_arg}
54   squishrunner_run ${suite} "${tests_arg}"
55 }
56
57 #squishrunner_batch ./test.squish/suite_ISSUES 'tst_BASE tst_DISTANCE tst_PARALLEL_1 tst_PARALLEL_2 tst_PERPENDICULAR_1 tst_RADIUS tst_c tst_common_1 tst_crash_1 tst_818 tst_532'
58 #squishrunner_batch ./test.squish/suite_ISSUES_SALOME 'tst_sketch_001 tst_sketch_002 tst_sketch_003 tst_sketch_004 tst_sketch_005 tst_sketch_006 tst_sketch_007 tst_sketch_008 tst_sketch_009 tst_sketch_010 tst_sketch_011 tst_474 tst_532 tst_576 tst_679'
59
60 for suite in ./test.squish/suite_*; do
61   squishrunner_run ${suite}
62 done
63
64
65
66
67 squishserver --verbose --port=${SQUISHSERVER_PORT} --stop
68 for aut in linux_run.sh salome_run.sh; do
69   squishserver --config removeAUT ${aut} $(pwd)
70 done
71
72 exit ${RETVAL}