diff options
-rw-r--r-- | test/testcheck_version.sh.in | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index 593a466..e2fa44c 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -27,6 +27,7 @@ Static_exec=@STATIC_EXEC@ CMP='cmp -s' DIFF='diff -c' +RM='rm -f' # Function definitions # @@ -116,9 +117,9 @@ TESTING() { TEST_NAME=tcheck_version # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary - expect=expected_out - actual=actual_out - actual_err=actual_err_out + expect=${TEST_NAME}_expect.out + actual=${TEST_NAME}_actual.out + actual_err=${TEST_NAME}_actual.err arguments= h5DisableVersion="$1" @@ -136,7 +137,7 @@ TESTING() { if [ "$wrongversionnumbers" = none ]; then # OK: No warning, exit 0 cp /dev/null $expect - expected_code=0 + expect_code=0 else arguments=-t"$wrongversionnumbers" # calculate mismatched version numbers by listing. @@ -152,16 +153,16 @@ TESTING() { 1) # W2/OK: Different Warning, exit 0. WarnMesg2 > $expect - expected_code=0 + expect_code=0 ;; [2-9]|[1-9][0-9]*) # OK: No warning, exit 0 cp /dev/null $expect - expected_code=0 + expect_code=0 ;; *) # W/A: Warning, abort and exit non-0. WarnMesg > $expect - expected_code=134 # Signal Abort exit code (128+6) + expect_code=134 # Signal Abort exit code (128+6) ;; esac fi @@ -174,9 +175,9 @@ TESTING() { ret_code=$? cat $actual_err >> $actual - if [ \( $expected_code -ne $ret_code \) ]; then + if [ \( $expect_code -ne $ret_code \) ]; then echo "*FAILED*" - echo " Expected exit code ($expected_code) differs from actual code ($ret_code)" + echo " Expected exit code ($expect_code) differs from actual code ($ret_code)" nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" @@ -187,9 +188,11 @@ TESTING() { test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - # Clean up output file + # Clean up output file. + # Also clean the core file generated by H5check_version's abort. if test -z "$HDF5_NOCLEANUP"; then - rm -f $expected_out $actual_out $actual_err + $RM $expect $actual $actual_err + $RM core fi } @@ -221,7 +224,15 @@ h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` DEBUGPRINT $h5versmajor.$h5versminor.$h5versrelease - +case "$h5versmajor$h5versminor$h5versrelease" in + [0-9]*) # good. noop. + ;; + *) + echo "Illegal library version numbers($h5versmajor.$h5versminor.$h5versrelease)" + echo "Test aborted" + exit 1 + ;; +esac # Three Categories of tests: # Normal: where the version numbers all matched (wrong_version == none). |