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