summaryrefslogtreecommitdiffstats
path: root/hl/examples
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-08-19 21:49:44 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-08-19 21:49:44 (GMT)
commitc502d81a8c87dd2bce47a5476e3331b04fc69322 (patch)
tree2549ab26136222cdfae89d4279707051cbb716b0 /hl/examples
parentfcb21bb3dde491209881dc99eb0adc9198f21452 (diff)
downloadhdf5-c502d81a8c87dd2bce47a5476e3331b04fc69322.zip
hdf5-c502d81a8c87dd2bce47a5476e3331b04fc69322.tar.gz
hdf5-c502d81a8c87dd2bce47a5476e3331b04fc69322.tar.bz2
[svn-r24029] Move TESTS to seperate file to allow easier editing by all developers.
Tested: local linux
Diffstat (limited to 'hl/examples')
-rw-r--r--hl/examples/CMakeLists.txt36
-rw-r--r--hl/examples/CMakeTests.cmake28
2 files changed, 29 insertions, 35 deletions
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt
index b702754..36c799d 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -1,20 +1,6 @@
cmake_minimum_required (VERSION 2.8.10)
PROJECT (HDF5_HL_EXAMPLES )
-SET (HDF5_TEST_FILES
-)
-
-FOREACH (h5_file ${HDF5_TEST_FILES})
- SET (dest "${PROJECT_BINARY_DIR}/${h5_file}")
- #MESSAGE (STATUS " Copying ${h5_file}")
- ADD_CUSTOM_COMMAND (
- TARGET h5dump
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest}
- )
-ENDFOREACH (h5_file ${HDF5_TEST_FILES})
-
#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
@@ -46,30 +32,10 @@ FOREACH (example ${examples})
TARGET_C_PROPERTIES (hl_ex_${example} " " " ")
TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl)
-
- IF (BUILD_TESTING)
- ADD_TEST (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
- ENDIF (BUILD_TESTING)
ENDFOREACH (example ${examples})
IF (BUILD_TESTING)
- SET_TESTS_PROPERTIES (hl_ex_ex_lite2 PROPERTIES DEPENDS hl_ex_ex_lite1)
-ENDIF (BUILD_TESTING)
-IF (BUILD_TESTING)
- SET (HDF5_TEST_FILES
- image24pixel.txt
- image8.txt
- )
+ INCLUDE (CMakeTests.cmake)
- FOREACH (h5_file ${HDF5_TEST_FILES})
- SET (dest "${PROJECT_BINARY_DIR}/${h5_file}")
- #MESSAGE (STATUS " Copying ${h5_file}")
- ADD_CUSTOM_COMMAND (
- TARGET hl_ex_ex_ds1
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest}
- )
- ENDFOREACH (h5_file ${HDF5_TEST_FILES})
ENDIF (BUILD_TESTING)
diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake
new file mode 100644
index 0000000..e1ccba0
--- /dev/null
+++ b/hl/examples/CMakeTests.cmake
@@ -0,0 +1,28 @@
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
+SET (HDF5_TEST_FILES
+ image24pixel.txt
+ image8.txt
+)
+
+FOREACH (h5_file ${HDF5_TEST_FILES})
+ SET (dest "${PROJECT_BINARY_DIR}/${h5_file}")
+ #MESSAGE (STATUS " Copying ${h5_file}")
+ ADD_CUSTOM_COMMAND (
+ TARGET hl_ex_ex_ds1
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest}
+ )
+ENDFOREACH (h5_file ${HDF5_TEST_FILES})
+
+FOREACH (example ${examples})
+ ADD_TEST (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
+ENDFOREACH (example ${examples})
+
+SET_TESTS_PROPERTIES (hl_ex_ex_lite2 PROPERTIES DEPENDS hl_ex_ex_lite1)