X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/f1527e8c5958c25abb54818a2e9618a85a75bec0..2fa6f6881b22fe1aabb2d25ed6040fd8e8ddb3b5:/snippet/test-tap.at diff --git a/snippet/test-tap.at b/snippet/test-tap.at index 7941cb7..ee4b541 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. @@ -7,7 +7,7 @@ # This is free software: you are free to do what the fuck you want to. # There is NO WARRANTY, to the extent permitted by law. -m4_divert_push([PREPARE_TESTS])dnl +m4_defun([_TEST_TAP_PREPARE], [m4_divert_push([PREPARE_TESTS])dnl { echo "% prove --version" prove --version "$program.tap" + "$builddir/t/$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]) +m4_divert_pop([PREPARE_TESTS])]) dnl TEST_TAP([application]) dnl dnl Run the given TAP application. The exit status indicates the overall dnl success/failure of the test, while the application's TAP-formatted dnl output is logged with details of individual test results. -m4_define([TEST_TAP], [AT_CHECK([test_run_tap $1], [0], [ignore])]) +m4_defun([TEST_TAP], [m4_require([_TEST_TAP_PREPARE])dnl +AT_CHECK([test_run_tap $1], [0], [ignore])]) dnl TEST_TAP_SIMPLE([name], [application], [setup], [keywords]) dnl