m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

head testsuite invocation cleanup


From: Eric Blake
Subject: head testsuite invocation cleanup
Date: Mon, 19 Jun 2006 07:01:17 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Based on the autoconf documentation, I installed this.  I tested with both
a VPATH and in-tree build, but there may still be errors, so I welcome any
feedback.

2006-06-16  Eric Blake  <address@hidden>

        Follow recommendations from autoconf manual for autotest.
        * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
        turn it into an absolute path until autotest provides an option
        that allows us to avoid changing directories.  Properly quote
        throughout.
        (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
        (check-recursive): Delete unused target.
        ($(TESTSUITE)): Atomically update testsuite.
        (CD_TESTDIR): Simplify.
        (m4__cd): Delete unused macro.
        (check-local): Let TESTSUITEFLAGS influence the run.
        (installcheck-local): Let TESTSUITEFLAGS override
        AUTOTEST_PATH.  Add dependencies.
        (clean-local): Clean up.
        (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
        * README: Document how to use the testsuite.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFElqAc84KuGfSFAYARAiX3AJwOAz/3nwaC/Z74Wc6c1Z/CALy2AgCfaTlm
FdUZrEEGg0Nlu6o0zMomM9I=
=RwTM
-----END PGP SIGNATURE-----
Index: README
===================================================================
RCS file: /sources/m4/m4/README,v
retrieving revision 1.9
diff -u -p -r1.9 README
--- README      10 Jun 2006 21:23:30 -0000      1.9
+++ README      19 Jun 2006 12:58:15 -0000
@@ -56,6 +56,18 @@ they only describe a solution, from whic
 infer.  Don't forget all relevant information about your operating
 system, compiler, libraries, ...
 
+The easiest way to remember this information is by using the
+testsuite.  Any test failures are automatically logged, along with
+lots of useful information about your setup; simply mailing
+tests/testsuite.log to address@hidden' is a good start.  If you want
+to dive in and debug a failure, you may find it useful to fine-tune
+the execution of the testsuite.  For example, running test 12 in
+verbose mode can be done with:
+
+make check TESTSUITEFLAGS='-v -d -x 12'
+
+The testsuite understands --help to tell you more about the current
+set of tests.
 
 
 ## ------- ##
Index: Makefile.am
===================================================================
RCS file: /sources/m4/m4/Makefile.am,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile.am
--- Makefile.am 16 Jun 2006 03:51:28 -0000      1.30
+++ Makefile.am 19 Jun 2006 12:58:15 -0000
@@ -43,9 +43,6 @@ MAINTAINERCLEANFILES = \
 
 BUILT_SOURCES  =
 
-# Using `cd' in backquotes may print the directory name, use this instead:
-m4__cd         = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-
 # Make sure config.status is regenerated when the version timestamp changes
 MKSTAMP = $(SHELL) $(srcdir)/$(config_aux_dir)/mkstamp
 CONFIG_STATUS_DEPENDENCIES = stamp-vcl
@@ -330,7 +327,12 @@ dist_pkgdata_DATA = \
 ## Test suite. ##
 ## ----------- ##
 
-TESTSUITE = tests/testsuite
+# NOTE - After 2.60, autoconf might add an option to testsuite to specify
+# which directory it should output testsuite.log.  Until then, we want it
+# to drop in tests, so we have to do a cd inside make targets that invoke
+# testsuite.  As a result, we need an absolute path since a relative
+# $(srcdir) does not work after cd.
+TESTSUITE = $(abs_srcdir)/tests/testsuite
 TESTSUITE_AT   = \
                  tests/builtins.at \
                  tests/generated.at \
@@ -340,7 +342,7 @@ TESTSUITE_AT        = \
                  tests/others.at \
                  tests/testsuite.at
 
-EXTRA_DIST     += $(TESTSUITE) $(TESTSUITE_AT) $(OTHER_FILES) \
+EXTRA_DIST     += '$(TESTSUITE)' $(TESTSUITE_AT) $(OTHER_FILES) \
                  tests/atlocal.in \
                  tests/generate.awk \
                  tests/package.m4
@@ -353,6 +355,9 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$
        CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
        F77="$(F77)" FFLAGS="$(FFLAGS)" \
        GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)"
+if USE_GMP
+TESTS_ENVIRONMENT += USE_GMP=yes
+endif
 
 # Using variables so that this snippet is not too wide and can
 # be used as is in Texinfo @example/@end example.
@@ -362,15 +367,13 @@ $(srcdir)/tests/generated.at: tests/gene
        $(generate) $(m4_texinfo) >address@hidden
        mv address@hidden $@
 
-check-recursive: $(srcdir)/$(TESTSUITE)
-
 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
 # how `testsuite' appears in our dependencies.
 AUTOM4TE = autom4te
 AUTOTEST = $(AUTOM4TE) --language=autotest
-$(srcdir)/$(TESTSUITE): tests/package.m4 $(TESTSUITE_AT)
-       cd $(srcdir)/tests; \
-       $(AUTOTEST) -I $(srcdir)/tests testsuite.at -o testsuite
+$(TESTSUITE): tests/package.m4 $(TESTSUITE_AT)
+       $(AUTOTEST) -I '$(srcdir)/tests' -o address@hidden address@hidden
+       mv address@hidden $@
 
 $(srcdir)/tests/package.m4: configure.ac
        {                                       \
@@ -386,28 +389,28 @@ tests/atconfig: config.status
        $(SHELL) ./config.status tests/atconfig
 DISTCLEANFILES += tests/atconfig
 
-CD_TESTDIR     = abs_srcdir=`$(m4__cd) $(srcdir) && pwd`; cd tests
+CD_TESTDIR     = cd ./tests
 
 # Hook the test suite into the check rule
-check-local: tests/atconfig $(srcdir)/$(TESTSUITE)
+check-local: tests/atconfig $(TESTSUITE)
        $(CD_TESTDIR); \
-       $(TESTS_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) 
$(TESTSUITE_FLAGS)
+       $(SHELL) '$(TESTSUITE)' $(TESTS_ENVIRONMENT) $(TESTSUITEFLAGS)
 
 # Run the test suite on the *installed* tree.
-installcheck-local:
+installcheck-local: tests/atconfig $(TESTSUITE)
        $(CD_TESTDIR); \
-       $(TESTS_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) 
$(TESTSUITE_FLAGS) AUTOTEST_PATH=$(exec_prefix)/bin
+       $(SHELL) '$(TESTSUITE)' $(TESTS_ENVIRONMENT) \
+         AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
 
 # We need to remove any file droppings left behind by testsuite.
 clean-local:
-       -$(CD_TESTDIR); \
-       test -f $$abs_srcdir/$(TESTSUITE) && \
-           $(SHELL) $$abs_srcdir/$(TESTSUITE) --clean
+       $(CD_TESTDIR); \
+       test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean
 
 OTHER_FILES    = tests/iso8859.m4 tests/stackovf.test
 
-DISTCLEANFILES += atconfig atlocal m4
-MAINTAINERCLEANFILES += generated.at $(TESTSUITE)
+DISTCLEANFILES += tests/atconfig tests/atlocal tests/m4
+MAINTAINERCLEANFILES += tests/generated.at '$(TESTSUITE)'
 
 ##                                                                      ##
 ##                   --- RULES FOR THE MAINTAINER ---                   ##

reply via email to

[Prev in Thread] Current Thread [Next in Thread]