Changeset 1be76d8 in flexpart.git for tests/NILU/run_tests


Ignore:
Timestamp:
Oct 1, 2015, 3:29:19 PM (9 years ago)
Author:
Ignacio Pisso <Ignacio.Pisso@…>
Branches:
master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug
Children:
ac5b22b
Parents:
1333256
Message:

add 7 basic tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/NILU/run_tests

    r1333256 r1be76d8  
    11#!/bin/bash
    22
    3 FLEXOUT_TMP=/home/ignacio/repos/flextest/
     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
    420
    521suffix=$(date "+%y-%m-%d_%H%M%S")
    6 #test_tmp=${FLEXOUT_TMP}${base_dir}${test_dir}_${suffix}
    7 base_dir=${FLEXOUT_TMP}/tests_${suffix}/
    8 mkdir $base_dir
    9 
    10 FP_exec=/home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran
    11 
    12 #test_dir=$1
    13 #FP_exec=$2
    14 #base_dir=$3
    15 
    16 ./run_test test_1  /home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran $base_dir
    17 ./run_test test_2  /home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran $base_dir
    18 
    19 # 6 species
    20 ./run_test test_Volc  /home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran $base_dir
     22#tests_dir=tests_${suffix}/
     23tests_dir=${group_name}_${suffix}/
     24path_tests=${path_flextest}/$tests_dir
     25mkdir $path_tests
    2126
    2227
    23 #exit
     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')
    2433
    25 ./run_test test_HelloWorld  /home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran $base_dir
    26 ./run_test test_Fwd1  /home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran $base_dir
    27 ./run_test test_Fwd2  /home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran $base_dir
     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 TracChangeset for help on using the changeset viewer.
hosted by ZAMG