]> git.draconx.ca Git - dxcommon.git/blobdiff - tests/programs.at
DX_PROG_AUTOTEST: Modernize.
[dxcommon.git] / tests / programs.at
index b02d9abc7e94c3a965ab4932576842f74dabde6d..e482fcbdd775a0efbf7809044619f356b33d7450 100644 (file)
@@ -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