summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-01-11 20:02:34 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-01-11 20:02:34 (GMT)
commit244faaa0d048e7e06fb5aec8d4f661f1893c3030 (patch)
tree50d18b730a41e3f644f4d2729ea30ebe387bdfba /tools
parente1bcae8a6a804490aa941a654e99b1dd18251411 (diff)
downloadhdf5-244faaa0d048e7e06fb5aec8d4f661f1893c3030.zip
hdf5-244faaa0d048e7e06fb5aec8d4f661f1893c3030.tar.gz
hdf5-244faaa0d048e7e06fb5aec8d4f661f1893c3030.tar.bz2
HDFFV-10094: upgrade cmake command conventions
Also converted tests to use macros
Diffstat (limited to 'tools')
-rw-r--r--tools/test/h5diff/CMakeTests.cmake20
-rw-r--r--tools/test/perform/CMakeTests.cmake105
2 files changed, 114 insertions, 11 deletions
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 $<TARGET_FILE:ph5diff> ${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};$<TARGET_FILE:ph5diff>"
-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 $<TARGET_FILE:h5perf_serial>)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>)
+else ()
+ add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>"
+ -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 $<TARGET_FILE:h5perf_serial_alone>)
endif ()
-add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>)
+else ()
+ add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:chunk>"
+ -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 $<TARGET_FILE:iopipe>)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>)
+else ()
+ add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:iopipe>"
+ -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 $<TARGET_FILE:overhead>)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>)
+else ()
+ add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:overhead>"
+ -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 $<TARGET_FILE:perf_meta>)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>)
+else ()
+ add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>"
+ -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 $<TARGET_FILE:zip_perf> "-h")
-add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h")
+else ()
+ add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
+ -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 $<TARGET_FILE:zip_perf> tfilters.h5)
+else ()
+ add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
+ -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} $<TARGET_FILE:h5perf>)