Discussion:
[SCM] GNU Autoconf source repository branch, master, updated. v2.69-55-g851ef51
Paolo Bonzini
2012-12-22 14:35:04 UTC
Permalink
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=851ef517963d1e1966c4082530d5e87ba0a415ab

The branch, master has been updated
via 851ef517963d1e1966c4082530d5e87ba0a415ab (commit)
via d902536845bd2dffed6ce7a4d7bde8feb012ea83 (commit)
via fc0ab5b95721c29576f5e4c47cfd4190e39cb18d (commit)
from fd29dbd7d966f0fbde031a67955d77d50268c3d5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 851ef517963d1e1966c4082530d5e87ba0a415ab
Author: Paolo Bonzini <***@gnu.org>
Date: Fri Dec 7 14:00:19 2012 +0100

autotest: enable usage of EXEEXT in AT_TESTED

Together with Linux's binfmt-misc feature, Wine can be used to test
cross-compiled programs as if they were native. However, the shell
will not perform the "magic" addition of the .exe extension after a
program name when searching for an executable. These simple patches
let the user work around this by specifying $EXEEXT in the AT_CHECK
and AT_TESTED argument. (More care is needed because of carriage
returns, but this is beyond the scope of this series).

* 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 <***@gnu.org>

commit d902536845bd2dffed6ce7a4d7bde8feb012ea83
Author: Paolo Bonzini <***@gnu.org>
Date: Fri Dec 7 13:47:06 2012 +0100

autotest: add a simple test suite that runs a C program

* tests/autotest.at (C unit tests): New testcase.
* NEWS: Document change.

Signed-off-by: Paolo Bonzini <***@gnu.org>

commit fc0ab5b95721c29576f5e4c47cfd4190e39cb18d
Author: Paolo Bonzini <***@gnu.org>
Date: Fri Dec 7 13:56:12 2012 +0100

autotest: annotate tests that use AC_CONFIG_TESTDIR

* tests/autotest.at (srcdir propagation, Erlang Eunit unit tests):
Add a keyword for AC_CONFIG_TESTDIR.

Signed-off-by: Paolo Bonzini <***@gnu.org>

-----------------------------------------------------------------------

Summary of changes:
NEWS | 5 ++
doc/autoconf.texi | 6 ++
lib/autoconf/autotest.m4 | 6 ++-
lib/autoconf/lang.m4 | 2 +-
lib/autotest/general.m4 | 4 +-
tests/autotest.at | 118 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 137 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index d0a38a3..185ca26 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,11 @@ GNU Autoconf NEWS - User visible changes.
but processing variable substitutions, command substitutions and
backslashes in the contents argument.

+- 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 c9c1677..aa948a9 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -25013,6 +25013,12 @@ programs are being exercised is crucial to understanding problems in
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.
+
+@var{executables} 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
+@env{EXEEXT} variable is available if it is passed to the testsuite
+via @file{atlocal} or @file{atconfig}.
@end defmac

@sp 1
diff --git a/lib/autoconf/autotest.m4 b/lib/autoconf/autotest.m4
index 64e3d56..fd8c36a 100644
--- a/lib/autoconf/autotest.m4
+++ b/lib/autoconf/autotest.m4
@@ -59,6 +59,9 @@ abs_top_builddir='$ac_abs_top_builddir'
# Backward compatibility with Autotest <= 2.59b:
at_top_builddir=\$at_top_build_prefix

+m4_provide_if([_AC_COMPILER_EXEEXT], [
+EXEEXT='$ac_cv_exeext'
+])dnl
AUTOTEST_PATH='m4_default([$2], [$1])'

