summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-03-01 20:47:53 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-03-01 20:47:53 (GMT)
commit2562ec3a4b5ee4cff25e182bf0a29795673ca83d (patch)
treebe9f99660f7ff660df6199623b0c556f83c446a1 /hl
parent038359746351249d6023e023f446b2bc612822b6 (diff)
downloadhdf5-2562ec3a4b5ee4cff25e182bf0a29795673ca83d.zip
hdf5-2562ec3a4b5ee4cff25e182bf0a29795673ca83d.tar.gz
hdf5-2562ec3a4b5ee4cff25e182bf0a29795673ca83d.tar.bz2
Update CMake files and formatting
Diffstat (limited to 'hl')
-rw-r--r--hl/examples/CMakeTests.cmake2
-rw-r--r--hl/fortran/examples/CMakeTests.cmake2
-rw-r--r--hl/test/CMakeTests.cmake6
-rw-r--r--hl/tools/h5watch/CMakeTests.cmake58
4 files changed, 27 insertions, 41 deletions
diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake
index 3bbe91f..5645155 100644
--- a/hl/examples/CMakeTests.cmake
+++ b/hl/examples/CMakeTests.cmake
@@ -12,7 +12,7 @@ set (HDF5_TEST_FILES
foreach (h5_file ${HDF5_TEST_FILES})
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "hl_ex_ex_ds1_files")
-endforeach (h5_file ${HDF5_TEST_FILES})
+endforeach ()
add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list})
# Remove any output file left over from previous test run
diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake
index 6d8a09b..b5f5fc6 100644
--- a/hl/fortran/examples/CMakeTests.cmake
+++ b/hl/fortran/examples/CMakeTests.cmake
@@ -31,4 +31,4 @@ foreach (example ${examples})
)
endif ()
set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES DEPENDS HL_FORTRAN_f90_ex-clear-objects)
-endforeach (example ${examples})
+endforeach ()
diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake
index c5b051f..211c501 100644
--- a/hl/test/CMakeTests.cmake
+++ b/hl/test/CMakeTests.cmake
@@ -29,13 +29,13 @@ set (HL_REFERENCE_TEST_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})
+endforeach ()
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)
+macro (HL_ADD_TEST hl_name)
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME HL_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>)
else ()
@@ -56,7 +56,7 @@ MACRO (HL_ADD_TEST hl_name)
WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR}
)
endif ()
-ENDMACRO ()
+endmacro ()
# Remove any output file left over from previous test run
add_test (
diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake
index 83386de..2242692 100644
--- a/hl/tools/h5watch/CMakeTests.cmake
+++ b/hl/tools/h5watch/CMakeTests.cmake
@@ -64,21 +64,9 @@ endforeach ()
##############################################################################
##############################################################################
- MACRO (ADD_H5_TEST resultfile resultcode)
+ macro (ADD_H5_TEST resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5WATCH_ARGS-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5WATCH_ARGS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5WATCH_ARGS-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5WATCH_ARGS-${resultfile}-clearall-objects")
- add_test (
NAME H5WATCH_ARGS-h5watch-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5watch>"
@@ -89,20 +77,18 @@ endforeach ()
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS H5WATCH_ARGS-${resultfile}-clear-objects)
- set (last_test "H5WATCH_ARGS-${resultfile}")
+ set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS ${last_test})
+ set (last_test "H5WATCH_ARGS-h5watch-${resultfile}")
endif ()
- ENDMACRO ()
+ endmacro ()
- MACRO (ADD_H5_WATCH resultfile resultcode)
+ macro (ADD_H5_WATCH resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5WATCH-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove
${resultfile}.h5
- ${resultfile}.out
- ${resultfile}.out.err
)
set_tests_properties (H5WATCH-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
add_test (
@@ -118,7 +104,7 @@ endforeach ()
)
set_tests_properties (H5WATCH-${resultfile} PROPERTIES DEPENDS H5WATCH-${resultfile}-clear-objects)
endif ()
- ENDMACRO ()
+ endmacro ()
##############################################################################
##############################################################################
@@ -130,7 +116,7 @@ endforeach ()
# supports SWMR.
set (SWMR_INCOMPAT ${hl_swmr_check_compat_vfd})
-IF (NOT SWMR_INCOMPAT)
+if (NOT SWMR_INCOMPAT)
# Remove any output file left over from previous test run
add_test (
NAME H5WATCH-clearall-objects
@@ -169,23 +155,23 @@ IF (NOT SWMR_INCOMPAT)
set (last_test "H5WATCH-h5watchgentest")
# Test on --help options
- ADD_H5_TEST(w-help1 0 --help)
+ ADD_H5_TEST (w-help1 0 --help)
#
# Tests on expected failures
- ADD_H5_TEST(w-err-dset1 1 WATCH.h5)
- ADD_H5_TEST(w-err-dset2 1 WATCH.h5/group/DSET_CMPD)
- ADD_H5_TEST(w-err-dset-none 1 WATCH.h5/DSET_NONE)
- ADD_H5_TEST(w-err-dset-nomax 1 WATCH.h5/DSET_NOMAX)
- ADD_H5_TEST(w-err-file 1 ../WATCH.h5/DSET_CMPD)
- ADD_H5_TEST(w-err-width 1 --width=-8 WATCH.h5/DSET_ONE)
- ADD_H5_TEST(w-err-poll 1 --polling=-8 WATCH.h5/DSET_ONE)
- ADD_H5_TEST(w-err-poll0 1 --polling=0 WATCH.h5/DSET_ONE)
+ ADD_H5_TEST (w-err-dset1 1 WATCH.h5)
+ ADD_H5_TEST (w-err-dset2 1 WATCH.h5/group/DSET_CMPD)
+ ADD_H5_TEST (w-err-dset-none 1 WATCH.h5/DSET_NONE)
+ ADD_H5_TEST (w-err-dset-nomax 1 WATCH.h5/DSET_NOMAX)
+ ADD_H5_TEST (w-err-file 1 ../WATCH.h5/DSET_CMPD)
+ ADD_H5_TEST (w-err-width 1 --width=-8 WATCH.h5/DSET_ONE)
+ ADD_H5_TEST (w-err-poll 1 --polling=-8 WATCH.h5/DSET_ONE)
+ ADD_H5_TEST (w-err-poll0 1 --polling=0 WATCH.h5/DSET_ONE)
#
# Tests on invalid field names via --fields option for a compound typed dataset: DSET_CMPD
- ADD_H5_TEST(w-err-cmpd1 1 --fields=fieldx WATCH.h5/DSET_CMPD)
- ADD_H5_TEST(w-err-cmpd2 1 --fields=field1,field2. WATCH.h5/DSET_CMPD)
- ADD_H5_TEST(w-err-cmpd3 1 --fields=field1,field2, WATCH.h5/DSET_CMPD)
- ADD_H5_TEST(w-err-cmpd4 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD)
- ADD_H5_TEST(w-err-cmpd5 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD)
+ ADD_H5_TEST (w-err-cmpd1 1 --fields=fieldx WATCH.h5/DSET_CMPD)
+ ADD_H5_TEST (w-err-cmpd2 1 --fields=field1,field2. WATCH.h5/DSET_CMPD)
+ ADD_H5_TEST (w-err-cmpd3 1 --fields=field1,field2, WATCH.h5/DSET_CMPD)
+ ADD_H5_TEST (w-err-cmpd4 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD)
+ ADD_H5_TEST (w-err-cmpd5 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD)
#
-ENDIF ()
+endif ()