X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/06991b16dda9f3dc3991f39599512a7e94260667..9060b3e8d2ac9296abb97f159895718cd233f3bc:/tests/programs.at diff --git a/tests/programs.at b/tests/programs.at index b02d9ab..e482fcb 100644 --- a/tests/programs.at +++ b/tests/programs.at @@ -1,4 +1,4 @@ -dnl Copyright © 2020-2022 Nick Bowler +dnl Copyright © 2020-2023 Nick Bowler dnl dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. dnl This is free software: you are free to do what the fuck you want to. @@ -230,3 +230,54 @@ dx_cv_join_works=yes ]) AT_CLEANUP + +AT_SETUP([autotest probes]) +AT_KEYWORDS([DX_PROG_BISON program])dnl + +AT_DATA([test.in], +[[@AUTOTEST@ +@dx_cv_autotest_works@ +]]) + +TEST_CONFIGURE_AC([[DX_PROG_AUTOTEST +AC_SUBST([dx_cv_autotest_works]) + +set x conftest*; shift +if test -f $[]1; then + AC_MSG_ERROR([$[]1 left behind by [D@@&t@&t@X_PROG_AUTOTEST]]) +fi +AC_CONFIG_FILES([test])]]) +TEST_AUTORECONF + +# Check the search via path lookup for autom4te +mkdir bin +cp -P "$srcdir/t/autotest.sh" bin/autom4te + +save_PATH=$PATH +PATH=`pwd`/bin${PATH:+":$PATH"} +TEST_CONFIGURE +PATH=$save_PATH + +AT_CHECK([cat test], [0], [[autom4te -l autotest +yes +]]) + +# Check that we can assign AUTOTEST directly +TEST_CONFIGURE([AUTOTEST="$srcdir/t/autotest.sh"]) +AT_CHECK_UNQUOTED([cat test], [0], [[$srcdir/t/autotest.sh +yes +]]) + +# Check that we can assign AUTOM4TE directly +TEST_CONFIGURE([AUTOM4TE="$srcdir/t/autotest.sh"]) +AT_CHECK_UNQUOTED([cat test], [0], [[$srcdir/t/autotest.sh -l autotest +yes +]]) + +# Check that a bogus program doesn't come back as valid +TEST_CONFIGURE([AUTOTEST=true]) +AT_CHECK([cat test], [0], [[true +no +]]) + +AT_CLEANUP