From: Stefano Lattarini Date: Thu, 4 Mar 2010 19:22:17 +0000 (+0100) Subject: Avoid generation of `tests/defs-p' file X-Git-Tag: v1.11.1b~91^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03449117fa0f9c749708845a89dbc48a84673202;p=thirdparty%2Fautomake.git Avoid generation of `tests/defs-p' file * tests/defs.in: In the generated `configure.in' snippet: call `AM_INIT_AUTOMAKE' with the `parallel-tests' option if the shell variable `parallel_tests' is set to `yes'. * tests/Makefile.am (defs-p): Target removed. (check_SCRIPTS): Removed `defs-p'. (clean-local-check): Do not unlink `defs-p' anymore. ($(parallel_tests)): Transformation rules for the test scripts adjusted. * tests/gen-parallel-tests: Selection rules for the test scripts adjusted. * tests/parallel-tests.test: Set `$parallel_tests' to `yes' then include `./defs' (rather than simply including `./defs-p'). * tests/parallel-tests2.test: Likewise. * tests/parallel-tests3.test: Likewise. * tests/parallel-tests4.test: Likewise. * tests/parallel-tests5.test: Likewise. * tests/parallel-tests6.test: Likewise. * tests/parallel-tests7.test: Likewise. * tests/parallel-tests8.test: Likewise. * tests/parallel-tests9.test: Likewise. * tests/parallel-tests10.test: Likewise. * tests/README (Section "Writing Test Cases", subsection "Do"): Adjusted the parts referring to tests checking `parallel-tests' behaviour. Some other minor related improvements. * tests/.gitignore (defs-p): Removed. --- diff --git a/ChangeLog b/ChangeLog index 84faddcf2..d198ee643 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2010-03-03 Stefano Lattarini + Ralf Wildenhues + + Avoid generation of `tests/defs-p' file. + * tests/defs.in: In the generated `configure.in' snippet: call + `AM_INIT_AUTOMAKE' with the `parallel-tests' option if the shell + variable `parallel_tests' is set to `yes'. + * tests/Makefile.am (defs-p): Target removed. + (check_SCRIPTS): Removed `defs-p'. + (clean-local-check): Do not unlink `defs-p' anymore. + ($(parallel_tests)): Transformation rules for the test scripts + adjusted. + * tests/gen-parallel-tests: Selection rules for the test + scripts adjusted. + * tests/parallel-tests.test: Set `$parallel_tests' to `yes' + then include `./defs' (rather than simply including `./defs-p'). + * tests/parallel-tests2.test: Likewise. + * tests/parallel-tests3.test: Likewise. + * tests/parallel-tests4.test: Likewise. + * tests/parallel-tests5.test: Likewise. + * tests/parallel-tests6.test: Likewise. + * tests/parallel-tests7.test: Likewise. + * tests/parallel-tests8.test: Likewise. + * tests/parallel-tests9.test: Likewise. + * tests/parallel-tests10.test: Likewise. + * tests/README (Section "Writing Test Cases" subsection "Do"): + Adjusted the parts referring to tests checking `parallel-tests' + behaviour. Some other minor related improvements. + * tests/.gitignore (defs-p): Removed. + 2010-03-04 Stefano Lattarini Remove redundant unset of variable TESTS from some test scripts. diff --git a/tests/.gitignore b/tests/.gitignore index cfd45650c..3c1f9903f 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,7 +1,6 @@ aclocal-* automake-* defs -defs-p parallel-tests.am *.dir *.log diff --git a/tests/Makefile.am b/tests/Makefile.am index 4b73a627e..e721e66f6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,14 +30,12 @@ $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am $(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \ - sed 's,^\. \./defs,. ./defs-p,' < $(srcdir)/$$input > $@ + sed 's|^\. \./defs.*|parallel_tests=yes; &|' \ + < $(srcdir)/$$input >$@ chmod a+rx $@ MAINTAINERCLEANFILES = $(parallel_tests) -defs-p: defs Makefile.am - sed 's,^AM_INIT_AUTOMAKE$$,&([parallel-tests]),' < defs >$@ - TESTS = \ aclibobj.test \ aclocal.test \ @@ -765,7 +763,7 @@ $(parallel_tests) EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) # Each test case depends on defs, aclocal, and automake. -check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION) +check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) clean-local: clean-local-check .PHONY: clean-local-check @@ -777,4 +775,3 @@ clean-local-check: find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \ rm -rf "$$@"; \ fi; - -rm -f defs-p diff --git a/tests/Makefile.in b/tests/Makefile.in index 709739e41..682e13769 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1000,7 +1000,7 @@ $(parallel_tests) EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) # Each test case depends on defs, aclocal, and automake. -check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION) +check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) all: all-am .SUFFIXES: @@ -1355,12 +1355,10 @@ $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am $(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \ - sed 's,^\. \./defs,. ./defs-p,' < $(srcdir)/$$input > $@ + sed 's|^\. \./defs.*|parallel_tests=yes; &|' \ + < $(srcdir)/$$input >$@ chmod a+rx $@ -defs-p: defs Makefile.am - sed 's,^AM_INIT_AUTOMAKE$$,&([parallel-tests]),' < defs >$@ - clean-local: clean-local-check .PHONY: clean-local-check clean-local-check: @@ -1371,7 +1369,6 @@ clean-local-check: find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \ rm -rf "$$@"; \ fi; - -rm -f defs-p # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tests/README b/tests/README index 4068ad6fc..095d17691 100644 --- a/tests/README +++ b/tests/README @@ -95,12 +95,13 @@ Do Use `required=...' for required tools. - Include ./defs (see other tests) for normal tests, ./defs-p for tests - that use the `parallel-tests' option. For the latter, use a name that - ends in `-p.test' and does not clash with any generated tests in the - suite. + Include ./defs in every test script (see existing tests for examples + of how to do this). - Use `set -e' to catch failures you might not have thought of. + For tests that use the `parallel-tests' Automake option, set the shell + variable `parallel_tests' to "yes" before including ./defs. Also, + use for them a name that ends in `-p.test' and does not clash with any + generated tests in the suite. ./defs sets a skeleton configure.in. If possible, append to this file. In some cases you'll have to overwrite it, but this should @@ -108,6 +109,8 @@ Do but do not output anything by default. If you need ./configure to create Makefile, append AC_OUTPUT to configure.in. + Use `set -e' to catch failures you might not have thought of. + Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER, $PERL, $MAKE, $EGREP, and $FGREP, instead of the corresponding commands. diff --git a/tests/defs.in b/tests/defs.in index ecdf069cc..18f2aebcd 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -287,11 +287,15 @@ cd ./$testSubDir # Don't use AC_OUTPUT, but AC_CONFIG_FILES so that appending # still produces a valid configure.ac. But then, tests running # config.status really need to append AC_OUTPUT. -cat > configure.in << END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE -AC_CONFIG_FILES([Makefile]) -END +{ + echo "AC_INIT([$me], [1.0])" + if test x"$parallel_tests" = x"yes"; then + echo "AM_INIT_AUTOMAKE([parallel-tests])" + else + echo "AM_INIT_AUTOMAKE" + fi + echo "AC_CONFIG_FILES([Makefile])" +} >configure.in # Unset some MAKE... variables that may cause $MAKE to act like a # recursively invoked sub-make. Any $MAKE invocation in a test is diff --git a/tests/gen-parallel-tests b/tests/gen-parallel-tests index 4a71a738d..39f5d1e2f 100755 --- a/tests/gen-parallel-tests +++ b/tests/gen-parallel-tests @@ -1,6 +1,21 @@ #! /bin/sh # Generate parallel-tests.am. # +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # For each test in the TESTS list in this Makefile.am file, that itself # tests features of the TESTS automake interface, generate a sibling # test that does likewise, but with the option `parallel-tests' enabled. @@ -16,7 +31,8 @@ grep -v '.-p\.test' | LC_ALL=C sort -u | while read tst; do if grep '^[^#]*parallel-tests' $tst >/dev/null \ - || grep '^\. \./defs-p' $tst >/dev/null + || grep "parallel_tests=yes" $tst >/dev/null \ + || grep "parallel_tests=['\"]yes" $tst >/dev/null then :; else echo $tst; fi; done | { diff --git a/tests/parallel-tests.test b/tests/parallel-tests.test index 97e27b150..29111c232 100755 --- a/tests/parallel-tests.test +++ b/tests/parallel-tests.test @@ -24,7 +24,8 @@ # - TEST_LOGS # - RECHECK_LOGS -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e diff --git a/tests/parallel-tests10.test b/tests/parallel-tests10.test index 2642c7af0..5cd33108e 100755 --- a/tests/parallel-tests10.test +++ b/tests/parallel-tests10.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,8 @@ # - trailing whitespace in TESTS # GNU make 3.80 may expand trailing white space to `.log'. -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e cat >> configure.in << 'END' diff --git a/tests/parallel-tests2.test b/tests/parallel-tests2.test index 5101e474b..9cfe14fc1 100755 --- a/tests/parallel-tests2.test +++ b/tests/parallel-tests2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,8 +18,9 @@ # - check-html # - recheck-html +parallel_tests=yes required=rst2html -. ./defs-p || Exit 1 +. ./defs || Exit 1 set -e diff --git a/tests/parallel-tests3.test b/tests/parallel-tests3.test index e1cbe9f44..a138f908a 100755 --- a/tests/parallel-tests3.test +++ b/tests/parallel-tests3.test @@ -17,8 +17,9 @@ # Check parallel-tests features: # - concurrent parallel execution +parallel_tests=yes required=GNUmake -. ./defs-p || Exit 1 +. ./defs || Exit 1 # This test does not work well if $MAKE contains -j. case $MAKE in diff --git a/tests/parallel-tests4.test b/tests/parallel-tests4.test index f48da5ef9..efe7e8d10 100755 --- a/tests/parallel-tests4.test +++ b/tests/parallel-tests4.test @@ -17,7 +17,8 @@ # Check parallel-tests features: # - suffix rules -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e cat >> configure.in << 'END' diff --git a/tests/parallel-tests5.test b/tests/parallel-tests5.test index 6db5db6e2..c4ff5b905 100755 --- a/tests/parallel-tests5.test +++ b/tests/parallel-tests5.test @@ -20,8 +20,9 @@ # Actually, this test doesn't ensure that things happen concurrently. # It merely serves as demonstration. :-) +parallel_tests=yes required=GNUmake -. ./defs-p || Exit 1 +. ./defs || Exit 1 set -e diff --git a/tests/parallel-tests6.test b/tests/parallel-tests6.test index 7ed7ad6da..44caf0c8d 100755 --- a/tests/parallel-tests6.test +++ b/tests/parallel-tests6.test @@ -19,7 +19,8 @@ # BSD make will expand `$(TESTS:=.log)' to `.log' unless overridden. # See parallel-tests10.test for a similar issue. -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e cat >> configure.in << 'END' diff --git a/tests/parallel-tests7.test b/tests/parallel-tests7.test index 2432c880a..d01ada103 100755 --- a/tests/parallel-tests7.test +++ b/tests/parallel-tests7.test @@ -17,7 +17,8 @@ # Check parallel-tests features: # - per-extension test drivers -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e cat >> configure.in << 'END' diff --git a/tests/parallel-tests8.test b/tests/parallel-tests8.test index 2c270644c..784e07f80 100755 --- a/tests/parallel-tests8.test +++ b/tests/parallel-tests8.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,8 @@ # manual for the ugliness in this area, when VPATH comes into # play. :-/ -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e diff --git a/tests/parallel-tests9.test b/tests/parallel-tests9.test index 300a2f024..337328fd3 100755 --- a/tests/parallel-tests9.test +++ b/tests/parallel-tests9.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,8 @@ # Check parallel-tests features: # - recheck -. ./defs-p || Exit 1 +parallel_tests=yes +. ./defs || Exit 1 set -e