From 244faaa0d048e7e06fb5aec8d4f661f1893c3030 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Jan 2017 14:02:34 -0600 Subject: HDFFV-10094: upgrade cmake command conventions Also converted tests to use macros --- MANIFEST | 1 - c++/examples/CMakeTests.cmake | 30 +++++++- c++/test/CMakeTests.cmake | 15 +++- config/cmake/vfdTest.cmake | 34 +++++--- config/cmake_ext_mod/prunTest.cmake | 145 ----------------------------------- config/cmake_ext_mod/runTest.cmake | 26 +++++-- examples/CMakeTests.cmake | 60 ++++++++++++++- fortran/examples/CMakeTests.cmake | 60 ++++++++++++++- fortran/test/CMakeTests.cmake | 114 ++++++++++++++++++++++++--- hl/c++/examples/CMakeTests.cmake | 17 +++- hl/c++/test/CMakeTests.cmake | 15 +++- hl/examples/CMakeTests.cmake | 23 ++++-- hl/fortran/examples/CMakeTests.cmake | 15 +++- hl/fortran/test/CMakeTests.cmake | 120 +++++++++++++++++++++++++++-- hl/test/CMakeTests.cmake | 15 +++- test/CMakeTests.cmake | 98 +++++++++++++++++++---- tools/test/h5diff/CMakeTests.cmake | 20 ++++- tools/test/perform/CMakeTests.cmake | 105 +++++++++++++++++++++++-- 18 files changed, 685 insertions(+), 228 deletions(-) delete mode 100644 config/cmake_ext_mod/prunTest.cmake diff --git a/MANIFEST b/MANIFEST index b43e7ef..4648ef3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2967,7 +2967,6 @@ ./config/cmake_ext_mod/HDFUseFortran.cmake ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in -./config/cmake_ext_mod/prunTest.cmake ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 629f45d..8b5c6b9 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -21,7 +21,20 @@ set (last_test "CPP_ex-clear-objects") foreach (example ${examples}) - add_test (NAME CPP_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_ex_${example} COMMAND $) + else () + add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () @@ -48,7 +61,20 @@ set (last_test "CPP_ex_tutr-clear-objects") foreach (example ${tutr_examples}) - add_test (NAME CPP_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_ex_${example} COMMAND $) + else () + add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index b1f0b2b..3f90d5b 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -20,7 +20,20 @@ add_test ( titerate.h5 ) -add_test (NAME CPP_testhdf5 COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_testhdf5 COMMAND $) +else () + add_test (NAME CPP_testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_testhdf5.txt" + #-D "TEST_REFERENCE=cpp_testhdf5.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) if (HDF5_TEST_VFD) diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index bcbb441..9c93fb7 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -5,12 +5,6 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") endif () @@ -18,15 +12,28 @@ if (NOT TEST_VFD) message (FATAL_ERROR "Require TEST_VFD to be defined") endif () -set (ERROR_APPEND 1) +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +# if there is not an error reference file add the error output to the stdout file +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif () message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") set (ENV{HDF5_DRIVER} "${TEST_VFD}") + # run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( +execute_process ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out ERROR_FILE ${TEST_OUTPUT}_${TEST_VFD}.err OUTPUT_VARIABLE TEST_OUT @@ -35,6 +42,7 @@ EXECUTE_PROCESS ( message (STATUS "COMMAND Result: ${TEST_RESULT}") +# if the .err file exists and ERRROR_APPEND is enabled if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") @@ -42,8 +50,16 @@ endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) + message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") + endif() + endif() + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () +message (STATUS "COMMAND Error: ${TEST_ERROR}") + # everything went fine... message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") diff --git a/config/cmake_ext_mod/prunTest.cmake b/config/cmake_ext_mod/prunTest.cmake deleted file mode 100644 index 44df682..0000000 --- a/config/cmake_ext_mod/prunTest.cmake +++ /dev/null @@ -1,145 +0,0 @@ -# runTest.cmake executes a command and captures the output in a file. File is then compared -# against a reference file. Exit status of command can also be compared. -cmake_policy(SET CMP0007 NEW) - -# arguments checking -if (NOT TEST_PROGRAM) - message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () -if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () -if (NOT TEST_OUTPUT) - message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () -#if (NOT TEST_FILTER) -# message (STATUS "Require TEST_FILTER to be defined") -#endif () -if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif () - -set (ERROR_APPEND 1) - -message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -if (TEST_ENV_VAR) - set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -endif () - -# run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( - COMMAND ${TEST_PROGRAM} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR -) - -message (STATUS "COMMAND Result: ${TEST_RESULT}") - -file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) -file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - -if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -if (TEST_APPEND) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") -endif () - -message (STATUS "COMMAND Error: ${TEST_ERROR}") - -if (TEST_MASK) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -if (TEST_MASK_MOD) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -if (TEST_MASK_ERROR) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -if (TEST_FILTER) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -#if (TEST_REF_FILTER) -# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") -# file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) -# STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") -# file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -#endif () - -if (NOT TEST_SKIP_COMPARE) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - endif () - - # now compare the output with the reference - EXECUTE_PROCESS ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - LIST (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) - LIST (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0") - MATH (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - LIST (GET test_act ${line} str_act) - LIST (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - endif () - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif () - endif () - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") - endif () -endif () - -# everything went fine... -message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") - diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index db6d24f..cc1c872 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -6,9 +6,6 @@ cmake_policy(SET CMP0007 NEW) if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") endif () @@ -18,9 +15,6 @@ endif () if (NOT TEST_EXPECT) message (STATUS "Require TEST_EXPECT to be defined") endif () -#if (NOT TEST_FILTER) -# message (STATUS "Require TEST_FILTER to be defined") -#endif () if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") endif () @@ -69,6 +63,16 @@ else () ) endif () +if (TEST_REGEX) + # TEST_REGEX should always be matched + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) + if (${REGEX_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") + endif () +endif () + message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled @@ -84,7 +88,13 @@ endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.out) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM) + message (STATUS "Output :\n${TEST_STREAM}") + endif() + endif() + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -214,7 +224,7 @@ if (NOT TEST_SKIP_COMPARE) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () - endforeach (line RANGE 0 ${_FP_LEN}) + endforeach () else () if (${len_act} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 3c4cdff..3412b22 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -66,7 +66,20 @@ set (last_test "EXAMPLES-clear-objects") foreach (example ${examples}) - add_test (NAME EXAMPLES-${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-${example} COMMAND $) + else () + add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${example}.txt" + #-D "TEST_REFERENCE=${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) endif () @@ -132,7 +145,20 @@ set (last_test "EXAMPLES-shared-clear-objects") foreach (example ${examples}) - add_test (NAME EXAMPLES-shared-${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-shared-${example} COMMAND $) + else () + add_test (NAME EXAMPLES-shared-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${example}.txt" + #-D "TEST_REFERENCE=${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test}) @@ -143,13 +169,39 @@ ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) - add_test (NAME EXAMPLES-ph5example COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-ph5example COMMAND $) + else () + add_test (NAME EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ph5example.txt" + #-D "TEST_REFERENCE=ph5example.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) endif () set (last_test "EXAMPLES-ph5example") if (BUILD_SHARED_LIBS) - add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + else () + add_test (NAME EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ph5example-shared.txt" + #-D "TEST_REFERENCE=ph5example-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test}) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index f150130..ea21fa4 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -58,13 +58,39 @@ endif () foreach (example ${examples}) - add_test (NAME f90_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f90_ex_${example} COMMAND $) + else () + add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f90_ex_${example}.txt" + #-D "TEST_REFERENCE=f90_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f90_ex-shared_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f90_ex-shared_${example} COMMAND $) + else () + add_test (NAME f90_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f90_ex_${example}-shared.txt" + #-D "TEST_REFERENCE=f90_ex_${example}-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) endif () @@ -74,13 +100,39 @@ endforeach () if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) - add_test (NAME f03_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f03_ex_${example} COMMAND $) + else () + add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f03_ex_${example}.txt" + #-D "TEST_REFERENCE=f03_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f03_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f03_ex-shared_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f03_ex-shared_${example} COMMAND $) + else () + add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f03_ex_${example}-shared.txt" + #-D "TEST_REFERENCE=f03_ex_${example}-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 6c86cfa..3792e57 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -52,19 +52,64 @@ if (NOT "${last_test}" STREQUAL "") endif () set (last_test "FORTRAN_testhdf5-clear-objects") -add_test (NAME FORTRAN_testhdf5_fortran COMMAND $) -set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran COMMAND $) +else () + add_test (NAME FORTRAN_testhdf5_fortran COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran.txt" + #-D "TEST_REFERENCE=testhdf5_fortran.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +#set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects) #-- Adding test for testhdf5_fortran_1_8 -add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $) -set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $) +else () + add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt" + #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +#set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) - set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) + else () + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=fortranlib_test_F03.txt" + #-D "TEST_REFERENCE=fortranlib_test_F03.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) endif () @@ -119,19 +164,64 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) set_tests_properties (FORTRAN_testhdf5-shared-clear-objects PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects) - add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) - set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) + else () + add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran.txt" + #-D "TEST_REFERENCE=testhdf5_fortran.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS "FORTRAN_testhdf5_fortran;FORTRAN_testhdf5-shared-clear-objects") #-- Adding test for testhdf5_fortran_1_8 - add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $) - set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $) + else () + add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran.txt" + #-D "TEST_REFERENCE=testhdf5_fortran.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) - set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) + else () + add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=fortranlib_test_F03.txt" + #-D "TEST_REFERENCE=fortranlib_test_F03.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03) endif () diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index bac9fdf..86bdd93 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -8,9 +8,22 @@ add_test ( NAME HL_CPP_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove PTcppexampleFL.h5 ) -add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) +else () + add_test (NAME HL_CPP_ex_ptExampleFL COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ptExampleFL.txt" + #-D "TEST_REFERENCE=ptExampleFL.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_CPP_ex_ptExampleFL PROPERTIES DEPENDS HL_CPP_ex_ptExampleFL-clear-objects) diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index e36b5aa..d41f79e 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -4,5 +4,18 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - + +if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_CPP_ptableTest COMMAND $) +else () + add_test (NAME HL_CPP_ptableTest COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_ptableTest.txt" + #-D "TEST_REFERENCE=hl_ptableTest.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 11b89f0..3bbe91f 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -46,9 +46,22 @@ add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ set (last_test "HL_ex-clear-objects") foreach (example ${examples}) - add_test (NAME HL_ex_${example} COMMAND $) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "HL_ex_${example}") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_ex_${example} COMMAND $) + else () + add_test (NAME HL_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_ex_${example}.txt" + #-D "TEST_REFERENCE=hl_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "HL_ex_${example}") endforeach () diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 2c10295..6d8a09b 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -16,6 +16,19 @@ add_test ( foreach (example ${examples}) - add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_ex_${example}.txt" + #-D "TEST_REFERENCE=hl_f90_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES DEPENDS HL_FORTRAN_f90_ex-clear-objects) endforeach (example ${examples}) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 41b6249..3c8a831 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -21,16 +21,68 @@ add_test ( tstds.h5 ) -add_test (NAME HL_FORTRAN_f90_tstds COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstds COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tstds COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstds.txt" + #-D "TEST_REFERENCE=hl_f90_tstds.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tstds PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -add_test (NAME HL_FORTRAN_f90_tstlite COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstlite COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tstlite COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstlite.txt" + #-D "TEST_REFERENCE=hl_f90_tstlite.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tstlite PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -add_test (NAME HL_FORTRAN_f90_tstimage COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstimage COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tstimage COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstimage.txt" + #-D "TEST_REFERENCE=hl_f90_tstimage.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tstimage PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tsttable COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tsttable.txt" + #-D "TEST_REFERENCE=hl_f90_tsttable.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -52,15 +104,67 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) PROPERTIES DEPENDS "HL_FORTRAN_f90_tsttable;HL_FORTRAN_f90_tstimage;HL_FORTRAN_f90_tstlite;HL_FORTRAN_f90_tstds" ) - add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstds-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tstds-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tstds-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstlite-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tstlite-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tstlite-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstimage-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tstimage-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tstimage-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tsttable-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tsttable-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tsttable-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) endif () diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index f8312a1..c5b051f 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -36,7 +36,20 @@ add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tes # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name) - add_test (NAME HL_${hl_name} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_${hl_name} COMMAND $) + else () + add_test (NAME HL_${hl_name} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_${hl_name}.txt" + #-D "TEST_REFERENCE=hl_${hl_name}.out" + -D "TEST_FOLDER=${HDF5_HL_TEST_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test} ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}" diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index dd6ff89..be3b52f 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -281,6 +281,16 @@ if (HDF5_ENABLE_USING_MEMCHECKER) ) else () add_test (NAME H5TEST-testhdf5 COMMAND $) + add_test (NAME H5TEST-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-testhdf5 PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -310,7 +320,16 @@ else () WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-testhdf5 COMMAND $) + add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES DEPENDS H5TEST-shared-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" @@ -595,18 +614,36 @@ set (H5TEST_TESTS ) foreach (test ${H5TEST_TESTS}) - if (${test} STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-${test} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-${test} COMMAND $) + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) else () - add_test (NAME H5TEST-${test} COMMAND $) + if (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + ) + else () + add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) endif () - set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) endforeach () set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) @@ -631,7 +668,16 @@ if (BUILD_SHARED_LIBS) COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) else () - add_test (NAME H5TEST-shared-${test} COMMAND $) + add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) endif () set_tests_properties (H5TEST-shared-${test} PROPERTIES DEPENDS H5TEST-shared-clear-objects @@ -662,7 +708,20 @@ if (NOT CYGWIN) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - add_test (NAME H5TEST-cache COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-cache COMMAND $) + else () + add_test (NAME H5TEST-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache.txt" + #-D "TEST_REFERENCE=cache.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" @@ -769,7 +828,20 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-cache COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-shared-cache COMMAND $) + else () + add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache-shared.txt" + #-D "TEST_REFERENCE=cache-shared.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 37aad96..8a2781e 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -273,6 +273,9 @@ # Make testfiles dir under build dir file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (H5_HAVE_PARALLEL) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") + endif () # # copy test files from source to build dir @@ -280,6 +283,9 @@ foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") + endif () endforeach () @@ -290,11 +296,17 @@ foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") + endif () endforeach () else () foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") + endif () endforeach () endif () add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) @@ -339,7 +351,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -352,14 +364,14 @@ COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=P_${resultfile}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" # -D "TEST_APPEND=EXIT CODE: [0-9]" # -D "TEST_REF_FILTER=EXIT CODE: 0" -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF_RESOURCES_EXT_DIR}/prunTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () ENDMACRO () diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 137fb38..d286988 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -27,23 +27,114 @@ add_test ( x-gnuplot ) -add_test (NAME PERFORM_h5perf_serial COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_h5perf_serial COMMAND $) +else () + add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=h5perf_serial.txt" + #-D "TEST_REFERENCE=h5perf_serial.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) endif () -add_test (NAME PERFORM_chunk COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_chunk COMMAND $) +else () + add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=chunk.txt" + #-D "TEST_REFERENCE=chunk.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_iopipe COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_iopipe COMMAND $) +else () + add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=iopipe.txt" + #-D "TEST_REFERENCE=iopipe.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_overhead COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_overhead COMMAND $) +else () + add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=overhead.txt" + #-D "TEST_REFERENCE=overhead.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_perf_meta COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_perf_meta COMMAND $) +else () + add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=perf_meta.txt" + #-D "TEST_REFERENCE=perf_meta.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") -add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") +else () + add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=zip_perf-h.txt" + #-D "TEST_REFERENCE=zip_perf-h.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +else () + add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=zip_perf.txt" + #-D "TEST_REFERENCE=zip_perf.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -- cgit v0.12