Salome HOME
Improve SQUISH test scripts
[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 for suite in ./test.squish/suite_*
28 do
29   set +e
30   squishrunner --port=${SQUISHSERVER_PORT} --testsuite ${suite} --reportgen stdout --exitCodeOnFail 1
31   EXIT_CODE=$?
32   set -e
33   if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi
34 done
35
36 squishserver --verbose --port=${SQUISHSERVER_PORT} --stop
37 for aut in linux_run.sh salome_run.sh; do
38   squishserver --config removeAUT ${aut} $(pwd)
39 done
40
41 exit ${RETVAL}