diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-05-17 16:54:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 16:54:05 (GMT) |
commit | 081b3902bfd2d5ffbf7a2925db2a9ff802288579 (patch) | |
tree | 0426cd1de6b5e7ab8787931a4e8982d65d31f584 /test | |
parent | e7b184e79ec489ae7a373840a75ec45ea355d635 (diff) | |
download | hdf5-081b3902bfd2d5ffbf7a2925db2a9ff802288579.zip hdf5-081b3902bfd2d5ffbf7a2925db2a9ff802288579.tar.gz hdf5-081b3902bfd2d5ffbf7a2925db2a9ff802288579.tar.bz2 |
Set default level to minimum time (#1722)
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 f9e6e4b..2026528 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 e9f1381..94433de 100644 --- a/test/CMakePassthroughVOLTests.cmake +++ b/test/CMakePassthroughVOLTests.cmake @@ -142,7 +142,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 () @@ -199,7 +199,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 a534e60..72f7a8d 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -484,7 +484,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}) @@ -501,7 +501,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 () @@ -541,7 +541,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 ) @@ -575,7 +575,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 ) @@ -610,7 +610,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 e08e4d2..b371753 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 ec0a903..1decef9 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); |