summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-08-12 16:04:06 (GMT)
committerGitHub <noreply@github.com>2021-08-12 16:04:06 (GMT)
commitcc866bc154d761157ad0a1dbc96b20df946b8970 (patch)
treeedce8936fd05b34efbda1c15609fd06b21f42cf2 /test
parent7a0776dcff17330f2999420de888fd156a24239b (diff)
downloadhdf5-cc866bc154d761157ad0a1dbc96b20df946b8970.zip
hdf5-cc866bc154d761157ad0a1dbc96b20df946b8970.tar.gz
hdf5-cc866bc154d761157ad0a1dbc96b20df946b8970.tar.bz2
Rework version-check for relnum in H5checkversion function (#896)
Diffstat (limited to 'test')
-rw-r--r--test/CMakeTests.cmake2
-rw-r--r--test/testcheck_version.sh.in106
2 files changed, 54 insertions, 54 deletions
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 4cf11f5..2a8e425 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -704,10 +704,10 @@ set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
WILL_FAIL "true"
)
+# release + 1 should pass
add_test (NAME H5TEST-tcheck_version-release COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tr")
set_tests_properties (H5TEST-tcheck_version-release PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- WILL_FAIL "true"
)
##############################################################################
diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in
index 43d1b46..6378ee5 100644
--- a/test/testcheck_version.sh.in
+++ b/test/testcheck_version.sh.in
@@ -15,7 +15,7 @@
# Tests for the H5check_version function.
#
# Programmer: Albert Cheng
-# Sep 28, 2009
+# Sep 28, 2009
srcdir=@srcdir@
@@ -24,7 +24,7 @@ srcdir=@srcdir@
Shared_Lib=@enable_shared@
Static_Lib=@enable_static@
Static_exec=@STATIC_EXEC@
-h5haveexitcode=yes # default is yes
+h5haveexitcode=yes # default is yes
CMP='cmp -s'
DIFF='diff -c'
@@ -103,10 +103,10 @@ WarnMesg2(){
# mismatch).
#
# Expected results:
-# Value of $HDF5_DISABLE_VERSION_CHECK
-# unset "" -1 0 1 2 3
-# Matched OK OK OK OK OK OK OK
-# Mismatched W/A W/A W/A W/A W2/OK OK W2/OK
+# Value of $HDF5_DISABLE_VERSION_CHECK
+# unset "" -1 0 1 2 3
+# Matched OK OK OK OK OK OK OK
+# Mismatched W/A W/A W/A W/A W2/OK OK W2/OK
# Result codes:
# OK: No warning, exit 0.
# W/A: Warning, abort and exit non-0.
@@ -130,42 +130,42 @@ TESTING() {
xxh5versrelease=$h5versrelease
if [ "$h5DisableVersion" = unset ]; then
- envcmd="" # noop
+ envcmd="" # noop
else
- envcmd="env HDF5_DISABLE_VERSION_CHECK=$h5DisableVersion"
+ envcmd="env HDF5_DISABLE_VERSION_CHECK=$h5DisableVersion"
fi
if [ "$wrongversionnumbers" = none ]; then
- # OK: No warning, exit 0
- cp /dev/null $expect
- expect_code=0
+ # OK: No warning, exit 0
+ cp /dev/null $expect
+ expect_code=0
else
- arguments=-t"$wrongversionnumbers"
- # calculate mismatched version numbers by listing.
- case $wrongversionnumbers in
- "M") xxh5versmajor=`expr $h5versmajor + 1`
- ;;
- "m") xxh5versminor=`expr $h5versminor + 1`
- ;;
- "r") xxh5versrelease=`expr $h5versrelease + 1`
- ;;
- esac
- case "$h5DisableVersion" in
- 1)
- # W2/OK: Different Warning, exit 0.
- WarnMesg2 > $expect
- expect_code=0
- ;;
- [2-9]|[1-9][0-9]*)
- # OK: No warning, exit 0
- cp /dev/null $expect
- expect_code=0
- ;;
- *) # W/A: Warning, abort and exit non-0.
- WarnMesg > $expect
- expect_code=6 # Signal Abort exit code (128+6)
- ;;
- esac
+ arguments=-t"$wrongversionnumbers"
+ # calculate mismatched version numbers by listing.
+ case $wrongversionnumbers in
+ "M") xxh5versmajor=`expr $h5versmajor + 1`
+ ;;
+ "m") xxh5versminor=`expr $h5versminor + 1`
+ ;;
+ "r") xxh5versrelease=`expr $h5versrelease + 1`
+ ;;
+ esac
+ case "$h5DisableVersion" in
+ 1)
+ # W2/OK: Different Warning, exit 0.
+ WarnMesg2 > $expect
+ expect_code=0
+ ;;
+ [2-9]|[1-9][0-9]*)
+ # OK: No warning, exit 0
+ cp /dev/null $expect
+ expect_code=0
+ ;;
+ *) # W/A: Warning, abort and exit non-0.
+ WarnMesg > $expect
+ expect_code=6 # Signal Abort exit code (128+6)
+ ;;
+ esac
fi
# Run test.
@@ -177,23 +177,23 @@ TESTING() {
cat $actual_err >> $actual
if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then
- echo "*FAILED*"
- echo " Expected exit code ($expect_code) differs from actual code ($ret_code)"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ echo " Expected exit code ($expect_code) differs from actual code ($ret_code)"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
- echo " PASSED"
+ echo " PASSED"
else
- echo "*FAILED*"
- echo " Expected result differs from actual result"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ echo "*FAILED*"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
# Clean up output file.
# Also clean the core file generated by H5check_version's abort.
if test -z "$HDF5_NOCLEANUP"; then
- $RM $expect $actual $actual_err
- $RM core
+ $RM $expect $actual $actual_err
+ $RM core
fi
}
@@ -201,15 +201,15 @@ TESTING() {
# Echo parameters for debugging if verbose mode is on.
DEBUGPRINT() {
if [ -n "$debugmode" ]; then
- echo $*
+ echo $*
fi
}
# MAIN Body
nerrors=0
-verbose=yes # default on
-debugmode= # default off
+verbose=yes # default on
+debugmode= # default off
H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h`
h5libsettings=../src/libhdf5.settings
@@ -240,13 +240,13 @@ fi
# Three Categories of tests:
# Normal: where the version numbers all matched (wrong_version == none).
# Mismatched version numbers (could be Major or minor version
-# or release numbers or a combination of all three.)
+# or release numbers or a combination of all three.)
# Test all the above with different values of the environment variable,
# HDF5_DISABLE_VERSION_CHECK, as unset, "", -1, 0, 1, 2, 3
for val_disable_version_check in unset "" -1 0 1 2 3; do
- for wrong_version in none M m r; do
- TESTING "$val_disable_version_check" "$wrong_version"
+ for wrong_version in none M m; do
+ TESTING "$val_disable_version_check" "$wrong_version"
done
done