From a6f7dccbd6c6b10ac0051a54bf7e35dedf685861 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Wed, 18 May 2022 19:06:12 -0500 Subject: Change TestExpress #1722 (#1777) --- CMakeLists.txt | 7 ++++++- configure.ac | 28 +++++++++++++++++++++++++++- release_docs/INSTALL | 2 +- release_docs/INSTALL_CMake.txt | 2 +- test/CMakeLists.txt | 8 +++++++- test/CMakeTests.cmake | 10 +++++----- test/CMakeVFDTests.cmake | 4 ++-- test/cache_api.c | 10 +++++----- test/testframe.c | 39 ++++++++++++++++++++++++++------------- 9 files changed, 80 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5c9876..2c4f88e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -931,8 +931,13 @@ if (BUILD_TESTING) H5_SET_VFD_LIST() endif () - option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") + set (H5_TEST_EXPRESS_LEVEL_DEFAULT "3") + set (HDF_TEST_EXPRESS "${H5_TEST_EXPRESS_LEVEL_DEFAULT}" + CACHE STRING "Control testing framework (0-3) (0 = exhaustive testing; 3 = quicker testing)") mark_as_advanced (HDF_TEST_EXPRESS) + if (NOT "${HDF_TEST_EXPRESS}" STREQUAL "") + set (H5_TEST_EXPRESS_LEVEL_DEFAULT "${HDF_TEST_EXPRESS}") + endif () enable_testing () include (CTest) diff --git a/configure.ac b/configure.ac index 1e71bf9..08a73bb 100644 --- a/configure.ac +++ b/configure.ac @@ -882,7 +882,7 @@ AC_MSG_CHECKING([if the high-level tools are enabled]) AC_ARG_ENABLE([hltools], [AS_HELP_STRING([--enable-hltools], [Enable the high-level tools. - [default=yes)] + [default=yes] ])], [HDF5_HL_TOOLS=$enableval]) @@ -1108,6 +1108,32 @@ AC_SUBST([H5_TEST_BUILDDIR]) H5_TEST_BUILDDIR='test' ## ---------------------------------------------------------------------- +## Check what level of testing should be enabled +## + +## Default is quickest testing +TEST_EXPRESS_LEVEL_DEFAULT=3 + +AC_MSG_CHECKING([if HDF5 testing intensity level is set]) + +AC_ARG_ENABLE([test-express], + [AS_HELP_STRING([--enable-test-express=(0-3)], + [Set HDF5 testing intensity level (0-3) [0 = exhaustive testing; 3 = quicker testing; default=3] Set environment variable HDF5TestExpress to override configured setting])], + [TEST_EXPRESS_LEVEL_DEFAULT=$enableval]) + +case "X-$TEST_EXPRESS_LEVEL_DEFAULT" in + X-0|X-1|X-2|X-3) + AC_MSG_RESULT([$TEST_EXPRESS_LEVEL_DEFAULT]) + ;; + *) + AC_MSG_RESULT([error]) + AC_MSG_ERROR([$TEST_EXPRESS_LEVEL_DEFAULT is not a valid test express level]) + ;; +esac + +AC_DEFINE_UNQUOTED([TEST_EXPRESS_LEVEL_DEFAULT], [$TEST_EXPRESS_LEVEL_DEFAULT], [HDF5 testing intensity level]) + +## ---------------------------------------------------------------------- ## Check if they would like to disable building tools ## diff --git a/release_docs/INSTALL b/release_docs/INSTALL index d811efe..5b9e84c 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -487,7 +487,7 @@ CONTENTS The HDF5 tests can take a long time to run on some systems. To perform a faster (but less thorough) test, set the HDF5TestExpress environment variable to 2 or 3 (with 3 being the shortest run). To perform a - longer test, set HDF5TestExpress to 0. 1 is the default. + longer test, set HDF5TestExpress to 0. 3 is the default. 4.6. Installing HDF5 The HDF5 library, include files, and support programs can be diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 9fb6b2b..684e3c4 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -769,7 +769,7 @@ HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF -HDF_TEST_EXPRESS "Control testing framework (0-3)" "0" +HDF_TEST_EXPRESS "Control testing framework (0-3)" "3" HDF5_TEST_VFD "Execute tests with different VFDs" OFF HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF DEFAULT_API_VERSION "Enable default API (v16, v18, v110)" "v110" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e6345de..d41b07f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,6 +34,9 @@ if (NOT ONLY_SHARED_LIBS) INTERFACE "$/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 "$/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/CMakeTests.cmake b/test/CMakeTests.cmake index 9178e4e..6bd82e5 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -545,7 +545,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}) @@ -562,7 +562,7 @@ if (TEST_CACHE_IMAGE) add_test (NAME H5TEST_cache_image COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) 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 () @@ -602,7 +602,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 ) @@ -636,7 +636,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 ) @@ -671,7 +671,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 9c628dd..b803392 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -662,7 +662,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) * configured as per the default both by looking at its internal * configuration, and via the H5Fget_mdc_config() call. * - * Then set serveral different configurations, and verify that + * Then set several different configurations, and verify that * they took as per above. */ @@ -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) * @@ -1054,7 +1054,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) } /* set the dataset creation plist to specify that the raw data is - * to be partioned into 10X10 element chunks. + * to be partitioned into 10X10 element chunks. */ if (pass) { @@ -1885,7 +1885,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) pass = TRUE; - /* Create a file for test purposes, and veify that its metadata cache + /* Create a file for test purposes, and verify that its metadata cache * set to the default MDC configuration. */ @@ -2254,7 +2254,7 @@ main(void) } /* end if */ /* Test with paged aggregation enabled or not */ - /* The "my_fcpl" passed to each test has the paged or non-paged strategy set up accordinly */ + /* The "my_fcpl" passed to each test has the paged or non-paged strategy set up accordingly */ for (paged = FALSE; paged <= TRUE; paged++) { hid_t my_fcpl = fcpl_id; diff --git a/test/testframe.c b/test/testframe.c index f805997..2e02ae6 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); -- cgit v0.12