diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-01-20 19:52:41 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-01-20 19:52:41 (GMT) |
commit | 80161447bb08638ef4264208600ba1e0b0fcb57a (patch) | |
tree | e0f8f65a67d5cfa2310c4a664948f3b4e0d32a24 /examples | |
parent | 77ac7cb908055dd6f5a015207a126c73536685d5 (diff) | |
download | hdf5-80161447bb08638ef4264208600ba1e0b0fcb57a.zip hdf5-80161447bb08638ef4264208600ba1e0b0fcb57a.tar.gz hdf5-80161447bb08638ef4264208600ba1e0b0fcb57a.tar.bz2 |
Merfge changes to CMake test options and add sanitizers
Diffstat (limited to 'examples')
-rw-r--r-- | examples/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/CMakeTests.cmake | 60 |
2 files changed, 32 insertions, 30 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 5117f39..c61af3e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -57,6 +57,6 @@ if (H5_HAVE_PARALLEL) set_target_properties (ph5example PROPERTIES FOLDER examples) endif () -if (BUILD_TESTING) +if (BUILD_TESTING AND HDF5_TEST_EXAMPLES) include (CMakeTests.cmake) endif () diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index d6fc56c..c229e24 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -51,38 +51,40 @@ set (test_ex_CLEANFILES u2w/u2w_target.h5 ) -# Remove any output file left over from previous test run -add_test ( - NAME EXAMPLES-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES} -) -set_tests_properties (EXAMPLES-clear-objects PROPERTIES FIXTURES_SETUP clear_EXAMPLES) +if (HDF5_TEST_SERIAL) + # Remove any output file left over from previous test run + add_test ( + NAME EXAMPLES-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES} + ) + set_tests_properties (EXAMPLES-clear-objects PROPERTIES FIXTURES_SETUP clear_EXAMPLES) -foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${example}>) - else () - add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$<TARGET_FILE:${example}>" - -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 () - set_tests_properties (EXAMPLES-${example} PROPERTIES FIXTURES_REQUIRED clear_EXAMPLES) - if (last_test) - set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "EXAMPLES-${example}") -endforeach () + foreach (example ${examples}) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${example}>) + else () + add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:${example}>" + -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 () + set_tests_properties (EXAMPLES-${example} PROPERTIES FIXTURES_REQUIRED clear_EXAMPLES) + if (last_test) + set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "EXAMPLES-${example}") + endforeach () +endif () ### Windows pops up a modal permission dialog on this test -if (H5_HAVE_PARALLEL AND NOT WIN32) +if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS}) else () |