From 76313da943d4de0f1b94dc9f15ef9b0134445df0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 4 Mar 2011 08:46:09 -0500 Subject: [svn-r20183] Add HDF5_USING_MEMCHECKER guards around script mode ADD_TEST. This will replace the list of ignore tests in CTestCustom.cmake file. Bring back from trunk Tested: local linux --- c++/test/CMakeLists.txt | 24 +++++---- config/cmake/HDFMacros.cmake | 44 +++++++++++++--- testpar/CMakeLists.txt | 28 +++++----- tools/h5copy/CMakeLists.txt | 58 +++++++++++--------- tools/h5diff/CMakeLists.txt | 35 ++++++------- tools/h5dump/CMakeLists.txt | 96 +++++++++++++++++----------------- tools/h5ls/CMakeLists.txt | 34 ++++++------ tools/h5repack/CMakeLists.txt | 119 ++++++++++++++++++++++-------------------- tools/h5stat/CMakeLists.txt | 27 ++++++---- tools/misc/CMakeLists.txt | 54 ++++++++++--------- 10 files changed, 289 insertions(+), 230 deletions(-) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 21cb9c0..b6e645a4 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -61,17 +61,19 @@ IF (HDF5_TEST_VFD) ENDIF (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - ADD_TEST ( - NAME VFD-${vfdname}-cpp_testhdf5 - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=cpp_testhdf5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" - ) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME VFD-${vfdname}-cpp_testhdf5 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=cpp_testhdf5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 4adc455..60ee6e8 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -81,14 +81,28 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ENDIF (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) + IF (${BLDTYPE} MATCHES "Debug") + IF (WIN32 AND NOT MINGW) + IF (HDF_LEGACY_NAMING) + SET (DBG_EXT "d") + ELSE (HDF_LEGACY_NAMING) + SET (DBG_EXT "_D") + ENDIF (HDF_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (DBG_EXT "_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${BLDTYPE} MATCHES "Debug") + SET (DBG_EXT "") + ENDIF (${BLDTYPE} MATCHES "Debug") + IF (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${CMAKE_IMPORT_LIBRARY_SUFFIX}") + SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}") ELSE (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${CMAKE_SHARED_LIBRARY_SUFFIX}") + SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}") ENDIF (WIN32 AND NOT MINGW) ELSE (${libtype} MATCHES "SHARED") - SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${CMAKE_STATIC_LIBRARY_SUFFIX}") + SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") ENDIF (${libtype} MATCHES "SHARED") SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") @@ -155,21 +169,35 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ENDIF (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) + IF (${BLDTYPE} MATCHES "Debug") + IF (WIN32 AND NOT MINGW) + IF (HDF_LEGACY_NAMING) + SET (DBG_EXT "d") + ELSE (HDF_LEGACY_NAMING) + SET (DBG_EXT "_D") + ENDIF (HDF_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (DBG_EXT "_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${BLDTYPE} MATCHES "Debug") + SET (DBG_EXT "") + ENDIF (${BLDTYPE} MATCHES "Debug") + IF (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${CMAKE_IMPORT_LIBRARY_SUFFIX}") + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}") ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${CMAKE_SHARED_LIBRARY_SUFFIX}") + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}") ENDIF (WIN32 AND NOT MINGW) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) IF (HDF_LEGACY_NAMING) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/zlib${CMAKE_STATIC_LIBRARY_SUFFIX}") + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/zlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") ELSE (HDF_LEGACY_NAMING) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libzlib${CMAKE_STATIC_LIBRARY_SUFFIX}") + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libzlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") ENDIF (HDF_LEGACY_NAMING) ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libz${CMAKE_STATIC_LIBRARY_SUFFIX}") + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libz${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") ENDIF (WIN32 AND NOT MINGW) ENDIF (${libtype} MATCHES "SHARED") SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index efe2006..40db59f 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -68,19 +68,21 @@ IF (HDF5_TEST_VFD) ENDIF (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - FOREACH (test ${H5P_VFD_TESTS}) - ADD_TEST ( - NAME VFD-${vfdname}-${test} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${test}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" - ) - ENDFOREACH (test ${H5P_VFD_TESTS}) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + FOREACH (test ${H5P_VFD_TESTS}) + ADD_TEST ( + NAME VFD-${vfdname}-${test} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${test}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" + ) + ENDFOREACH (test ${H5P_VFD_TESTS}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index a2d185a..0cd273c 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -106,18 +106,23 @@ IF (BUILD_TESTING) ENDMACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) MACRO (ADD_H5LS_TEST file filetest) - ADD_TEST ( - NAME H5COPY-H5LS_${file}-${filetest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${file}.out.out" - -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=./testfiles/${file}.out.ls" - -D "TEST_MASK=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5COPY-H5LS_${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5COPY-H5LS_${file}-${filetest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${file}.out.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=./testfiles/${file}.out.ls" + -D "TEST_MASK=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-H5LS_${file}-${filetest} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -125,18 +130,23 @@ IF (BUILD_TESTING) ENDMACRO (ADD_H5LS_TEST file filetest) MACRO (ADD_H5_CMP_TEST testname resultcode testfile vparam srcname dstname) - ADD_TEST ( - NAME H5COPY-CMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-i;${testfile}.h5;-o;./testfiles/${testfile}.out.h5;-${vparam};-s;${srcname};-d;${dstname}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testname}.out.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=./testfiles/${testname}.out" - -D "TEST_MASK=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ${testfile}.h5 -o ./testfiles/${testfile}.out.h5 -${vparam} -s ${srcname} -d ${dstname}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5COPY-CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=-i;${testfile}.h5;-o;./testfiles/${testfile}.out.h5;-${vparam};-s;${srcname};-d;${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}.out.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${testname}.out" + -D "TEST_MASK=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 270bd15..664a308 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -270,18 +270,23 @@ IF (BUILD_TESTING) ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode) - ADD_TEST ( - NAME H5DIFF-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" - -D "TEST_APPEND=EXIT CODE:" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DIFF-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -614,12 +619,6 @@ IF (BUILD_TESTING) ENDIF (NOT "${last_test}" STREQUAL "") SET (last_test "H5DIFF-clearall-objects") - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DIFF-help COMMAND h5diff -h) - ADD_TEST (NAME H5DIFF-normal-mode COMMAND h5diff ${FILE1} ${FILE2}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # ############################################################################ # # Common usage # ############################################################################ diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index c051238..0cc5cd0 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -482,17 +482,22 @@ IF (BUILD_TESTING) ENDMACRO (ADD_SKIP_H5_TEST) MACRO (ADD_H5_TEST resultfile resultcode) - ADD_TEST ( - NAME H5DUMP-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -517,22 +522,24 @@ IF (BUILD_TESTING) ENDMACRO (ADD_H5_EXPORT_TEST file) MACRO (ADD_H5_MASK_TEST resultfile resultcode) - ADD_TEST ( - NAME H5DUMP-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_MASK_ERROR=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_MASK_ERROR=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-${resultfile}") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) @@ -547,17 +554,21 @@ IF (BUILD_TESTING) ENDMACRO (ADD_XML_SKIP_H5_TEST) MACRO (ADD_XML_H5_TEST resultfile resultcode) - ADD_TEST ( - NAME H5DUMP-XML-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=--xml;${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.xml" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-XML-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--xml;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.xml" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -816,15 +827,6 @@ IF (BUILD_TESTING) ENDIF (NOT "${last_test}" STREQUAL "") SET (last_test "H5DUMP-clearall-objects") - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tgroup COMMAND h5dump tgroup.h5) - ADD_TEST (NAME H5DUMP-tdset COMMAND h5dump tdset.h5) - ADD_TEST (NAME H5DUMP-tattr COMMAND h5dump tattr.h5) - ADD_TEST (NAME H5DUMP-tslink COMMAND h5dump tslink.h5) - ADD_TEST (NAME H5DUMP-thlink COMMAND h5dump thlink.h5) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # test for signed/unsigned datasets ADD_H5_TEST (packedbits 0 packedbits.h5) # test for displaying groups diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index d1e6bdf..826a9f4 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -136,17 +136,22 @@ IF (BUILD_TESTING) ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode) - ADD_TEST ( - NAME H5LS-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5LS-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -276,13 +281,6 @@ IF (BUILD_TESTING) ENDIF (NOT "${last_test}" STREQUAL "") SET (last_test "H5LS-clearall-objects") - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5LS-help COMMAND h5ls -w80 -h) - ADD_TEST (NAME H5LS-tall COMMAND h5ls -w80 tall.h5) - ADD_TEST (NAME H5LS-tsoftlinks COMMAND h5ls --follow-symlinks tsoftlinks.h5) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) ADD_H5_TEST (help-2 0 -w80 --help) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 6413aae..725a220 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -196,18 +196,23 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out.${resultfile}" ) ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( - NAME H5REPACK-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5REPACK-${testname} COMMAND $ ${ARGN} testfiles/${resultfile} testfiles/out.${resultfile}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -222,50 +227,52 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out.${resultfile}" ) ELSE (${testtype} STREQUAL "SKIP") - IF (${resultcode} STREQUAL "0") - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testfile}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK_VERIFY_LAYOUT-${testname}") - ELSE (${resultcode} STREQUAL "0") - IF (${testfilter} STREQUAL "CHUNKED") - SET (nottestfilter "(CONTIGUOUS|COMPACT)") - ENDIF (${testfilter} STREQUAL "CHUNKED") - IF (${testfilter} STREQUAL "CONTIGUOUS") - SET (nottestfilter "(CHUNK|COMPACT)") - ENDIF (${testfilter} STREQUAL "CONTIGUOUS") - IF (${testfilter} STREQUAL "COMPACT") - SET (nottestfilter "(CONTIGUOUS|CHUNK)") - ENDIF (${testfilter} STREQUAL "COMPACT") - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT_ALL-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-pH;testfiles/out.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testfile}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${nottestfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT_ALL-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK_VERIFY_LAYOUT_ALL-${testname}") - ENDIF (${resultcode} STREQUAL "0") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + IF (${resultcode} STREQUAL "0") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testfile}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK_VERIFY_LAYOUT-${testname}") + ELSE (${resultcode} STREQUAL "0") + IF (${testfilter} STREQUAL "CHUNKED") + SET (nottestfilter "(CONTIGUOUS|COMPACT)") + ENDIF (${testfilter} STREQUAL "CHUNKED") + IF (${testfilter} STREQUAL "CONTIGUOUS") + SET (nottestfilter "(CHUNK|COMPACT)") + ENDIF (${testfilter} STREQUAL "CONTIGUOUS") + IF (${testfilter} STREQUAL "COMPACT") + SET (nottestfilter "(CONTIGUOUS|CHUNK)") + ENDIF (${testfilter} STREQUAL "COMPACT") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT_ALL-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-pH;testfiles/out.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testfile}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${nottestfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT_ALL-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK_VERIFY_LAYOUT_ALL-${testname}") + ENDIF (${resultcode} STREQUAL "0") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_VERIFY_TEST) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index af3937b..86ad3ad 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -88,17 +88,22 @@ IF (BUILD_TESTING) ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode) - ADD_TEST ( - NAME H5STAT-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5STAT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 9a1597e..6c62d62 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -145,33 +145,39 @@ IF (BUILD_TESTING) ) ENDIF (NOT ${resultoption} STREQUAL " ") SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}${resultoption}) - ADD_TEST ( - NAME H5MKGRP-H5LS-${resultfile}${resultoption} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_MOD=true" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP-H5LS-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP-H5LS-${resultfile}${resultoption} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_MOD=true" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5MKGRP-H5LS-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - ADD_TEST ( - NAME H5MKGRP-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5MKGRP-${resultfile} COMMAND $ ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## -- cgit v0.12