]> git.draconx.ca Git - dxcommon.git/blobdiff - snippet/test-tap.at
Import getline helper from cdecl99.
[dxcommon.git] / snippet / test-tap.at
index 2873cf463b41754320fe72365698afbc35f2fb83..9167bc56605bf5e19dab115a4dcc65613079288b 100644 (file)
@@ -1,4 +1,4 @@
-# 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.
@@ -17,9 +17,11 @@ m4_defun([_TEST_TAP_PREPARE], [m4_divert_push([PREPARE_TESTS])dnl
 # 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