summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-10-14 13:30:49 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-10-14 13:30:49 (GMT)
commit3c7e11c034b8646d67380789a827709347f45754 (patch)
tree8c997eb2042534f7017e626689488d6b02a5ff90 /test
parent03a42d466557f7e1f483d62eb1b1b9f91babb09f (diff)
downloadhdf5-3c7e11c034b8646d67380789a827709347f45754.zip
hdf5-3c7e11c034b8646d67380789a827709347f45754.tar.gz
hdf5-3c7e11c034b8646d67380789a827709347f45754.tar.bz2
Reverts rename of SWMR VFD check program, which causes CMake issues
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/CMakeTests.cmake2
-rw-r--r--test/Makefile.am2
-rw-r--r--test/ShellTests.cmake2
-rw-r--r--test/swmr_check_compat_vfd.c53
-rw-r--r--test/test_usecases.sh.in2
-rw-r--r--test/testflushrefresh.sh.in2
-rw-r--r--test/testswmr.sh.in2
-rw-r--r--test/testvdsswmr.sh.in2
9 files changed, 62 insertions, 6 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4efe087..1461101 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -617,6 +617,7 @@ endif ()
set (H5_SWMR_TESTS
swmr_addrem_writer
+ swmr_check_compat_vfd
swmr_generator
swmr_reader
swmr_remove_reader
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index b2ed8e8..c537f37 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -879,6 +879,8 @@ if (ENABLE_EXTENDED_TESTS)
# testswmr.sh: swmr*
# testvdsswmr.sh: vds_swmr*
+# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:swmr_check_compat_vfd>)
+
#-- Adding test for flushrefresh
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
if (H5_PERL_FOUND)
diff --git a/test/Makefile.am b/test/Makefile.am
index b55a0fd..f6ede6f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -91,7 +91,7 @@ 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 \
+ swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \
mirror_vfd
if HAVE_SHARED_CONDITIONAL
check_PROGRAMS+= filter_plugin vfd_plugin vol_plugin
diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake
index 4074299..9614152 100644
--- a/test/ShellTests.cmake
+++ b/test/ShellTests.cmake
@@ -37,7 +37,7 @@ if (UNIX)
#shell script creates dir
#file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
add_custom_command (
- TARGET output_filter.sh
+ TARGET swmr_check_compat_vfd
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"
diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c
new file mode 100644
index 0000000..720c747
--- /dev/null
+++ b/test/swmr_check_compat_vfd.c
@@ -0,0 +1,53 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Purpose: This is a small program that checks if the HDF5_DRIVER
+ * environment variable is set to a value that supports SWMR.
+ *
+ * It is intended for use in shell scripts.
+ */
+
+#include "h5test.h"
+
+/* This file needs to access the file driver testing code */
+#define H5FD_FRIEND /*suppress error about including H5FDpkg */
+#define H5FD_TESTING
+#include "H5FDpkg.h" /* File drivers */
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Inspects the HDF5_DRIVER environment variable, which
+ * determines the VFD that the test harness will use with
+ * the majority of the tests.
+ *
+ * Return: VFD supports SWMR: EXIT_SUCCESS
+ *
+ * VFD does not support SWMR
+ * or failure: EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ char *driver = NULL;
+
+ driver = HDgetenv(HDF5_DRIVER);
+
+ if (H5FD__supports_swmr_test(driver))
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
+
+} /* end main() */
diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in
index 7ba5583..cd2e65e 100644
--- a/test/test_usecases.sh.in
+++ b/test/test_usecases.sh.in
@@ -36,7 +36,7 @@ fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-../utils/swmr_compat_vfd
+./swmr_check_compat_vfd
rc=$?
if [[ $rc != 0 ]] ; then
echo
diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in
index b58799a..83685e8 100644
--- a/test/testflushrefresh.sh.in
+++ b/test/testflushrefresh.sh.in
@@ -65,7 +65,7 @@ fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-../utils/swmr_compat_vfd
+./swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in
index 0ae554c..9085306 100644
--- a/test/testswmr.sh.in
+++ b/test/testswmr.sh.in
@@ -110,7 +110,7 @@ fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-../utils/swmr_compat_vfd
+./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..f4bcd77 100644
--- a/test/testvdsswmr.sh.in
+++ b/test/testvdsswmr.sh.in
@@ -96,7 +96,7 @@ fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-../utils/swmr_compat_vfd
+./swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo