diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-07-18 22:14:20 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-07-18 22:14:20 (GMT) |
commit | dfc06f79489da8609ea32a2794d76782502cf2fd (patch) | |
tree | b07285065c820720b70e6a6135e41fd8d16021ce | |
parent | d95f36686b2a68bcd848d68bcb81be520d01f037 (diff) | |
parent | 3a8892a0d90edb6c21c91ede18bf6b3cb2895af0 (diff) | |
download | hdf5-dfc06f79489da8609ea32a2794d76782502cf2fd.zip hdf5-dfc06f79489da8609ea32a2794d76782502cf2fd.tar.gz hdf5-dfc06f79489da8609ea32a2794d76782502cf2fd.tar.bz2 |
Merge pull request #1142 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '3a8892a0d90edb6c21c91ede18bf6b3cb2895af0':
Adjust error handling
TRILABS-137 Convert tcheck_version script to cmake tests
ifdef around std flag for cygwin
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 9 | ||||
-rw-r--r-- | java/test/TestH5Lcreate.java | 10 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 19 | ||||
-rw-r--r-- | test/ShellTests.cmake | 28 |
4 files changed, 30 insertions, 36 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 1ba090c..214afa0 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,26 +13,27 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") + if (NOT CYGWIN) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") + endif () if (${HDF_CFG_NAME} MATCHES "Debug") - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () else () - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (${HDF_CFG_NAME} MATCHES "Debug") - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") endif () else () - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java index 646babc..06c4ac1 100644 --- a/java/test/TestH5Lcreate.java +++ b/java/test/TestH5Lcreate.java @@ -147,6 +147,13 @@ public class TestH5Lcreate { H5.H5Pset_link_creation_order(H5fcpl, HDF5Constants.H5P_CRT_ORDER_TRACKED+HDF5Constants.H5P_CRT_ORDER_INDEXED); H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, H5fcpl, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5L.createH5file: " + err); + } + assertTrue("TestH5L.createH5file: H5.H5Fcreate: ",H5fid > 0); + try { H5dsid = H5.H5Screate_simple(2, H5dims, null); H5did1 = _createDataset(H5fid, H5dsid, "DS1", HDF5Constants.H5P_DEFAULT); H5gid = _createGroup(H5fid, "/G1"); @@ -154,9 +161,8 @@ public class TestH5Lcreate { } catch (Throwable err) { err.printStackTrace(); - fail("TestH5L.createH5file: " + err); + fail("TestH5L.createH5objs: " + err); } - assertTrue("TestH5L.createH5file: H5.H5Fcreate: ",H5fid > 0); assertTrue("TestH5L.createH5file: H5.H5Screate_simple: ",H5dsid > 0); assertTrue("TestH5L.createH5file: H5.H5Gcreate: ",H5gid > 0); diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 34e21f7..cc6ebb8 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -720,6 +720,23 @@ if (BUILD_SHARED_LIBS) endif () endif () +#-- Adding test for tcheck_version +add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM") +set_tests_properties (H5TEST-tcheck_version-major PROPERTIES + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + WILL_FAIL "true" +) +add_test (NAME H5TEST-tcheck_version-minor COMMAND $<TARGET_FILE:tcheck_version> "-tm") +set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + WILL_FAIL "true" +) +add_test (NAME H5TEST-tcheck_version-release COMMAND $<TARGET_FILE:tcheck_version> "-tr") +set_tests_properties (H5TEST-tcheck_version-release PROPERTIES + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + WILL_FAIL "true" +) + ############################################################################## ############################################################################## @@ -730,7 +747,6 @@ endif () #--------------- # error_test # err_compat -# tcheck_version # testmeta # atomic_writer # atomic_reader @@ -740,7 +756,6 @@ endif () ############################################################################## # autotools script tests # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. -# NOT CONVERTED tcheck_version is used by testcheck_version.sh. # NOT CONVERTED accum_swmr_reader is used by accum.c. # NOT CONVERTED atomic_writer and atomic_reader are standalone programs. # links_env is used by testlinks_env.sh diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index fe997b2..58dc85d 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -28,7 +28,6 @@ if (UNIX) configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY) endif () configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY) - configure_file(${HDF5_TEST_SOURCE_DIR}/testcheck_version.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testcheck_version.sh @ONLY) configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh @ONLY) configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh @ONLY) @@ -49,27 +48,6 @@ if (UNIX) ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh" ) - add_custom_command ( - TARGET tcheck_version - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_BINARY_DIR}/H5pubconf.h" "${HDF5_TEST_BINARY_DIR}/src/H5pubconf.h" - ) - - add_custom_command ( - TARGET tcheck_version - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_BINARY_DIR}/libhdf5.settings" "${HDF5_TEST_BINARY_DIR}/src/libhdf5.settings" - ) - - add_custom_command ( - TARGET tcheck_version - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/src/H5public.h" "${HDF5_TEST_BINARY_DIR}/src/H5public.h" - ) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") add_custom_command ( TARGET flushrefresh @@ -190,7 +168,6 @@ if (UNIX) ############################################################################## # H5_CHECK_TESTS #--------------- - # tcheck_version # atomic_writer # atomic_reader # filenotclosed @@ -198,7 +175,6 @@ if (UNIX) ############################################################################## # autotools script tests # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. - # NOT CONVERTED tcheck_version is used by testcheck_version.sh. # NOT CONVERTED accum_swmr_reader is used by accum.c. # NOT CONVERTED atomic_writer and atomic_reader are standalone programs. # links_env is used by testlinks_env.sh @@ -235,10 +211,6 @@ if (UNIX) set_tests_properties (H5SHELL-testvdsswmr PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - add_test (H5SHELL-testcheck_version ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testcheck_version.sh) - set_tests_properties (H5SHELL-testcheck_version PROPERTIES - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) endif () endif () |