[11161] | 1 | #!/bin/sh |
---|
| 2 | # initialise user dependent variable |
---|
[3520] | 3 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
[6460] | 4 | MAIN_DIR=$(dirname $SETTE_DIR) |
---|
[3520] | 5 | |
---|
[11161] | 6 | # Parse command-line arguments |
---|
| 7 | if [ $# -gt 0 ]; then |
---|
[12569] | 8 | while getopts t:csh option; do |
---|
[11161] | 9 | case $option in |
---|
[12569] | 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 "";; |
---|
[11161] | 19 | t) export SETTE_TEST_CONFIGS=$OPTARG |
---|
| 20 | echo "" |
---|
| 21 | echo "Configuration $SETTE_TEST_CONFIGS will be tested if they are available" |
---|
| 22 | echo "" ;; |
---|
[12569] | 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 ;; |
---|
[11161] | 27 | esac |
---|
| 28 | done |
---|
| 29 | shift $((OPTIND - 1)) |
---|
[3520] | 30 | fi |
---|
| 31 | |
---|
[11161] | 32 | . ./param.cfg |
---|
[3520] | 33 | |
---|
[11161] | 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 |
---|
[3520] | 43 | fi |
---|
| 44 | |
---|
[11161] | 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 |
---|
[3520] | 54 | fi |
---|
| 55 | |
---|
[11161] | 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)) |
---|
[12569] | 66 | NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) |
---|
[11161] | 67 | if [[ $NRUN -ne 0 ]]; then |
---|
[12569] | 68 | printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; |
---|
[11161] | 69 | else |
---|
| 70 | printf "%-50s\n" " " |
---|
| 71 | ./sette_rpt.sh |
---|
| 72 | exit |
---|
| 73 | fi |
---|
| 74 | sleep 10 |
---|
[3520] | 75 | done |
---|
[11161] | 76 | printf "\n" |
---|
| 77 | echo "" |
---|
| 78 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
| 79 | echo "" |
---|