diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 42 | ||||
-rw-r--r-- | test/CMakeVFDTests.cmake | 34 | ||||
-rw-r--r-- | test/Makefile.am | 14 | ||||
-rw-r--r-- | test/ShellTests.cmake | 9 | ||||
-rw-r--r-- | test/cache_api.c | 2 | ||||
-rw-r--r-- | test/links.c | 4 | ||||
-rw-r--r-- | test/objcopy.c | 6 | ||||
-rw-r--r-- | test/test_usecases.sh.in | 27 | ||||
-rw-r--r-- | test/testflushrefresh.sh.in | 24 | ||||
-rw-r--r-- | test/testswmr.sh.in | 3 | ||||
-rw-r--r-- | test/testvdsswmr.sh.in | 5 | ||||
-rw-r--r-- | test/tunicode.c | 2 |
12 files changed, 91 insertions, 81 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4efe087..37e6af6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -357,7 +357,7 @@ set (H5_TESTS ros3 s3comms hdfs - mirror_vfd + #mirror_vfd # multiple source ntypes dangle dtransform @@ -378,6 +378,9 @@ set (H5_TESTS cmpd_dtransform event_set ) +if (HDF5_BUILD_UTILS) + set (H5_TESTS ${H5_TESTS} mirror_vfd) +endif () macro (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) @@ -552,30 +555,25 @@ if (HDF5_ENABLE_FORMATTERS) clang_format (HDF5_TEST_thread_id_FORMAT thread_id) endif () +if (HDF5_BUILD_UTILS) #-- Adding test for mirror_vfd add_executable (mirror_vfd ${mirror_vfd_SOURCES}) -target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (mirror_vfd STATIC) - target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIB_TARGET}) -else () - TARGET_C_PROPERTIES (mirror_vfd SHARED) - target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIBSH_TARGET}) -endif () -set_target_properties (mirror_vfd PROPERTIES FOLDER test) - -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd) -endif () + target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (mirror_vfd STATIC) + target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (mirror_vfd SHARED) + target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIBSH_TARGET}) + endif () + set_target_properties (mirror_vfd PROPERTIES FOLDER test) -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_TEST_event_set_FORMAT event_set) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd) + endif () endif () ############################################################################## diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 723595b..130b0bf 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -17,40 +17,8 @@ ############################################################################## # included from CMakeTests.cmake -set (VFD_LIST - sec2 - stdio - core - core_paged - split - multi - family - splitter - #log - log VFD currently has file space allocation bugs -) - -if (H5_HAVE_DIRECT) - set (VFD_LIST ${VFD_LIST} direct) -endif () -if (H5_HAVE_PARALLEL) - # MPI I/O VFD is currently incompatible with too many tests in the VFD test set - # set (VFD_LIST ${VFD_LIST} mpio) -endif () -if (H5_HAVE_MIRROR_VFD) - set (VFD_LIST ${VFD_LIST} mirror) -endif () -if (H5_HAVE_ROS3_VFD) - set (VFD_LIST ${VFD_LIST} ros3) -endif () -if (H5_HAVE_LIBHDFS) - set (VFD_LIST ${VFD_LIST} hdfs) -endif () -if (H5_HAVE_WINDOWS) - set (VFD_LIST ${VFD_LIST} windows) -endif () - +# create more test folders for each VFD foreach (vfdtest ${VFD_LIST}) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files") endforeach () diff --git a/test/Makefile.am b/test/Makefile.am index b55a0fd..57f89b0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -36,8 +36,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # test_mirror.sh: mirror_vfd ../utils/mirror_vfd/* # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh testexternal_env.sh \ - testswmr.sh testvds_env.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh testabort_fail.sh \ - test_mirror.sh + testswmr.sh testvds_env.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh testabort_fail.sh SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ external_env$(EXEEXT) filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \ flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ @@ -50,6 +49,10 @@ if HAVE_SHARED_CONDITIONAL SCRIPT_DEPEND += filter_plugin$(EXEEXT) vol_plugin$(EXEEXT) endif +if MIRROR_VFD_CONDITIONAL + TEST_SCRIPT += test_mirror.sh +endif + check_SCRIPTS = $(TEST_SCRIPT) # These are our main targets. They should be listed in the order to be @@ -91,12 +94,15 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ use_append_chunk use_append_chunk_mirror use_append_mchunks use_disable_mdc_flushes \ swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ - vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \ - mirror_vfd + vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= filter_plugin vfd_plugin vol_plugin endif +if MIRROR_VFD_CONDITIONAL + check_PROGRAMS+= mirror_vfd +endif + # These programs generate test files for the tests. They don't need to be # compiled every time we want to test the library. However, putting # them in a conditional causes automake to generate rules so that they diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index 4074299..732091b 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -21,6 +21,7 @@ if (UNIX) if (SH_PROGRAM) set (srcdir ${HDF5_TEST_SOURCE_DIR}) set (bindir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set (testdir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) ############################################################################## # configure scripts to test dir ############################################################################## @@ -37,7 +38,7 @@ if (UNIX) #shell script creates dir #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test") add_custom_command ( - TARGET output_filter.sh + TARGET accum_swmr_reader POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh" @@ -46,9 +47,11 @@ if (UNIX) #shell script creates dir #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test") + #shell script creates dir + #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test") - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test") + #shell script creates dir + #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test") ############################################################################## ############################################################################## diff --git a/test/cache_api.c b/test/cache_api.c index 432dab3..ff74f64 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -546,7 +546,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* size_t max_decrement = */ (1 * 1024 * 1024 - 1), /* int epochs_before_eviction = */ 4, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05f, + /* double empty_reserve = */ 0.05, /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; diff --git a/test/links.c b/test/links.c index 4627a35..1c01b0f 100644 --- a/test/links.c +++ b/test/links.c @@ -22659,6 +22659,10 @@ main(void) HDputs(" External link tests skipped - not using native VOL connector, or using splitter " "VFD"); } + else if (HDstrcmp(env_h5_drvr, "splitter") == 0) { + HDputs(" External link tests skipped - splitter VFD does not currently support external " + "links"); + } else { /* tests for external link */ /* Test external file cache first, so it sees the default efc setting on the fapl diff --git a/test/objcopy.c b/test/objcopy.c index 3f28fa6..9f98cf9 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -11117,7 +11117,7 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int)); for (j = 0; j < buf[i].b.len; j++) ((int *)buf[i].b.p)[j] = (int)(i * 10 + j); - buf[i].c = 1.0F / ((float)i + 1.0F); + buf[i].c = 1.0 / ((double)i + 1.0); } /* end for */ /* Initialize the filenames */ @@ -11293,7 +11293,7 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int)); for (j = 0; j < buf[i].b.len; j++) ((int *)buf[i].b.p)[j] = (int)(i * 10 + j); - buf[i].c = 1.0F / ((float)i + 1.0F); + buf[i].c = 1.0 / ((double)i + 1.0); } /* end for */ /* Initialize the filenames */ @@ -11478,7 +11478,7 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int)); for (j = 0; j < buf[i].b.len; j++) ((int *)buf[i].b.p)[j] = (int)(i * 10 + j); - buf[i].c = 1.0F / ((float)i + 1.0F); + buf[i].c = 1.0 / ((double)i + 1.0); } /* end for */ /* Initialize the filenames */ diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 7ba5583..3f7d5f1 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -21,8 +21,27 @@ # For now, it shows how to run the test cases programs. It only verifies the # exit codes are okay (0). +############################################################################### +## test variables +############################################################################### + +# Number of errors encountered during test run. +nerrors=0 + +# Define variables +verbose=yes + +############################################################################### +## Main +############################################################################### srcdir=@srcdir@ bindir=@bindir@ +testdir=@testdir@ + +# The build (current) directory might be different than the source directory. +if test -z "$srcdir"; then + srcdir=. +fi # If the bindir directory is not set just use current (.). if test -z "$bindir"; then @@ -36,7 +55,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +$bindir/swmr_check_compat_vfd rc=$? if [[ $rc != 0 ]] ; then echo @@ -58,10 +77,6 @@ RESULT_SKIP="-SKIP-" USECASES_PROGRAMS="use_append_chunk use_append_mchunks" TESTNAME="Use Case" -# Define variables -nerrors=0 -verbose=yes - # Source in the output filter function definitions. . $srcdir/../bin/output_filter.sh @@ -128,7 +143,7 @@ TOOLTEST() { # the test. Running each of these tests in its own directory should eliminate # the problem. mkdir usecases_test -cp twriteorder usecases_test +cp $bindir/twriteorder usecases_test for FILE in use_*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index b58799a..3c7f13d 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -58,14 +58,28 @@ fi ############################################################################### ## Main ############################################################################### +srcdir=@srcdir@ +bindir=@bindir@ +testdir=@testdir@ + # The build (current) directory might be different than the source directory. if test -z "$srcdir"; then srcdir=. fi +# If the bindir directory is not set just use current (.). +if test -z "$bindir"; then + bindir=. +fi + +# If the testdir directory is not set just use current (.). +if test -z "$testdir"; then + testdir=. +fi + # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +$bindir/swmr_check_compat_vfd rc=$? if [ $rc -ne 0 ] ; then echo @@ -83,7 +97,7 @@ fi # the test. Running each of these tests in its own directory should eliminate # the problem. mkdir -p flushrefresh_test -cp flushrefresh flushrefresh_test +cp $bindir/flushrefresh flushrefresh_test # With the --disable-shared option, flushrefresh is built in the test directory, # otherwise it is in test/.libs with a wrapper script named flushrefresh in @@ -118,7 +132,7 @@ fi # ======================== # Launch the Test Program. # ======================== -./flushrefresh & +$testdir/flushrefresh & pid_main=$! # ======================================= @@ -155,7 +169,7 @@ until [ $verification_done -eq 1 ]; do verification_done=1 echo "all flush verification complete" > $endsignal else - ./flushrefresh $param1 $param2 + $testdir/flushrefresh $param1 $param2 # Check for core dump if [ $? -gt 0 ]; then @@ -200,7 +214,7 @@ if [ $timedout -eq 0 ]; then verification_done=2 echo "all refresh verification complete" > $endsignal else - ./flushrefresh $param1 + $testdir/flushrefresh $param1 # Check for core dump if [ $? -gt 0 ]; then diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index 0ae554c..cb60fce 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -18,6 +18,7 @@ srcdir=@srcdir@ bindir=@bindir@ +testdir=@testdir@ ############################################################################### ## test parameters @@ -110,7 +111,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +$bindir/swmr_check_compat_vfd rc=$? if [ $rc -ne 0 ] ; then echo diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index a1225a2..ea1d77d 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -18,6 +18,7 @@ srcdir=@srcdir@ bindir=@bindir@ +testdir=@testdir@ ############################################################################### ## test parameters @@ -96,7 +97,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +$bindir/swmr_check_compat_vfd rc=$? if [ $rc -ne 0 ] ; then echo @@ -112,7 +113,7 @@ fi # environment variable supports Virtual Datasets. # # Note: Depends on vds_elink_compat_vol tool from $(topdir)/utils -../utils/vds_elink_compat_vol +$bindir/vds_elink_compat_vol rc=$? if [ $rc -ne 0 ] ; then echo diff --git a/test/tunicode.c b/test/tunicode.c index 1b696ac..7d4dba6 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -34,7 +34,7 @@ #define RANK 1 #define COMP_INT_VAL 7 #define COMP_FLOAT_VAL (-42.0F) -#define COMP_DOUBLE_VAL 42.0F +#define COMP_DOUBLE_VAL 42.0 /* Test function prototypes */ void test_fl_string(hid_t fid, const char *string); |