summaryrefslogtreecommitdiffstats
path: root/test/test_usecases.sh.in
diff options
context:
space:
mode:
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