From a5c29a9632f6aa213550cea063499878301c7698 Mon Sep 17 00:00:00 2001 From: Yeongdo Park Date: Sat, 3 Nov 2018 13:20:03 -0400 Subject: [PATCH] test script exit code -1 if any error exceed tolerence, tolerence set to 2.5% --- testApp/Alltest | 11 +++++++++++ testApp/chemFoam.C | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/testApp/Alltest b/testApp/Alltest index a82ea0d..c21d84d 100755 --- a/testApp/Alltest +++ b/testApp/Alltest @@ -1,6 +1,12 @@ #!/bin/bash +# + mkdir cases +exit_code=0 + +error_cases=() + for sp in H2 H O O2 OH H2O HO2 H2O2 \ C CH CH2 CH2\(S\) CH3 CH4 CO CO2 \ HCO CH2O CH2OH CH3O CH3OH C2H C2H2 C2H3 \ @@ -13,4 +19,9 @@ do foamDictionary -entry fractions -set '{}' cases/$sp/constant/initialConditions foamDictionary -entry fractions.$sp -set 1 cases/$sp/constant/initialConditions ./canteraTest -case cases/$sp + [ $? -ne 0 ] && error_cases[${#error_cases[*]}]=$sp && exit_code=-1 done + +echo ${error_cases[*]} + +exit $exit_code diff --git a/testApp/chemFoam.C b/testApp/chemFoam.C index eadd9be..8770c20 100644 --- a/testApp/chemFoam.C +++ b/testApp/chemFoam.C @@ -47,7 +47,7 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -const scalar relTol = 2. / 100.; +const scalar relTol = 2.5 / 100.; inline scalar relError (scalar x, scalar x0) {