-# Copyright © 2015, 2022-2023 Nick Bowler
+# Copyright © 2015, 2022-2024 Nick Bowler
#
# Helper macros for executing the TAP-like applications in an autotest
# test suite.
# Run a test program, and, if prove is installed, use it to interpret the
# TAP-formatted output.
test_run_tap () {
- program=$[1]; shift
-
- "$builddir/t/$program" "$@" >"$program.tap"
+ program=$[1]
+ AS_CASE([$program],
+ [*/*], [program=`expr "$program" : '[.*/\([^.]*\)]'`],
+ [*.*], [program=`expr "$program" : '[\([^.]*\)]'`])
+ "$[@]" >"$program.tap"
status=$?
cat "$program.tap"
# Older versions of prove do not support the -e option so the
# "test" must be a perl script.
:; { echo 'print <<EOF'; cat "$program.tap"; echo 'EOF'; } >"$program.pl"
- prove "$program.pl" 2>&1
+ { prove "$program.pl"; } 2>&1
return $status
}
m4_divert_pop([PREPARE_TESTS])])