]> git.draconx.ca Git - dxcommon.git/commitdiff
test-tap.at: Tweak filename generation.
authorNick Bowler <nbowler@draconx.ca>
Sat, 6 Jan 2024 20:49:53 +0000 (15:49 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 6 Jan 2024 20:49:53 +0000 (15:49 -0500)
When generating the output filenames, use only the last component of the
test program's filename, up to but not including the first period.

This should enable things to work if an absolute or relative path to an
executable is specified, and avoids extending filenames unnecessarily.

snippet/test-tap.at

index cf9554fa77546e984445344d4e3a50b6e87adff7..9167bc56605bf5e19dab115a4dcc65613079288b 100644 (file)
@@ -18,7 +18,9 @@ m4_defun([_TEST_TAP_PREPARE], [m4_divert_push([PREPARE_TESTS])dnl
 # TAP-formatted output.
 test_run_tap () {
   program=$[1]
-
+  AS_CASE([$program],
+    [*/*], [program=`expr "$program" : '[.*/\([^.]*\)]'`],
+    [*.*], [program=`expr "$program" : '[\([^.]*\)]'`])
   "$[@]" >"$program.tap"
   status=$?
   cat "$program.tap"