source: flexpart.git/tests/NILU/run_tests @ 17bfbe1

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file since 17bfbe1 was 17bfbe1, checked in by Ignacio Pisso <Ignacio.Pisso@…>, 9 years ago

modify WORKSPACE environment variable to run CI tests locally

  • Property mode set to 100755
File size: 2.3 KB
Line 
1#!/bin/bash
2
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
9#FP_exec=/home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran
10#FP_exec=/xnilu_wrk/flexbuild/tests/NILU/FP_ecmwf_gfortran
11FP_exec=$WORKSPACE/src/FP_ecmwf_gfortran
12#path_flextest=/home/ignacio/repos/flextest/
13#path_flextest=/xnilu_wrk/flexbuild/flextest/
14path_flextest=$WORKSPACE/flextest/
15#options_default=/xnilu_wrk/flexbuild/flexpart/options/
16options_default=$WORKSPACE/options/
17#declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2')
18#test_names[0]='1'
19test_names[0]='HelloWorld' 
20
21group_name=tests
22
23source ./$1
24
25
26suffix=$(date "+%y-%m-%d_%H%M%S")
27#tests_dir=tests_${suffix}/
28tests_dir=${group_name}_${suffix}/
29path_tests=${path_flextest}/$tests_dir
30mkdir $path_tests
31
32
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
41s_test_names=${test_names[@]}
42# Length of the Bash Array
43n_tests=${#test_names[@]}
44#echo n_tests=$n_tests
45echo 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
52outlog=stdout.log
53i=0
54i_end=$n_tests
55while [ $i -lt $i_end ] ;
56do
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
65let i=i+1;
66done
67 
68tot_successes="$(cat $path_tests/test_*/$outlog  | grep CONGRATULATIONS  | wc -l)"
69tot_runs="$(ls -1 $path_tests | wc -l)"
70
71echo ' '
72echo finished  $tot_runs tests of $n_tests 
73echo $tot_successes seccessful
74exit
75
76
77
78
79
80
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
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG