Set default level to minimum time (#1722)

This commit is contained in:
Allen Byrne 2022-05-17 11:54:05 -05:00 committed by GitHub
parent e7b184e79e
commit 081b3902bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 80 additions and 30 deletions

View File

@ -953,8 +953,13 @@ if (BUILD_TESTING)
mark_as_advanced (HDF5_TEST_FHEAP_PASSTHROUGH VOL) mark_as_advanced (HDF5_TEST_FHEAP_PASSTHROUGH VOL)
endif () 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) mark_as_advanced (HDF_TEST_EXPRESS)
if (NOT "${HDF_TEST_EXPRESS}" STREQUAL "")
set (H5_TEST_EXPRESS_LEVEL_DEFAULT "${HDF_TEST_EXPRESS}")
endif ()
enable_testing () enable_testing ()
include (CTest) include (CTest)

View File

@ -1119,6 +1119,32 @@ H5_UTILS_TEST_BUILDDIR='utils/test'
AC_SUBST([H5_TEST_BUILDDIR]) AC_SUBST([H5_TEST_BUILDDIR])
H5_TEST_BUILDDIR='test' 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],
[Set HDF5 testing intensity level (0-3) [0 = exhaustive testing; 3 = quicker testing; default=3]])],
[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 ## Check if they would like to disable building tools
## ##

View File

@ -491,7 +491,7 @@ CONTENTS
The HDF5 tests can take a long time to run on some systems. To perform 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 a faster (but less thorough) test, set the HDF5TestExpress environment
variable to 2 or 3 (with 3 being the shortest run). To perform a 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 4.6. Installing HDF5
The HDF5 library, include files, and support programs can be The HDF5 library, include files, and support programs can be

View File

@ -769,7 +769,7 @@ HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries,
FALSE to build according to BUILD_SHARED_LIBS" FALSE FALSE to build according to BUILD_SHARED_LIBS" FALSE
HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF
HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" 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_VFD "Execute tests with different VFDs" OFF
HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF
DEFAULT_API_VERSION "Enable default API (v16, v18, v110, v112, v114)" "v114" DEFAULT_API_VERSION "Enable default API (v16, v18, v110, v112, v114)" "v114"

View File

@ -34,6 +34,9 @@ if (NOT ONLY_SHARED_LIBS)
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
) )
target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") 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_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_TEST_LIB_TARGET} target_link_libraries (${HDF5_TEST_LIB_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
@ -53,7 +56,10 @@ if (BUILD_SHARED_LIBS)
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
) )
target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") 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_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}

View File

@ -142,7 +142,7 @@ add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HD
-P "${HDF_RESOURCES_DIR}/volTest.cmake" -P "${HDF_RESOURCES_DIR}/volTest.cmake"
) )
set_tests_properties (VOL-${volname}-${voltest} PROPERTIES 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} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
) )
endif () 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 set_tests_properties (VOL-${volname}-fheap PROPERTIES
TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} 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} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
) )
endif () endif ()

View File

@ -484,7 +484,7 @@ if (NOT CYGWIN)
endif () endif ()
set_tests_properties (H5TEST-cache PROPERTIES set_tests_properties (H5TEST-cache PROPERTIES
FIXTURES_REQUIRED clear_cache 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 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
) )
set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) 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>) add_test (NAME H5TEST_cache_image COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache_image>)
set_tests_properties (H5TEST-cache_image PROPERTIES set_tests_properties (H5TEST-cache_image PROPERTIES
FIXTURES_REQUIRED clear_cache_image 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 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
) )
endif () endif ()
@ -541,7 +541,7 @@ else ()
endif () endif ()
set_tests_properties (H5TEST-external_env PROPERTIES set_tests_properties (H5TEST-external_env PROPERTIES
FIXTURES_REQUIRED clear_external_env 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 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
) )
@ -575,7 +575,7 @@ else ()
endif () endif ()
set_tests_properties (H5TEST-vds_env PROPERTIES set_tests_properties (H5TEST-vds_env PROPERTIES
FIXTURES_REQUIRED clear_vds_env 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 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
) )
@ -610,7 +610,7 @@ else ()
endif () endif ()
set_tests_properties (H5TEST-flush1 PROPERTIES set_tests_properties (H5TEST-flush1 PROPERTIES
FIXTURES_REQUIRED clear_flush 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 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
) )
if (HDF5_ENABLE_USING_MEMCHECKER) if (HDF5_ENABLE_USING_MEMCHECKER)

View File

@ -131,7 +131,7 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
) )
set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES 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} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
) )
endif () 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 set_tests_properties (VFD-${vfdname}-fheap PROPERTIES
TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} 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} WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
) )
endif () endif ()

View File

@ -835,7 +835,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
* with the cache API calls. * with the cache API calls.
* *
* NOTE: This test takes some time to run and checks the * NOTE: This test takes some time to run and checks the
* HDF5TestExpress environment variable. * testing express level value.
* *
* Return: Test pass status (TRUE/FALSE) * Return: Test pass status (TRUE/FALSE)
* *

View File

@ -413,16 +413,20 @@ SetTestVerbosity(int newval)
Values: Values:
0: Exhaustive run 0: Exhaustive run
Tests should take as long as necessary 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 Tests should take no more than 30 minutes
2: Quick run 2: Quick run
Tests should take no more than 10 minutes 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 Tests should take less than 1 minute
Design: Design:
If the environment variable $HDF5TestExpress is defined, 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. complete sooner.
Terms: Terms:
@ -442,18 +446,27 @@ GetTestExpress(void)
/* set it here for now. Should be done in something like h5test_init(). */ /* set it here for now. Should be done in something like h5test_init(). */
if (TestExpress == -1) { if (TestExpress == -1) {
env_val = HDgetenv("HDF5TestExpress"); int express_val = 1;
if (env_val == NULL) /* Check if a default test express level is defined (e.g., by build system) */
SetTestExpress(1); #ifdef H5_TEST_EXPRESS_LEVEL_DEFAULT
else if (HDstrcmp(env_val, "0") == 0) express_val = H5_TEST_EXPRESS_LEVEL_DEFAULT;
SetTestExpress(0); #endif
else if (HDstrcmp(env_val, "1") == 0)
SetTestExpress(1); /* Check if HDF5TestExpress is set to override the default level */
else if (HDstrcmp(env_val, "2") == 0) env_val = HDgetenv("HDF5TestExpress");
SetTestExpress(2); if (env_val) {
else if (HDstrcmp(env_val, "0") == 0)
SetTestExpress(3); 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;
}
SetTestExpress(express_val);
} }
return (TestExpress); return (TestExpress);

View File

@ -522,8 +522,8 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
} }
/* NOTE: This is a memory intensive test and is only run /* NOTE: This is a memory intensive test and is only run
* with 2 MPI ranks and with $HDF5TestExpress == 0 * with 2 MPI ranks and with a testing express level
* i.e. Exhaustive test run is allowed. Otherwise * of 0, i.e. Exhaustive test run is allowed. Otherwise
* the test is skipped. * the test is skipped.
* *
* Thanks to l.ferraro@cineca.it for the following test:: * Thanks to l.ferraro@cineca.it for the following test::