[1333256] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[1be76d8] | 3 | #input: |
---|
| 4 | # FP_exec : path to flexpart executable |
---|
| 5 | # path_flextest: directory path to output base directory |
---|
| 6 | # test_names (bash array): list of tests to be run |
---|
| 7 | |
---|
| 8 | # defaults |
---|
[f7e8c22] | 9 | #FP_exec=/home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran |
---|
[17bfbe1] | 10 | #FP_exec=/xnilu_wrk/flexbuild/tests/NILU/FP_ecmwf_gfortran |
---|
| 11 | FP_exec=$WORKSPACE/src/FP_ecmwf_gfortran |
---|
[f7e8c22] | 12 | #path_flextest=/home/ignacio/repos/flextest/ |
---|
[17bfbe1] | 13 | #path_flextest=/xnilu_wrk/flexbuild/flextest/ |
---|
| 14 | path_flextest=$WORKSPACE/flextest/ |
---|
| 15 | #options_default=/xnilu_wrk/flexbuild/flexpart/options/ |
---|
| 16 | options_default=$WORKSPACE/options/ |
---|
[1be76d8] | 17 | #declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2') |
---|
| 18 | #test_names[0]='1' |
---|
| 19 | test_names[0]='HelloWorld' |
---|
| 20 | |
---|
| 21 | group_name=tests |
---|
| 22 | |
---|
| 23 | source ./$1 |
---|
| 24 | |
---|
[1333256] | 25 | |
---|
| 26 | suffix=$(date "+%y-%m-%d_%H%M%S") |
---|
[1be76d8] | 27 | #tests_dir=tests_${suffix}/ |
---|
| 28 | tests_dir=${group_name}_${suffix}/ |
---|
| 29 | path_tests=${path_flextest}/$tests_dir |
---|
| 30 | mkdir $path_tests |
---|
[1333256] | 31 | |
---|
| 32 | |
---|
[1be76d8] | 33 | #declare Bash Array |
---|
| 34 | #declare -a test_names=('1' '2' 'HelloWorld') |
---|
| 35 | #declare -a test_names=('1' '2' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc') |
---|
| 36 | #declare -a test_names=('2' 'Volc') |
---|
| 37 | #declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2') |
---|
| 38 | |
---|
| 39 | #blabla |
---|
| 40 | #Print the Whole Bash Array |
---|
| 41 | s_test_names=${test_names[@]} |
---|
| 42 | # Length of the Bash Array |
---|
| 43 | n_tests=${#test_names[@]} |
---|
| 44 | #echo n_tests=$n_tests |
---|
| 45 | echo run $n_tests tests: $s_test_names |
---|
| 46 | |
---|
| 47 | #test |
---|
| 48 | #tests_dir='tests_15-08-19_113139/' |
---|
| 49 | #path_tests=${path_flextest}/$tests_dir |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | outlog=stdout.log |
---|
| 53 | i=0 |
---|
| 54 | i_end=$n_tests |
---|
| 55 | while [ $i -lt $i_end ] ; |
---|
| 56 | do |
---|
| 57 | let j=i+1 |
---|
| 58 | name=${test_names[i]}; |
---|
| 59 | echo test no. $j name= $name |
---|
| 60 | echo in $path_tests/test_$name |
---|
| 61 | ./run_test test_$name $FP_exec $path_tests $options_default |
---|
| 62 | echo terminated |
---|
| 63 | success="$(cat $path_tests/test_$name/$outlog | grep CONGRATULATIONS | wc -l)" |
---|
| 64 | echo success=$success |
---|
| 65 | let i=i+1; |
---|
| 66 | done |
---|
| 67 | |
---|
| 68 | tot_successes="$(cat $path_tests/test_*/$outlog | grep CONGRATULATIONS | wc -l)" |
---|
| 69 | tot_runs="$(ls -1 $path_tests | wc -l)" |
---|
| 70 | |
---|
| 71 | echo ' ' |
---|
| 72 | echo finished $tot_runs tests of $n_tests |
---|
| 73 | echo $tot_successes seccessful |
---|
| 74 | exit |
---|
| 75 | |
---|
[1333256] | 76 | |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | |
---|
[1be76d8] | 81 | |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | ./run_test test_1 $FP_exec $path_tests |
---|
| 89 | ./run_test test_2 $FP_exec $path_tests |
---|
| 90 | # 6 species |
---|
| 91 | ./run_test test_Volc $FP_exec $path_tests |
---|
| 92 | ./run_test test_HelloWorld $FP_exec $path_tests |
---|
| 93 | ./run_test test_Fwd1 $FP_exec $path_tests |
---|
| 94 | ./run_test test_Fwd2 $FP_exec $path_tests |
---|
| 95 | ./run_test test_Bwd1 $FP_exec $path_tests |
---|
| 96 | |
---|
| 97 | |
---|