#!/bin/bash #input: # FP_exec : path to flexpart executable # path_flextest: directory path to output base directory # test_names (bash array): list of tests to be run # defaults #FP_exec=/home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran #FP_exec=/xnilu_wrk/flexbuild/tests/NILU/FP_ecmwf_gfortran FP_exec=$WORKSPACE/src/FP_ecmwf_gfortran #path_flextest=/home/ignacio/repos/flextest/ #path_flextest=/xnilu_wrk/flexbuild/flextest/ path_flextest=$WORKSPACE/flextest/ #options_default=/xnilu_wrk/flexbuild/flexpart/options/ options_default=$WORKSPACE/options/ #declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2') #test_names[0]='1' test_names[0]='HelloWorld' group_name=tests source ./$1 suffix=$(date "+%y-%m-%d_%H%M%S") #tests_dir=tests_${suffix}/ tests_dir=${group_name}_${suffix}/ path_tests=${path_flextest}/$tests_dir mkdir $path_tests #declare Bash Array #declare -a test_names=('1' '2' 'HelloWorld') #declare -a test_names=('1' '2' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc') #declare -a test_names=('2' 'Volc') #declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2') #Print the Whole Bash Array s_test_names=${test_names[@]} # Length of the Bash Array n_tests=${#test_names[@]} #echo n_tests=$n_tests echo run $s_test_names echo total $n_tests tests #test #tests_dir='tests_15-08-19_113139/' #path_tests=${path_flextest}/$tests_dir outlog=stdout.log i=0 i_end=$n_tests while [ $i -lt $i_end ] ; do let j=i+1 name=${test_names[i]}; echo run test no. $j # echo name= $name # echo working dir= $path_tests/test_$name # echo executable= $FP_exec # echo default options from $options_default ./run_test test_$name $FP_exec $path_tests $options_default echo test $name terminated success="$(cat $path_tests/test_$name/$outlog | grep CONGRATULATIONS | wc -l)" echo success=$success let i=i+1; done tot_successes="$(cat $path_tests/test_*/$outlog | grep CONGRATULATIONS | wc -l)" tot_runs="$(ls -1 $path_tests | wc -l)" echo ' ' echo finished $tot_runs tests of $n_tests echo $tot_successes seccessful exit ./run_test test_1 $FP_exec $path_tests ./run_test test_2 $FP_exec $path_tests # 6 species ./run_test test_Volc $FP_exec $path_tests ./run_test test_HelloWorld $FP_exec $path_tests ./run_test test_Fwd1 $FP_exec $path_tests ./run_test test_Fwd2 $FP_exec $path_tests ./run_test test_Bwd1 $FP_exec $path_tests