diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-05-20 17:07:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 17:07:09 (GMT) |
commit | 4466a30825eda620a00e5d8fac35ecf765296aad (patch) | |
tree | 84497284f2a6c6558a02329512f379328fdbdfa9 /test | |
parent | 60820abcbef0cd4efa23cabacc728c088aebf554 (diff) | |
download | hdf5-4466a30825eda620a00e5d8fac35ecf765296aad.zip hdf5-4466a30825eda620a00e5d8fac35ecf765296aad.tar.gz hdf5-4466a30825eda620a00e5d8fac35ecf765296aad.tar.bz2 |
Change TestExpress #1722 (#1776)
* Change TestExpress #1722
* Update comment
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 8 | ||||
-rw-r--r-- | test/CMakePassthroughVOLTests.cmake | 4 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 10 | ||||
-rw-r--r-- | test/CMakeVFDTests.cmake | 4 | ||||
-rw-r--r-- | test/cache_api.c | 2 | ||||
-rw-r--r-- | test/testframe.c | 39 |
6 files changed, 43 insertions, 24 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 77aeba0..54414ff 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,6 +34,9 @@ if (NOT ONLY_SHARED_LIBS) INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_TEST_LIB_TARGET} + PRIVATE "H5_TEST_EXPRESS_LEVEL_DEFAULT=${H5_TEST_EXPRESS_LEVEL_DEFAULT}" + ) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} @@ -53,7 +56,10 @@ if (BUILD_SHARED_LIBS) INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") + target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" + PRIVATE "H5_TEST_EXPRESS_LEVEL_DEFAULT=${H5_TEST_EXPRESS_LEVEL_DEFAULT}" + ) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET} diff --git a/test/CMakePassthroughVOLTests.cmake b/test/CMakePassthroughVOLTests.cmake index cf5ad36..0703d9e 100644 --- a/test/CMakePassthroughVOLTests.cmake +++ b/test/CMakePassthroughVOLTests.cmake @@ -140,7 +140,7 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/volTest.cmake" ) set_tests_properties (VOL-${volname}-${voltest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} ) endif () @@ -197,7 +197,7 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD ) set_tests_properties (VOL-${volname}-fheap PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} ) endif () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index bdaca75..40b9304 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -481,7 +481,7 @@ if (NOT CYGWIN) endif () set_tests_properties (H5TEST-cache PROPERTIES FIXTURES_REQUIRED clear_cache - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) @@ -498,7 +498,7 @@ if (TEST_CACHE_IMAGE) add_test (NAME H5TEST_cache_image COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache_image>) set_tests_properties (H5TEST-cache_image PROPERTIES FIXTURES_REQUIRED clear_cache_image - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) endif () @@ -538,7 +538,7 @@ else () endif () set_tests_properties (H5TEST-external_env PROPERTIES FIXTURES_REQUIRED clear_external_env - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -572,7 +572,7 @@ else () endif () set_tests_properties (H5TEST-vds_env PROPERTIES FIXTURES_REQUIRED clear_vds_env - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -607,7 +607,7 @@ else () endif () set_tests_properties (H5TEST-flush1 PROPERTIES FIXTURES_REQUIRED clear_flush - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) if (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 22bad5d..87683fa 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -131,7 +131,7 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) endif () @@ -186,7 +186,7 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD ) set_tests_properties (VFD-${vfdname}-fheap PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) endif () diff --git a/test/cache_api.c b/test/cache_api.c index f79a531..cf4575f 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -835,7 +835,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) * with the cache API calls. * * NOTE: This test takes some time to run and checks the - * HDF5TestExpress environment variable. + * testing express level value. * * Return: Test pass status (TRUE/FALSE) * diff --git a/test/testframe.c b/test/testframe.c index d3f0211..e7499ed 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -413,16 +413,20 @@ SetTestVerbosity(int newval) Values: 0: Exhaustive run Tests should take as long as necessary - 1: Full run. Default if HDF5TestExpress is not defined + 1: Full run. Default if H5_TEST_EXPRESS_LEVEL_DEFAULT + and HDF5TestExpress are not defined Tests should take no more than 30 minutes 2: Quick run Tests should take no more than 10 minutes - 3: Smoke test. Default if HDF5TestExpress is set to a value other than 0-3 + 3: Smoke test. + Default if HDF5TestExpress is set to a value other than 0-3 Tests should take less than 1 minute Design: If the environment variable $HDF5TestExpress is defined, - then test programs should skip some tests so that they + or if a default testing level > 1 has been set via + H5_TEST_EXPRESS_LEVEL_DEFAULT, then test programs should + skip some tests so that they complete sooner. Terms: @@ -442,18 +446,27 @@ GetTestExpress(void) /* set it here for now. Should be done in something like h5test_init(). */ if (TestExpress == -1) { + int express_val = 1; + + /* Check if a default test express level is defined (e.g., by build system) */ +#ifdef H5_TEST_EXPRESS_LEVEL_DEFAULT + express_val = H5_TEST_EXPRESS_LEVEL_DEFAULT; +#endif + + /* Check if HDF5TestExpress is set to override the default level */ env_val = HDgetenv("HDF5TestExpress"); + if (env_val) { + if (HDstrcmp(env_val, "0") == 0) + express_val = 0; + else if (HDstrcmp(env_val, "1") == 0) + express_val = 1; + else if (HDstrcmp(env_val, "2") == 0) + express_val = 2; + else + express_val = 3; + } - if (env_val == NULL) - SetTestExpress(1); - else if (HDstrcmp(env_val, "0") == 0) - SetTestExpress(0); - else if (HDstrcmp(env_val, "1") == 0) - SetTestExpress(1); - else if (HDstrcmp(env_val, "2") == 0) - SetTestExpress(2); - else - SetTestExpress(3); + SetTestExpress(express_val); } return (TestExpress); |