X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/77f6e4eadbfbddd069ebc259921f4587856d488a..HEAD:/snippet/test-tap.at diff --git a/snippet/test-tap.at b/snippet/test-tap.at index cccea49..9167bc5 100644 --- a/snippet/test-tap.at +++ b/snippet/test-tap.at @@ -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,15 +17,17 @@ 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 # "test" must be a perl script. :; { echo 'print <"$program.pl" - prove "$program.pl" 2>&1 + { prove "$program.pl"; } 2>&1 return $status } m4_divert_pop([PREPARE_TESTS])])