source: flexpart.git/tests/NILU/run_tests @ 1be76d8

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

add 7 basic tests

  • Property mode set to 100755
File size: 2.0 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
9FP_exec=/home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran
10path_flextest=/home/ignacio/repos/flextest/
11options_default=/home/ignacio/repos/flexpart/options/
12#declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2')
13#test_names[0]='1'
14test_names[0]='HelloWorld' 
15
16group_name=tests
17
18source ./$1
19
20
21suffix=$(date "+%y-%m-%d_%H%M%S")
22#tests_dir=tests_${suffix}/
23tests_dir=${group_name}_${suffix}/
24path_tests=${path_flextest}/$tests_dir
25mkdir $path_tests
26
27
28#declare Bash Array
29#declare -a test_names=('1' '2' 'HelloWorld')
30#declare -a test_names=('1' '2' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc')
31#declare -a test_names=('2' 'Volc')
32#declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2')
33
34#blabla
35#Print the Whole Bash Array
36s_test_names=${test_names[@]}
37# Length of the Bash Array
38n_tests=${#test_names[@]}
39#echo n_tests=$n_tests
40echo run $n_tests  tests:  $s_test_names
41
42#test
43#tests_dir='tests_15-08-19_113139/'
44#path_tests=${path_flextest}/$tests_dir
45
46
47outlog=stdout.log
48i=0
49i_end=$n_tests
50while [ $i -lt $i_end ] ;
51do
52  let j=i+1
53  name=${test_names[i]};
54  echo test no. $j name= $name
55  echo in $path_tests/test_$name
56  ./run_test test_$name  $FP_exec $path_tests $options_default
57  echo terminated
58  success="$(cat $path_tests/test_$name/$outlog  | grep CONGRATULATIONS  | wc -l)"
59  echo success=$success
60let i=i+1;
61done
62 
63tot_successes="$(cat $path_tests/test_*/$outlog  | grep CONGRATULATIONS  | wc -l)"
64tot_runs="$(ls -1 $path_tests | wc -l)"
65
66echo ' '
67echo finished  $tot_runs tests of $n_tests 
68echo $tot_successes seccessful
69exit
70
71
72
73
74
75
76
77
78
79
80
81
82
83./run_test test_1  $FP_exec $path_tests
84./run_test test_2  $FP_exec $path_tests
85# 6 species
86./run_test test_Volc  $FP_exec $path_tests
87./run_test test_HelloWorld  $FP_exec $path_tests
88./run_test test_Fwd1  $FP_exec $path_tests
89./run_test test_Fwd2  $FP_exec $path_tests
90./run_test test_Bwd1  $FP_exec $path_tests
91
92
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG