mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-12 15:04:59 +08:00
Set default level to minimum time (#1722)
This commit is contained in:
parent
e7b184e79e
commit
081b3902bf
@ -953,8 +953,13 @@ if (BUILD_TESTING)
|
||||
mark_as_advanced (HDF5_TEST_FHEAP_PASSTHROUGH VOL)
|
||||
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)
|
||||
|
26
configure.ac
26
configure.ac
@ -1119,6 +1119,32 @@ H5_UTILS_TEST_BUILDDIR='utils/test'
|
||||
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],
|
||||
[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
|
||||
##
|
||||
|
@ -491,7 +491,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
|
||||
|
@ -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, v112, v114)" "v114"
|
||||
|
@ -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}
|
||||
|
@ -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 ()
|
||||
|
@ -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)
|
||||
|
@ -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 ()
|
||||
|
@ -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)
|
||||
*
|
||||
|
@ -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) {
|
||||
env_val = HDgetenv("HDF5TestExpress");
|
||||
int express_val = 1;
|
||||
|
||||
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);
|
||||
/* 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;
|
||||
}
|
||||
|
||||
SetTestExpress(express_val);
|
||||
}
|
||||
|
||||
return (TestExpress);
|
||||
|
@ -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
|
||||
* with 2 MPI ranks and with $HDF5TestExpress == 0
|
||||
* i.e. Exhaustive test run is allowed. Otherwise
|
||||
* with 2 MPI ranks and with a testing express level
|
||||
* of 0, i.e. Exhaustive test run is allowed. Otherwise
|
||||
* the test is skipped.
|
||||
*
|
||||
* Thanks to l.ferraro@cineca.it for the following test::
|
||||
|
Loading…
Reference in New Issue
Block a user