Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / external / esmf_time_f90 / testall.csh
blob9f8082749a8a82c2e0cb882913a86145104ba29c
1 #!/bin/csh
3 # Build and run Test1.exe and compare results with known-good output
5 set selflong = $0
6 set self = $selflong:t
8 if ( ! -f ../../configure.wrf ) then
9 echo "ERROR: must run ../../configure before building esmf_time_f90 unit tests"
10 exit -1
11 endif
13 # build
14 set allpass = "true"
15 make superclean >& /dev/null
16 cd ../.. ; make esmf_time_f90_only >&! external/esmf_time_f90/make_tests.out ; cd external/esmf_time_f90
17 # run tests for both ESMF_ and WRFU_ interfaces...
18 set testoutok = "Test1.out.correct"
19 foreach tst ( "ESMF" "WRFU" )
20 set testname = "Test1_${tst}"
21 ./${testname}.exe >&! ${testname}.out || echo "ERROR ${testname}: failed to execute ./${testname}.exe, see make_tests.out" && exit 20
22 # evaluate test results
23 diff ${testoutok} ${testname}.out >& /dev/null
24 set ok = $status
25 if ( $ok == 0 ) then
26 echo "PASS ${testname}"
27 else
28 set allpass = "false"
29 echo
30 echo "FAIL ${testname}"
31 echo
32 which xxdiff >& /dev/null
33 set ok = $status
34 if ( $ok == 0 ) then
35 xxdiff ${testoutok} ${testname}.out
36 else
37 diff ${testoutok} ${testname}.out
38 endif
39 endif
40 end
41 # clean up if all tests passed
42 if ( $allpass == "true" ) then
43 # make testclean >& /dev/null
44 make superclean >& /dev/null
45 endif