1 | #!/bin/sh |
---|
2 | # initialise user dependent variable |
---|
3 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
4 | MAIN_DIR=$(dirname $SETTE_DIR) |
---|
5 | |
---|
6 | # Parse command-line arguments |
---|
7 | # |
---|
8 | # -t "test configurations": select active test configurations |
---|
9 | # (overrides selection made using |
---|
10 | # environment variable SETTE_TEST_CONFIGS) |
---|
11 | |
---|
12 | if [ $# -gt 0 ]; then |
---|
13 | while getopts t: option; do |
---|
14 | case $option in |
---|
15 | t) export SETTE_TEST_CONFIGS=$OPTARG ;; |
---|
16 | h) echo 'sette.sh allow no arguments (all configuration will be tested or -t "CFG1_to_test CFG2_to_test ..."'; exit 42 ;; |
---|
17 | esac |
---|
18 | done |
---|
19 | shift $((OPTIND - 1)) |
---|
20 | fi |
---|
21 | |
---|
22 | . ./param.cfg |
---|
23 | |
---|
24 | # run sette on reference configuration |
---|
25 | ./sette_reference-configurations.sh |
---|
26 | if [[ $? != 0 ]]; then |
---|
27 | echo "" |
---|
28 | echo "--------------------------------------------------------------" |
---|
29 | echo "./sette_cfg-ref.sh didn't finish properly, need investigations" |
---|
30 | echo "--------------------------------------------------------------" |
---|
31 | echo "" |
---|
32 | exit 42 |
---|
33 | fi |
---|
34 | |
---|
35 | # run sette on test cases |
---|
36 | ./sette_test-cases.sh |
---|
37 | if [[ $? != 0 ]]; then |
---|
38 | echo "" |
---|
39 | echo "-----------------------------------------------------------------" |
---|
40 | echo "./sette_test-cases.sh didn't finish properly, need investigations" |
---|
41 | echo "-----------------------------------------------------------------" |
---|
42 | echo "" |
---|
43 | exit 42 |
---|
44 | fi |
---|
45 | |
---|
46 | # run sette report |
---|
47 | echo "" |
---|
48 | echo "-------------------------------------------------------------" |
---|
49 | echo "./sette_rpt.sh (script will wait all nemo_sette run are done)" |
---|
50 | echo "-------------------------------------------------------------" |
---|
51 | echo "" |
---|
52 | NRUN=999 |
---|
53 | NIT=0 |
---|
54 | while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do |
---|
55 | nit=$((nit+1)) |
---|
56 | NRUN=$( ${BATCH_STAT} | grep nemo_sette | wc -l ) |
---|
57 | if [[ $NRUN -ne 0 ]]; then |
---|
58 | printf "%-3d %s\r" $NRUN 'nemo_sette run still in queue or running ...'; |
---|
59 | else |
---|
60 | printf "%-50s\n" " " |
---|
61 | ./sette_rpt.sh |
---|
62 | exit |
---|
63 | fi |
---|
64 | sleep 10 |
---|
65 | done |
---|
66 | printf "\n" |
---|
67 | echo "" |
---|
68 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
69 | echo "" |
---|