summaryrefslogtreecommitdiffstats
path: root/test/test_usecases.sh.in
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-10-21 21:09:09 (GMT)
committerGitHub <noreply@github.com>2021-10-21 21:09:09 (GMT)
commit25ef191f433f0b90cd691d6481e6259ef7f5bc65 (patch)
tree7d848a023f120fa1ba81caddf998df2c12af2fb8 /test/test_usecases.sh.in
parent9ad1d9073c2750d7675ef7296e6ad80d50fbdc0f (diff)
downloadhdf5-25ef191f433f0b90cd691d6481e6259ef7f5bc65.zip
hdf5-25ef191f433f0b90cd691d6481e6259ef7f5bc65.tar.gz
hdf5-25ef191f433f0b90cd691d6481e6259ef7f5bc65.tar.bz2
1.12 Merge Move test utilities to utils/test folder #1109 (#1110)
* Merge Move test utilities to utils/test folder #1109 * Merge Correct shell tests and c++ flag warning * Fix typo
Diffstat (limited to 'test/test_usecases.sh.in')
-rw-r--r--test/test_usecases.sh.in32
1 files changed, 26 insertions, 6 deletions
diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in
index eaa875e..3f7d5f1 100644
--- a/test/test_usecases.sh.in
+++ b/test/test_usecases.sh.in
@@ -21,14 +21,38 @@
# 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
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.
$bindir/swmr_check_compat_vfd
@@ -53,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
@@ -91,7 +111,7 @@ TOOLTEST() {
# Run test.
TESTING $program $@
(
- $RUNSERIAL $bindir/$program "$@"
+ $RUNSERIAL $testdir/$program "$@"
) >$actual 2>$actual_err
exit_code=$?
@@ -123,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