diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2011-08-19 16:02:57 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2011-08-19 16:02:57 (GMT) |
commit | 00cdf98d005604d4ebf243c58ecacfc1c904f1fd (patch) | |
tree | 457b68eca73df1e00cc7a299d8038fedf9ab99b6 /tools/h5jam/CMakeLists.txt | |
parent | 85eabb54fe67701bec6165f67f57e5aae1f155a1 (diff) | |
download | hdf5-00cdf98d005604d4ebf243c58ecacfc1c904f1fd.zip hdf5-00cdf98d005604d4ebf243c58ecacfc1c904f1fd.tar.gz hdf5-00cdf98d005604d4ebf243c58ecacfc1c904f1fd.tar.bz2 |
[svn-r21264] Purpose:
Work for:
HDFFV-7515 - GMQS: h5unjam - incorrect help page and should display when
no file is given.
and
HDFFV-5941 - h5jam: specifying a user block file with a proper HDF5 magic
number will result in a corrupted HDF5 file.
Description:
- Merged from HDF5 trunk r21236,
- Revised command help pages of h5jam and h5unjam. The descriptions
were not up to date and some were missing. (HDFFV-7515)
- Fixed h5jam not to allow specifying an HDF5 formatted file as input
file for -u (user block file) option, because the original HDF5 file
will not be accessible if allows. (HDFFV-5941)
Tested:
jam (linux32-LE), koala (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), cmake (jam, win)
Diffstat (limited to 'tools/h5jam/CMakeLists.txt')
-rw-r--r-- | tools/h5jam/CMakeLists.txt | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 536ca46..6ed7543 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -58,6 +58,7 @@ IF (BUILD_TESTING) u513.txt h5jam-help.txt h5unjam-help.txt + h5jam-ub-nohdf5.txt ) SET (HDF5_REFERENCE_TEST_FILES tall.h5 @@ -94,36 +95,57 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## - MACRO (ADD_HELP_TEST testname resultcode) + # ============================================================ + # TEST_H5JAM_OUTPUT + # For the purpose to verify only output & exitcode from h5jam + # + MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) + ADD_TEST (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) + IF (NOT "${resultcode}" STREQUAL "0") + SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") + ENDIF ("${resultcode}" STREQUAL "0") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-${testname} + NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>" - -D "TEST_ARGS=${ARGN}" + -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=h5jam-${testname}.out" + -D "TEST_OUTPUT=${expectfile}.out" -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=testfiles/h5jam-${testname}.txt" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5JAM_OUTPUT) + + # ============================================================ + # TEST_H5UNJAM_OUTPUT + # For the purpose to verify only output & exitcode from h5unjam + # + MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) + IF (NOT "${resultcode}" STREQUAL "0") + SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") + ENDIF ("${resultcode}" STREQUAL "0") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-UNJAM-${testname} + NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=h5unjam-${testname}.out" + -D "TEST_OUTPUT=${expectfile}.out" -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=testfiles/h5unjam-${testname}.txt" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_HELP_TEST) + ENDMACRO (TEST_H5UNJAM_OUTPUT) MACRO (CLEANUP testname) ADD_TEST ( @@ -342,7 +364,14 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## - ADD_HELP_TEST(help 0 -h) +#------------------------------- +# Testing h5jam +#------------------------------- + # help page + TEST_H5JAM_OUTPUT(h5jam-help 0 -h) + + # don't allow HDF5 format file as an user block file + TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5) JAMTEST (tall_u10 u10.txt tall.h5 ta2.h5) CHECKFILE (tall_u10 tall.h5 ta2.h5) @@ -457,6 +486,12 @@ IF (BUILD_TESTING) CHECKFILE (N_twithub513_u513_c tall.h5 tay9.h5) # CLEANUP (N_twithub513_u513_c tay9.h5) +#------------------------------- +# Testing h5unjam +#------------------------------- + # help page + TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h) + SETUP (twithub_tall twithub.h5 tai1.h5) UNJAMTEST (twithub_tall tai1.h5 o10.txt taa1.h5) CHECKFILE (twithub_tall tall.h5 taa1.h5) |