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
This commit is contained in:
Dana Robinson 2022-03-10 10:22:16 -08:00 committed by GitHub
parent d5ddf61803
commit b9470be379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 247 additions and 323 deletions

View File

@ -1341,28 +1341,27 @@
./test/tchecksum.c
./test/tconfig.c
./test/tcoords.c
./test/test_filter_plugin.sh.in
./test/test_abort_fail.sh.in
./test/test_check_version.sh.in
./test/test_error.sh.in
./test/test_external_env.sh.in
./test/test_filters_be.h5
./test/test_filters_le.h5
./test/test_usecases.sh.in
./test/test_vol_plugin.sh.in
./test/testabort_fail.sh.in
./test/testcheck_version.sh.in
./test/testerror.sh.in
./test/testexternal_env.sh.in
./test/testflushrefresh.sh.in
./test/test_flush_refresh.sh.in
./test/test_libinfo.sh.in
./test/test_links_env.sh.in
./test/test_mirror.sh.in
./test/test_plugin.sh.in
./test/test_swmr.pwsh.in
./test/test_swmr.sh.in
./test/test_use_cases.sh.in
./test/test_vds_env.sh.in
./test/test_vds_swmr.pwsh.in
./test/test_vds_swmr.sh.in
./test/testframe.c
./test/testhdf5.c
./test/testhdf5.h
./test/testlibinfo.sh.in
./test/testlinks_env.sh.in
./test/testmeta.c
./test/test_mirror.sh.in
./test/testswmr.pwsh.in
./test/testswmr.sh.in
./test/testvds_env.sh.in
./test/testvdsswmr.pwsh.in
./test/testvdsswmr.sh.in
./test/tfile.c
./test/tgenprop.c
./test/th5o.c

View File

@ -4165,20 +4165,19 @@ AC_CONFIG_FILES([src/libhdf5.settings
src/Makefile
test/Makefile
test/H5srcdir_str.h
test/testabort_fail.sh
test/testcheck_version.sh
test/testerror.sh
test/testexternal_env.sh
test/testflushrefresh.sh
test/testlibinfo.sh
test/testlinks_env.sh
test/testswmr.sh
test/testvds_env.sh
test/testvdsswmr.sh
test/test_filter_plugin.sh
test/test_abort_fail.sh
test/test_check_version.sh
test/test_error.sh
test/test_external_env.sh
test/test_flush_refresh.sh
test/test_libinfo.sh
test/test_links_env.sh
test/test_mirror.sh
test/test_usecases.sh
test/test_vol_plugin.sh
test/test_plugin.sh
test/test_swmr.sh
test/test_use_cases.sh
test/test_vds_env.sh
test/test_vds_swmr.sh
testpar/Makefile
testpar/testpflush.sh
utils/Makefile

View File

@ -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")

View File

@ -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

View File

@ -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
)

View File

@ -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() */
/****************/

View File

@ -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

140
test/test_plugin.sh.in Normal file
View File

@ -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

View File

@ -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