SHELL=\${CONFIG_SHELL-'$SHELL'}
@@ -71,7 +74,8 @@ ERLCFLAGS='$ERLCFLAGS'
])dnl
ATEOF
],
-[m4_provide_if([AC_ERLANG_PATH_ERL], [ERL="$ERL"
+[m4_provide_if([_AC_COMPILER_EXEEXT], [ac_cv_exeext="$ac_cv_exeext"
+])m4_provide_if([AC_ERLANG_PATH_ERL], [ERL="$ERL"
])m4_provide_if([AC_ERLANG_PATH_ERLC], [ERLC="$ERLC"
ERLCFLAGS="$ERLCFLAGS"
])])])# AC_CONFIG_TESTDIR
diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4
index 19852b8..fdaf4a1 100644
--- a/lib/autoconf/lang.m4
+++ b/lib/autoconf/lang.m4
@@ -656,7 +656,7 @@ AC_MSG_RESULT([$ac_cv_exeext])
# by checking whether `_AC_COMPILER_EXEEXT' has been expanded.
#
# See _AC_COMPILER_EXEEXT_CROSS for why we need _AC_LANG_IO_PROGRAM.
-m4_define([_AC_COMPILER_EXEEXT],
+AC_DEFUN([_AC_COMPILER_EXEEXT],
[AC_LANG_CONFTEST([_AC_LANG_NULL_PROGRAM])
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
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 fe2e3bc..401cfc3 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -1758,6 +1758,7 @@ printf %s\\n "$std"
## ------------------- ##

AT_SETUP([srcdir propagation])
+AT_KEYWORDS([AC_@&***@CONFIG_TESTDIR])

mkdir pkg vpath-outside vpath-abs
mkdir pkg/t pkg/vpath-inside
@@ -1885,12 +1886,129 @@ AT_CHECK([grep 'two spaces' suite.log], [1])
AT_CLEANUP


+## --------------- ##
+## C executables. ##
+## --------------- ##
+
+AT_SETUP([C unit tests])
+AT_KEYWORDS([AC_@&***@CONFIG_TESTDIR])
+AT_KEYWORDS([AT_@&***@TESTED])
+
+mkdir t
+AT_DATA([configure.ac], [[AC_INIT
+AC_PROG_CC
+AC_CONFIG_TESTDIR([t], [.])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+# Test file
+AT_DATA([testprog.c],
+[[int main(int argc) { return argc == 2 ? 0 : 1; }
+]])
+
+# Testsuite
+AT_DATA([Makefile.in],
+[[CC=@CC@
+CFLAGS=@CFLAGS@
+
+***@EXEEXT@: testprog.o
+testprog.o: testprog.c
+.SUFFIXES: .c .o @EXEEXT@
+
+.c.o:
+ $(CC) -c $<
+***@EXEEXT@:
+ $(CC) -o $@ $^
+]])
+
+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])
+AT_CLEANUP
+]], [], [], [], [t])
+
+rm t/atconfig
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+AT_CHECK([grep '^EXEEXT='\''.*'\' t/atconfig], [], [ignore])
+AT_CHECK([make], [], [ignore])
+AT_CHECK([cd t && $CONFIG_SHELL ./suite], [], [ignore])
+AT_CHECK([grep 1.*successful t/suite.log], [], [ignore])
+AT_CLEANUP
+
+
+## -------------------------------------- ##
+## C executables (force .exe extension). ##
+## -------------------------------------- ##
+
+AT_SETUP([C unit tests (EXEEXT)])
+AT_KEYWORDS([AC_@&***@CONFIG_TESTDIR])
+AT_KEYWORDS([AT_@&***@TESTED])
+
+mkdir t
+AT_DATA([configure.ac], [[AC_INIT
+AC_PROG_CC
+case $ac_cv_exeext in
+ '' | .exe) ;;
+ *) exit 77 ;;
+esac
+ac_cv_exeext=.exe
+AC_SUBST([EXEEXT], [$ac_cv_exeext])
+AC_CONFIG_TESTDIR([t], [.])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+# Test file
+AT_DATA([testprog.c],
+[[int main(int argc) { return argc == 2 ? 0 : 1; }
+]])
+
+# Testsuite
+AT_DATA([Makefile.in],
+[[CC=@CC@
+CFLAGS=@CFLAGS@
+
+***@EXEEXT@: testprog.o
+testprog.o: testprog.c
+.SUFFIXES: .c .o @EXEEXT@
+
+.c.o:
+ $(CC) -c $<
+***@EXEEXT@:
+ $(CC) -o $@ $^
+]])
+
+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])
+AT_CLEANUP
+]], [], [], [], [t])
+
+rm t/atconfig
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+AT_CHECK([grep '^EXEEXT='\''.*'\' t/atconfig], [], [ignore])
+AT_CHECK([make], [], [ignore])
+AT_CHECK([cd t && $CONFIG_SHELL ./suite], [], [ignore])
+AT_CHECK([grep 1.*successful t/suite.log], [], [ignore])
+AT_CLEANUP
+
+
## ------------------------- ##
## Erlang EUnit unit tests. ##
## ------------------------- ##

AT_SETUP([Erlang Eunit unit tests])
AT_KEYWORDS([Erlang])
+AT_KEYWORDS([AC_@&***@CONFIG_TESTDIR])

mkdir s t
AT_DATA([configure.ac], [[AC_INIT


hooks/post-receive
--
GNU Autoconf source repository
Loading...