[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] autotest: enable usage of EXEEXT in AT_TESTED
From: |
Paolo Bonzini |
Subject: |
[PATCH 3/3] autotest: enable usage of EXEEXT in AT_TESTED |
Date: |
Sun, 16 Dec 2012 15:35:00 +0100 |
* tests/autotest.at (AT_INIT): Expand contents of $at_tested.
(AT_TESTED): Quote each program that is passed to the function.
* lib/autotest/general.m4 (C unit tests): Add AT_TESTED invocation
and keyword.
* doc/autoconf.texi (Writing testsuites): Document usage of variables
in AT_TESTED.
* NEWS: Document change.
Signed-off-by: Paolo Bonzini <address@hidden>
---
NEWS | 2 ++
doc/autoconf.texi | 6 ++++++
lib/autotest/general.m4 | 4 ++--
tests/autotest.at | 4 ++++
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index 6fa116a..185ca26 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,8 @@ GNU Autoconf NEWS - User visible changes.
- AC_CONFIG_TESTDIR will automatically pass EXEEXT to a testsuite (via
the atconfig file).
+- AT_TESTED arguments can use variable or command substitutions, including
+ in particular $EXEEXT
* Noteworthy changes in release 2.69 (2012-04-24) [stable]
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index b0526da..c45a8c2 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -25029,6 +25029,12 @@ Writing Testsuites
the test suite itself, or its occasional misuses. It is a good idea to
also subscribe foreign programs you depend upon, to avoid incompatible
diagnostics.
+
address@hidden is implicitly wrapped in shell double quotes, but it
+will still use shell variable expansion (@samp{$}), command substitution
+(@samp{`}), and backslash escaping (@samp{\}). In particular, the
address@hidden variable is available if it is passed to the testsuite
+via @file{atlocal} or @file{atconfig}.
@end defmac
@sp 1
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 7be2e3b..88b6c1d 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -1001,7 +1001,7 @@ m4_divert_push([PREPARE_TESTS])dnl
} >&AS_MESSAGE_LOG_FD
# Report what programs are being tested.
-for at_program in : $at_tested
+for at_program in : `eval echo $at_tested`
do
test "$at_program" = : && continue
case $at_program in
@@ -1794,7 +1794,7 @@
m4_defun([AT_ARG_OPTION_ARG],[_AT_ARG_OPTION([$1],[$2],1,[$3],[$4])])
# must correspond to the version of the package. PATH should be
# already preset so the proper executable will be selected.
m4_define([AT_TESTED],
-[m4_append_uniq_w([AT_tested], [$1])])
+[m4_append_uniq_w([AT_tested], ["$1"])])
# AT_COPYRIGHT(TEXT, [FILTER = m4_newline])
diff --git a/tests/autotest.at b/tests/autotest.at
index 78e8c6b..401cfc3 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -1892,6 +1892,7 @@ AT_CLEANUP
AT_SETUP([C unit tests])
AT_KEYWORDS([AC_@&address@hidden)
+AT_KEYWORDS([AT_@&address@hidden)
mkdir t
AT_DATA([configure.ac], [[AC_INIT
@@ -1923,6 +1924,7 @@ testprog.o: testprog.c
AT_CHECK_AT_PREP([suite],
[[AT_INIT([suite to check C programs])
+AT_TESTED([testprog$EXEEXT])
AT_SETUP([my only test])
AT_CHECK([testprog$EXEEXT foo], [0])
AT_CHECK([testprog$EXEEXT], [1])
@@ -1945,6 +1947,7 @@ AT_CLEANUP
AT_SETUP([C unit tests (EXEEXT)])
AT_KEYWORDS([AC_@&address@hidden)
+AT_KEYWORDS([AT_@&address@hidden)
mkdir t
AT_DATA([configure.ac], [[AC_INIT
@@ -1982,6 +1985,7 @@ testprog.o: testprog.c
AT_CHECK_AT_PREP([suite],
[[AT_INIT([suite to check C programs])
+AT_TESTED([testprog$EXEEXT])
AT_SETUP([my only test])
AT_CHECK([testprog$EXEEXT foo], [0])
AT_CHECK([testprog$EXEEXT], [1])
--
1.8.0.1