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 | if [ $# -gt 0 ]; then |
---|
8 | while getopts t:csh option; do |
---|
9 | case $option in |
---|
10 | c) export SETTE_CLEAN_CONFIGS='yes' |
---|
11 | export SETTE_SYNC_CONFIGS='yes' |
---|
12 | echo "" |
---|
13 | echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation" |
---|
14 | echo "";; |
---|
15 | s) export SETTE_SYNC_CONFIGS='yes' |
---|
16 | echo "" |
---|
17 | echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration" |
---|
18 | echo "";; |
---|
19 | t) export SETTE_TEST_CONFIGS=$OPTARG |
---|
20 | echo "" |
---|
21 | echo "Configuration $SETTE_TEST_CONFIGS will be tested if they are available" |
---|
22 | echo "" ;; |
---|
23 | h | *) echo 'sette.sh allows no arguments (in this case all configuration will be tested)' |
---|
24 | echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations' |
---|
25 | echo '-c to clean each configuration' |
---|
26 | echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;; |
---|
27 | esac |
---|
28 | done |
---|
29 | shift $((OPTIND - 1)) |
---|
30 | fi |
---|
31 | |
---|
32 | . ./param.cfg |
---|
33 | |
---|
34 | # run sette on reference configuration |
---|
35 | ./sette_reference-configurations.sh |
---|
36 | if [[ $? != 0 ]]; then |
---|
37 | echo "" |
---|
38 | echo "--------------------------------------------------------------" |
---|
39 | echo "./sette_cfg-ref.sh didn't finish properly, need investigations" |
---|
40 | echo "--------------------------------------------------------------" |
---|
41 | echo "" |
---|
42 | exit 42 |
---|
43 | fi |
---|
44 | |
---|
45 | # run sette on test cases |
---|
46 | ./sette_test-cases.sh |
---|
47 | if [[ $? != 0 ]]; then |
---|
48 | echo "" |
---|
49 | echo "-----------------------------------------------------------------" |
---|
50 | echo "./sette_test-cases.sh didn't finish properly, need investigations" |
---|
51 | echo "-----------------------------------------------------------------" |
---|
52 | echo "" |
---|
53 | exit 42 |
---|
54 | fi |
---|
55 | |
---|
56 | # run sette report |
---|
57 | echo "" |
---|
58 | echo "-------------------------------------------------------------" |
---|
59 | echo "./sette_rpt.sh (script will wait all nemo_sette run are done)" |
---|
60 | echo "-------------------------------------------------------------" |
---|
61 | echo "" |
---|
62 | NRUN=999 |
---|
63 | NIT=0 |
---|
64 | while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do |
---|
65 | nit=$((nit+1)) |
---|
66 | NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) |
---|
67 | if [[ $NRUN -ne 0 ]]; then |
---|
68 | printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; |
---|
69 | else |
---|
70 | printf "%-50s\n" " " |
---|
71 | ./sette_rpt.sh |
---|
72 | exit |
---|
73 | fi |
---|
74 | sleep 10 |
---|
75 | done |
---|
76 | printf "\n" |
---|
77 | echo "" |
---|
78 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
79 | echo "" |
---|