diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-03-10 18:22:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 18:22:16 (GMT) |
commit | b9470be379354af209daf8418b6c571dde99e776 (patch) | |
tree | eabf683eef30f9ebaa65a5d706ba43fc410bd8f2 /test | |
parent | d5ddf61803f30e87bdfa629339fabf6fe1eb4a3c (diff) | |
download | hdf5-b9470be379354af209daf8418b6c571dde99e776.zip hdf5-b9470be379354af209daf8418b6c571dde99e776.tar.gz hdf5-b9470be379354af209daf8418b6c571dde99e776.tar.bz2 |
Plugin test cleanup (#1479)
* Autotools plugin test cleanup
* Combines filter, VFD, and VOL plugin tests
* Adds VFD plugin tests to the Autotools
* Implements a uniform shell script naming scheme in test/
* codespell fix
* Changes after code review
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeTests.cmake | 42 | ||||
-rw-r--r-- | test/Makefile.am | 67 | ||||
-rw-r--r-- | test/ShellTests.cmake | 58 | ||||
-rw-r--r-- | test/filter_plugin.c | 10 | ||||
-rw-r--r-- | test/test_abort_fail.sh.in (renamed from test/testabort_fail.sh.in) | 0 | ||||
-rw-r--r-- | test/test_check_version.sh.in (renamed from test/testcheck_version.sh.in) | 0 | ||||
-rw-r--r-- | test/test_error.sh.in (renamed from test/testerror.sh.in) | 0 | ||||
-rw-r--r-- | test/test_external_env.sh.in (renamed from test/testexternal_env.sh.in) | 0 | ||||
-rw-r--r-- | test/test_filter_plugin.sh.in | 113 | ||||
-rw-r--r-- | test/test_flush_refresh.sh.in (renamed from test/testflushrefresh.sh.in) | 0 | ||||
-rw-r--r-- | test/test_libinfo.sh.in (renamed from test/testlibinfo.sh.in) | 0 | ||||
-rw-r--r-- | test/test_links_env.sh.in (renamed from test/testlinks_env.sh.in) | 0 | ||||
-rw-r--r-- | test/test_plugin.sh.in | 140 | ||||
-rw-r--r-- | test/test_swmr.pwsh.in (renamed from test/testswmr.pwsh.in) | 0 | ||||
-rw-r--r-- | test/test_swmr.sh.in (renamed from test/testswmr.sh.in) | 0 | ||||
-rw-r--r-- | test/test_use_cases.sh.in (renamed from test/test_usecases.sh.in) | 0 | ||||
-rw-r--r-- | test/test_vds_env.sh.in (renamed from test/testvds_env.sh.in) | 0 | ||||
-rw-r--r-- | test/test_vds_swmr.pwsh.in (renamed from test/testvdsswmr.pwsh.in) | 0 | ||||
-rw-r--r-- | test/test_vds_swmr.sh.in (renamed from test/testvdsswmr.sh.in) | 0 | ||||
-rw-r--r-- | test/test_vol_plugin.sh.in | 84 |
20 files changed, 220 insertions, 294 deletions
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 4e828f8..6abef3b 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -674,18 +674,18 @@ set_tests_properties (H5TEST-tcheck_version-release PROPERTIES # flushrefresh ############################################################################## # autotools script tests -# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. -# NOT CONVERTED accum_swmr_reader is used by accum.c. -# NOT CONVERTED atomic_writer and atomic_reader are standalone programs. -# links_env is used by testlinks_env.sh -# filenotclosed and del_many_dense_attrs are used by testabort_fail.sh -# NOT CONVERTED flushrefresh is used by testflushrefresh.sh. -# NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh -# NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh. -# NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh -# NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG. -# NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly, -# NOT CONVERTED and this lets automake keep all its test programs in one place. +# error_test and err_compat are built at the same time as the other tests, but executed by test_error.sh +# NOT CONVERTED accum_swmr_reader is used by accum.c +# NOT CONVERTED atomic_writer and atomic_reader are stand-alone programs +# links_env is used by test_links_env.sh +# filenotclosed and del_many_dense_attrs are used by test_abort_fail.sh +# NOT CONVERTED flushrefresh is used by test_flush_refresh.sh +# NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_use_cases.sh +# NOT CONVERTED swmr_* files (besides swmr.c) are used by test_swmr.sh +# NOT CONVERTED vds_swmr_* files are used by test_vds_swmr.sh +# 'make check' doesn't run them directly, so they are not included in TEST_PROG. +# Also build testmeta, which is used for timings test. It builds quickly +# and this lets automake keep all its test programs in one place. ############################################################################## #-- Adding test for filenotclosed @@ -853,16 +853,6 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/filter_plugin_dir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/filter_plugin_dir2;srcdir=${HDF5_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} ) - -############################################################################## -# HDFFV-9655 relative plugin test disabled -# -# add_test (NAME H5PLUGIN-pluginRelative COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:plugin>) -# set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES -# ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" -# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} -# ) -############################################################################## endif () option (TEST_SHELL_SCRIPTS "Enable shell script tests" ON) @@ -875,10 +865,10 @@ if (ENABLE_EXTENDED_TESTS) ############################################################################## ### S W M R T E S T S ############################################################################## -# testflushrefresh.sh: flushrefresh -# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes -# testswmr.sh: swmr* -# testvdsswmr.sh: vds_swmr* +# test_flush_refresh.sh: flushrefresh +# test_use_cases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes +# test_swmr.sh: swmr* +# test_vds_swmr.sh: vds_swmr* #-- Adding test for flushrefresh file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") diff --git a/test/Makefile.am b/test/Makefile.am index ff09003..1d31525 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -22,21 +22,23 @@ include $(top_srcdir)/config/commence.am AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # Test scripts-- -# testerror.sh: err_compat, error_test -# testlibinfo.sh: -# testcheck_version.sh: tcheck_version -# testlinks_env.sh: links_env -# testexternal_env.sh: external_env -# testflushrefresh.sh: flushrefresh -# testvds_env.sh: vds_env -# testswmr.sh: swmr* -# testvdsswmr.sh: vds_swmr* -# testabort_fail.sh: filenotclosed.c and del_many_dense_attrs.c -# test_filter_plugin.sh: filter_plugin.c +# test_abort_fail.sh: filenotclosed.c and del_many_dense_attrs.c +# test_check_version.sh: tcheck_version +# test_error.sh: err_compat, error_test +# test_external_env.sh: external_env +# test_flush_refresh.sh: flushrefresh +# test_libinfo.sh: +# test_links_env.sh: links_env # 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_plugin.sh: filter_plugin.c vfd_plugin.c vol_plugin.c +# test_swmr.sh: swmr* +# test_vds_env.sh: vds_env +# test_vds_swmr.sh: vds_swmr* +# test_use_cases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes +TEST_SCRIPT = test_abort_fail.sh test_check_version.sh test_error.sh \ + test_flush_refresh.sh test_external_env.sh test_libinfo.sh \ + test_links_env.sh test_swmr.sh test_vds_env.sh test_vds_swmr.sh \ + test_use_cases.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) \ @@ -45,10 +47,9 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \ vds_env$(EXEEXT) vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT) if HAVE_SHARED_CONDITIONAL - TEST_SCRIPT += test_filter_plugin.sh test_vol_plugin.sh - SCRIPT_DEPEND += filter_plugin$(EXEEXT) vol_plugin$(EXEEXT) + TEST_SCRIPT += test_plugin.sh + SCRIPT_DEPEND += filter_plugin$(EXEEXT) vfd_plugin $(EXEEXT) vol_plugin$(EXEEXT) endif - if MIRROR_VFD_CONDITIONAL TEST_SCRIPT += test_mirror.sh endif @@ -71,22 +72,25 @@ TEST_PROG= testhdf5 \ dangle dtransform reserved cross_read freespace mf vds file_image \ unregister cache_logging cork swmr thread_id vol timer event_set -# List programs to be built when testing here. -# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. -# tcheck_version is used by testcheck_version.sh. -# accum_swmr_reader is used by accum.c. -# atomic_writer and atomic_reader are standalone programs. -# links_env is used by testlinks_env.sh -# external_env is used by testexternal_env.sh -# filenotclosed and del_many_dense_attrs are used by testabort_fail.sh -# flushrefresh is used by testflushrefresh.sh. -# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh -# swmr_* files (besides swmr.c) are used by testswmr.sh. -# vds_swmr_* files are used by testvdsswmr.sh -# vds_env is used by testvds_env.sh +# List programs to be built when testing here +# +# error_test and err_compat are built at the same time as the other tests, but executed by test_error.sh +# tcheck_version is used by test_check_version.sh +# accum_swmr_reader is used by accum.c +# atomic_writer and atomic_reader are stand-alone programs +# links_env is used by test_links_env.sh +# external_env is used by test_external_env.sh +# filenotclosed and del_many_dense_attrs are used by test_abort_fail.sh +# flushrefresh is used by test_flush_refresh.sh +# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_use_cases.sh +# swmr_* files (besides swmr.c) are used by test_swmr.sh +# vds_swmr_* files are used by test_vds_swmr.sh +# vds_env is used by test_vds_env.sh # mirror_vfd is used by test_mirror.sh +# # 'make check' doesn't run them directly, so they are not included in TEST_PROG. -# Also build testmeta, which is used for timings test. It builds quickly, +# +# Also build testmeta, which is used for the timing test. It builds quickly # and this lets automake keep all its test programs in one place. check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ testmeta accum_swmr_reader atomic_writer atomic_reader external_env \ @@ -98,7 +102,6 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= filter_plugin vfd_plugin vol_plugin endif - if MIRROR_VFD_CONDITIONAL check_PROGRAMS+= mirror_vfd endif diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index e7de735..140da6f 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -17,21 +17,21 @@ find_program (PWSH NAMES pwsh powershell) if (PWSH) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/use_cases_test") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test") set (srcdir ${HDF5_TEST_SOURCE_DIR}) set (H5_UTILS_TEST_BUILDDIR ${CMAKE_TEST_OUTPUT_DIRECTORY}) set (H5_TEST_BUILDDIR ${HDF5_TEST_BINARY_DIR}/H5TEST) - configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.ps1 @ONLY) + configure_file(${HDF5_TEST_SOURCE_DIR}/test_swmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_swmr.ps1 @ONLY) # test commented out as currently the programs are not allowing another access to the data file #add_test (H5SHELL-testswmr ${PWSH} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.ps1) #set_tests_properties (H5SHELL-testswmr PROPERTIES # ENVIRONMENT "PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST #) - configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.ps1 @ONLY) + configure_file(${HDF5_TEST_SOURCE_DIR}/test_vds_swmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_vds_swmr.ps1 @ONLY) # test commented out as currently the programs are not allowing another access to the data file #add_test (H5SHELL-testvdsswmr ${PWSH} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.ps1) #set_tests_properties (H5SHELL-testvdsswmr PROPERTIES @@ -48,11 +48,11 @@ elseif (UNIX) # configure scripts to test dir ############################################################################## if (H5_PERL_FOUND) - configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY) + configure_file(${HDF5_TEST_SOURCE_DIR}/test_flush_refresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_flush_refresh.sh @ONLY) endif () - configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY) - configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh @ONLY) - configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh @ONLY) + configure_file(${HDF5_TEST_SOURCE_DIR}/test_use_cases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_use_cases.sh @ONLY) + configure_file(${HDF5_TEST_SOURCE_DIR}/test_swmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_swmr.sh @ONLY) + configure_file(${HDF5_TEST_SOURCE_DIR}/test_vds_swmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_vds_swmr.sh @ONLY) ############################################################################## # copy test programs to test dir @@ -78,44 +78,44 @@ elseif (UNIX) # flushrefresh ############################################################################## # autotools script tests - # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. - # NOT CONVERTED accum_swmr_reader is used by accum.c. - # NOT CONVERTED atomic_writer and atomic_reader are standalone programs. - # links_env is used by testlinks_env.sh - # filenotclosed and del_many_dense_attrs are used by testabort_fail.sh - # NOT CONVERTED flushrefresh is used by testflushrefresh.sh. - # NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh - # NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh. - # NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh + # error_test and err_compat are built at the same time as the other tests, but executed by test_error.sh + # NOT CONVERTED accum_swmr_reader is used by accum.c + # NOT CONVERTED atomic_writer and atomic_reader are stand-alone programs + # links_env is used by test_links_env.sh + # filenotclosed and del_many_dense_attrs are used by test_abort_fail.sh + # NOT CONVERTED flushrefresh is used by test_flush_refresh.sh. + # NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_use_cases.sh + # NOT CONVERTED swmr_* files (besides swmr.c) are used by test_swmr.sh. + # NOT CONVERTED vds_swmr_* files are used by test_vds_swmr.sh # NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG. - # NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly, + # NOT CONVERTED Also build testmeta, which is used for timing test. It builds quickly # NOT CONVERTED and this lets automake keep all its test programs in one place. ############################################################################## ############################################################################## ### S W M R T E S T S ############################################################################## - # testflushrefresh.sh: flushrefresh - # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes - # testswmr.sh: swmr* - # testvdsswmr.sh: vds_swmr* - add_test (H5SHELL-testflushrefresh ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh) - set_tests_properties (H5SHELL-testflushrefresh PROPERTIES + # test_flush_refresh.sh: flushrefresh + # test_use_cases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes + # test_swmr.sh: swmr* + # test_vds_swmr.sh: vds_swmr* + add_test (H5SHELL-test_flush_refresh ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_flush_refresh.sh) + set_tests_properties (H5SHELL-test_flush_refresh PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - add_test (H5SHELL-test_usecases ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh) - set_tests_properties (H5SHELL-test_usecases PROPERTIES + add_test (H5SHELL-test_use_cases ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_use_cases.sh) + set_tests_properties (H5SHELL-test_use_cases PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - add_test (H5SHELL-testswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh) - set_tests_properties (H5SHELL-testswmr PROPERTIES + add_test (H5SHELL-test_swmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_swmr.sh) + set_tests_properties (H5SHELL-test_swmr PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - add_test (H5SHELL-testvdsswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh) - set_tests_properties (H5SHELL-testvdsswmr PROPERTIES + add_test (H5SHELL-test_vds_swmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_vds_swmr.sh) + set_tests_properties (H5SHELL-test_vds_swmr PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) diff --git a/test/filter_plugin.c b/test/filter_plugin.c index c373b3b..dd61a43 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -968,16 +968,6 @@ test_path_api_calls(void) */ n_starting_paths = 42; - /* Check that initialization is correct */ - TESTING(" initialize"); - - if (H5PLsize(&n_paths) < 0) - TEST_ERROR; - if (n_paths != 2) - TEST_ERROR; - - PASSED(); - /****************/ /* H5PLremove() */ /****************/ diff --git a/test/testabort_fail.sh.in b/test/test_abort_fail.sh.in index a866f9e..a866f9e 100644 --- a/test/testabort_fail.sh.in +++ b/test/test_abort_fail.sh.in diff --git a/test/testcheck_version.sh.in b/test/test_check_version.sh.in index 273702e..273702e 100644 --- a/test/testcheck_version.sh.in +++ b/test/test_check_version.sh.in diff --git a/test/testerror.sh.in b/test/test_error.sh.in index 4fb2a81..4fb2a81 100644 --- a/test/testerror.sh.in +++ b/test/test_error.sh.in diff --git a/test/testexternal_env.sh.in b/test/test_external_env.sh.in index 94fbb88..94fbb88 100644 --- a/test/testexternal_env.sh.in +++ b/test/test_external_env.sh.in diff --git a/test/test_filter_plugin.sh.in b/test/test_filter_plugin.sh.in deleted file mode 100644 index 78cdb3a..0000000 --- a/test/test_filter_plugin.sh.in +++ /dev/null @@ -1,113 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# 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. -# -srcdir=@srcdir@ -TOP_BUILDDIR=@top_builddir@ - -# Determine if backward compatibility options enabled -DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" - -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -nerrors=0 -verbose=yes -exit_code=$EXIT_SUCCESS - -TEST_NAME=filter_plugin -TEST_BIN=`pwd`/$TEST_NAME -FROM_DIR=`pwd`/.libs -case $(uname) in - CYGWIN* ) - PLUGINS_FOR_DIR1="$FROM_DIR/cygfilter_plugin1* $FROM_DIR/cygfilter_plugin3*" - PLUGINS_FOR_DIR2="$FROM_DIR/cygfilter_plugin2* $FROM_DIR/cygfilter_plugin4*" - ;; - *) - PLUGINS_FOR_DIR1="$FROM_DIR/libfilter_plugin1* $FROM_DIR/libfilter_plugin3*" - PLUGINS_FOR_DIR2="$FROM_DIR/libfilter_plugin2* $FROM_DIR/libfilter_plugin4*" - ;; -esac -PLUGIN_DIR1=filter_plugin_dir1 -PLUGIN_DIR2=filter_plugin_dir2 -CP="cp -p" # Use -p to preserve mode,ownership,timestamps -RM="rm -rf" - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Main Body -# Create test directories if necessary. -test -d $PLUGIN_DIR1 || mkdir -p $PLUGIN_DIR1 -if [ $? != 0 ]; then - echo "Failed to create filter plugin test directory ($PLUGIN_DIR1)" - exit $EXIT_FAILURE -fi - -test -d $PLUGIN_DIR2 || mkdir -p $PLUGIN_DIR2 -if [ $? != 0 ]; then - echo "Failed to create filter plugin test directory ($PLUGIN_DIR2)" - exit $EXIT_FAILURE -fi - -# Copy plugins for the tests. -$CP $PLUGINS_FOR_DIR1 $PLUGIN_DIR1 -if [ $? != 0 ]; then - echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR1) to test directory." - exit $EXIT_FAILURE -fi - -$CP $PLUGINS_FOR_DIR2 $PLUGIN_DIR2 -if [ $? != 0 ]; then - echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR2) to test directory." - exit $EXIT_FAILURE -fi - -# setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_DIR1}:${PLUGIN_DIR2}" - -# Run the test -$ENVCMD $TEST_BIN -if [ $? != 0 ]; then - nerrors=`expr $nerrors + 1` -fi - -############################################ -# HDFFV-9655 test for relative path disabled -# setup filter plugin path relative to test -# actual executable is in the .libs folder -#ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_DIR1}:@/../${PLUGIN_DIR2}" -# -# Run the test -#$ENVCMD $TEST_BIN -#if [ $? != 0 ]; then -# nerrors=`expr $nerrors + 1` -#fi -############################################# - -# print results -if test $nerrors -ne 0 ; then - echo "$nerrors errors encountered" - exit_code=$EXIT_FAILURE -else - echo "All filter plugin tests passed." - exit_code=$EXIT_SUCCESS -fi - -# Clean up temporary files/directories and leave -$RM $PLUGIN_DIR1 $PLUGIN_DIR2 - -exit $exit_code diff --git a/test/testflushrefresh.sh.in b/test/test_flush_refresh.sh.in index 209d370..209d370 100644 --- a/test/testflushrefresh.sh.in +++ b/test/test_flush_refresh.sh.in diff --git a/test/testlibinfo.sh.in b/test/test_libinfo.sh.in index d9fee48..d9fee48 100644 --- a/test/testlibinfo.sh.in +++ b/test/test_libinfo.sh.in diff --git a/test/testlinks_env.sh.in b/test/test_links_env.sh.in index 09074c3..09074c3 100644 --- a/test/testlinks_env.sh.in +++ b/test/test_links_env.sh.in diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in new file mode 100644 index 0000000..d958b4b --- /dev/null +++ b/test/test_plugin.sh.in @@ -0,0 +1,140 @@ +#!/usr/bin/env bash +# +# Copyright by The HDF Group. +# 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. +# +# This shell script is for testing filter, VFD, and VOL plugins. +# +srcdir=@srcdir@ +TOP_BUILDDIR=@top_builddir@ + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +CP="cp -p" # Use -p to preserve mode,ownership, timestamps +RM="rm -rf" + +nerrors=0 +verbose=yes +exit_code=$EXIT_SUCCESS + +# Test binary names +FILTER_TEST_NAME=filter_plugin +FILTER_TEST_BIN=`pwd`/$FILTER_TEST_NAME + +VFD_TEST_NAME=vfd_plugin +VFD_TEST_BIN=`pwd`/$VFD_TEST_NAME + +VOL_TEST_NAME=vol_plugin +VOL_TEST_BIN=`pwd`/$VOL_TEST_NAME + +# Paths to actual plugins ("libraries" in test directory are just stubs) +FROM_DIR=`pwd`/.libs +case $(uname) in + CYGWIN* ) + NULL_VFD_PLUGIN="$FROM_DIR/cygnull_vfd_plugin*" + NULL_VOL_PLUGIN="$FROM_DIR/cygnull_vol_connector*" + PLUGINS_FOR_DIR1="$FROM_DIR/cygfilter_plugin1* $FROM_DIR/cygfilter_plugin3*" + PLUGINS_FOR_DIR2="$FROM_DIR/cygfilter_plugin2* $FROM_DIR/cygfilter_plugin4*" + ;; + *) + NULL_VFD_PLUGIN="$FROM_DIR/libnull_vfd_plugin*" + NULL_VOL_PLUGIN="$FROM_DIR/libnull_vol_connector*" + PLUGINS_FOR_DIR1="$FROM_DIR/libfilter_plugin1* $FROM_DIR/libfilter_plugin3*" + PLUGINS_FOR_DIR2="$FROM_DIR/libfilter_plugin2* $FROM_DIR/libfilter_plugin4*" + ;; +esac + +# Directories where we'll copy plugins +TEMP_PLUGIN_DIR=temp_plugins +TEMP_FILTER_DIR1=temp_filter_plugin_dir1 +TEMP_FILTER_DIR2=temp_filter_plugin_dir2 + +# Function to print a line-line message left justified in a field of +# 70 characters beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +############# +# Main Body # +############# + +# Create plugin directories +test -d $TEMP_PLUGIN_DIR || mkdir -p $TEMP_PLUGIN_DIR +if [ $? != 0 ]; then + echo "Failed to create plugin test directory ($TEMP_PLUGIN_DIR)" + exit $EXIT_FAILURE +fi +test -d $TEMP_FILTER_DIR1 || mkdir -p $TEMP_FILTER_DIR1 +if [ $? != 0 ]; then + echo "Failed to create filter plugin test directory ($TEMP_FILTER_DIR1)" + exit $EXIT_FAILURE +fi +test -d $TEMP_FILTER_DIR2 || mkdir -p $TEMP_FILTER_DIR2 +if [ $? != 0 ]; then + echo "Failed to create filter plugin test directory ($TEMP_FILTER_DIR2)" + exit $EXIT_FAILURE +fi + +# Copy plugins for the tests +$CP $NULL_VFD_PLUGIN $TEMP_PLUGIN_DIR +if [ $? != 0 ]; then + echo "Failed to copy NULL VFD plugin ($NULL_VFD_PLUGIN) to test directory." + exit $EXIT_FAILURE +fi +$CP $NULL_VOL_PLUGIN $TEMP_PLUGIN_DIR +if [ $? != 0 ]; then + echo "Failed to copy NULL VOL plugin ($NULL_VOL_PLUGIN) to test directory." + exit $EXIT_FAILURE +fi +$CP $PLUGINS_FOR_DIR1 $TEMP_FILTER_DIR1 +if [ $? != 0 ]; then + echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR1) to test directory." + exit $EXIT_FAILURE +fi +$CP $PLUGINS_FOR_DIR2 $TEMP_FILTER_DIR2 +if [ $? != 0 ]; then + echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR2) to test directory." + exit $EXIT_FAILURE +fi + +# Set plugin path +ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}:${TEMP_FILTER_DIR1}:${TEMP_FILTER_DIR2}" + +# Run the tests +$ENVCMD $FILTER_TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi +$ENVCMD $VFD_TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi +$ENVCMD $VOL_TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi + +# Print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit_code=$EXIT_FAILURE +else + echo "All plugin tests passed." + exit_code=$EXIT_SUCCESS +fi + +# Clean up temporary files/directories and leave +$RM $TEMP_PLUGIN_DIR $TEMP_FILTER_DIR1 $TEMP_FILTER_DIR2 + +exit $exit_code diff --git a/test/testswmr.pwsh.in b/test/test_swmr.pwsh.in index de7a57a..de7a57a 100644 --- a/test/testswmr.pwsh.in +++ b/test/test_swmr.pwsh.in diff --git a/test/testswmr.sh.in b/test/test_swmr.sh.in index 771fe4a..771fe4a 100644 --- a/test/testswmr.sh.in +++ b/test/test_swmr.sh.in diff --git a/test/test_usecases.sh.in b/test/test_use_cases.sh.in index fd30afd..fd30afd 100644 --- a/test/test_usecases.sh.in +++ b/test/test_use_cases.sh.in diff --git a/test/testvds_env.sh.in b/test/test_vds_env.sh.in index 39f13a5..39f13a5 100644 --- a/test/testvds_env.sh.in +++ b/test/test_vds_env.sh.in diff --git a/test/testvdsswmr.pwsh.in b/test/test_vds_swmr.pwsh.in index bf5aabb..bf5aabb 100644 --- a/test/testvdsswmr.pwsh.in +++ b/test/test_vds_swmr.pwsh.in diff --git a/test/testvdsswmr.sh.in b/test/test_vds_swmr.sh.in index 399fdef..399fdef 100644 --- a/test/testvdsswmr.sh.in +++ b/test/test_vds_swmr.sh.in diff --git a/test/test_vol_plugin.sh.in b/test/test_vol_plugin.sh.in deleted file mode 100644 index d31646b..0000000 --- a/test/test_vol_plugin.sh.in +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# 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. -# -# This shell script is for testing VOL connector plugins. -# -srcdir=@srcdir@ -TOP_BUILDDIR=@top_builddir@ - -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -nerrors=0 -verbose=yes -exit_code=$EXIT_SUCCESS - -TEST_NAME=vol_plugin -TEST_BIN=`pwd`/$TEST_NAME -FROM_DIR=`pwd`/.libs -case $(uname) in - CYGWIN* ) - NULL_VOL_PLUGIN="$FROM_DIR/cygnull_vol_connector*" - ;; - *) - NULL_VOL_PLUGIN="$FROM_DIR/libnull_vol_connector*" - ;; -esac -TEMP_PLUGIN_DIR=null_vol_plugin_dir -CP="cp -p" # Use -p to preserve mode,ownership, timestamps -RM="rm -rf" - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Main Body -# Create test directory if necessary. -test -d $TEMP_PLUGIN_DIR || mkdir -p $TEMP_PLUGIN_DIR -if [ $? != 0 ]; then - echo "Failed to create VOL connector plugin test directory ($TEMP_PLUGIN_DIR)" - exit $EXIT_FAILURE -fi - -# Copy plugin for the tests. -$CP $NULL_VOL_PLUGIN $TEMP_PLUGIN_DIR -if [ $? != 0 ]; then - echo "Failed to copy NULL VOL plugin ($NULL_VOL_PLUGIN) to test directory." - exit $EXIT_FAILURE -fi - -# setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}" - -# Run the test -$ENVCMD $TEST_BIN -if [ $? != 0 ]; then - nerrors=`expr $nerrors + 1` -fi - -# print results -if test $nerrors -ne 0 ; then - echo "$nerrors errors encountered" - exit_code=$EXIT_FAILURE -else - echo "All VOL plugin tests passed." - exit_code=$EXIT_SUCCESS -fi - -# Clean up temporary files/directories and leave -$RM $TEMP_PLUGIN_DIR - -exit $exit_code |