summaryrefslogtreecommitdiffstats
path: root/hl/test/CMakeTests.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-08-01 17:35:00 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-08-01 17:35:00 (GMT)
commite55844b7523676c381eb22f638369a794021d798 (patch)
tree9121dc5ee07215bc6389dc8bcf61e96b4040e69f /hl/test/CMakeTests.cmake
parent1494413413932f1e640815d109fd1e8386bab3f9 (diff)
downloadhdf5-e55844b7523676c381eb22f638369a794021d798.zip
hdf5-e55844b7523676c381eb22f638369a794021d798.tar.gz
hdf5-e55844b7523676c381eb22f638369a794021d798.tar.bz2
[svn-r30237] HDFFV-9939: Change cmake commands to reduce POST_BUILD custom commands. Fixes possible overruns on windows command lines.
Diffstat (limited to 'hl/test/CMakeTests.cmake')
-rw-r--r--hl/test/CMakeTests.cmake64
1 files changed, 38 insertions, 26 deletions
diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake
index 95eca4b..228853d 100644
--- a/hl/test/CMakeTests.cmake
+++ b/hl/test/CMakeTests.cmake
@@ -5,32 +5,44 @@
##############################################################################
##############################################################################
+set (HL_REFERENCE_TEST_FILES
+ dtype_file.txt
+ image8.txt
+ sepia.pal
+ earth.pal
+ image24pixel.txt
+ image24plane.txt
+ usa.wri
+ test_table_be.h5
+ test_table_cray.h5
+ test_table_le.h5
+ dsdata.txt
+ dslat.txt
+ dslon.txt
+ test_ds_be.h5
+ test_ds_le.h5
+ test_ld.h5
+)
+
+# --------------------------------------------------------------------
+#-- Copy the necessary files.
+# --------------------------------------------------------------------
+foreach (h5_file ${HL_REFERENCE_TEST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_HL_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}" "hl_test_files")
+endforeach (h5_file ${HL_REFERENCE_TEST_FILES})
+add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tests" DEPENDS ${hl_test_files_list})
+
# --------------------------------------------------------------------
# Macro used to add a unit test
# --------------------------------------------------------------------
-MACRO (HL_ADD_TEST hl_name files)
+MACRO (HL_ADD_TEST hl_name)
add_test (NAME HL_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>)
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test}
ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}"
WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR}
)
- endif (NOT "${last_test}" STREQUAL "")
-
- # --------------------------------------------------------------------
- #-- Copy the necessary files.
- # --------------------------------------------------------------------
- foreach (h5_file ${files})
- set (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}")
- #message (STATUS " Copying HL Test File ${h5_file} to ${dest}")
- add_custom_command (
- TARGET hl_${hl_name}
- PRE_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_HL_TEST_SOURCE_DIR}/${h5_file} ${dest}
- )
-
- endforeach (h5_file ${HL_REFERENCE_TEST_FILES})
+ endif ()
ENDMACRO (HL_ADD_TEST)
# Remove any output file left over from previous test run
@@ -73,13 +85,13 @@ if (NOT "${last_test}" STREQUAL "")
endif (NOT "${last_test}" STREQUAL "")
set (last_test "HL_test-clear-objects")
-HL_add_test (test_lite "dtype_file.txt")
-HL_add_test (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri")
-HL_add_test (test_file_image "")
-HL_add_test (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5")
-HL_add_test (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5")
-HL_add_test (test_packet "")
-HL_add_test (test_dset_opt "")
-HL_add_test (test_ld "test_ld.h5")
-HL_add_test (test_dset_append "")
+HL_add_test (test_lite )
+HL_add_test (test_image)
+HL_add_test (test_file_image)
+HL_add_test (test_table)
+HL_add_test (test_ds)
+HL_add_test (test_packet)
+HL_add_test (test_dset_opt)
+HL_add_test (test_ld)
+HL_add_test (test_dset_append)