Here we go again. The last version of the patch is still wrong, at it doesn't handle correctly the situation where $(srcdir) is different at developer's 'make dist' time and at user's 'make check' time. A similar problem has been spotted by Ralf Wildenhues in a previous patch of mine (that should be resolved by now).
The attached amended patch should take care of this problem. Regards, Stefano
From 861bf5485e583c0f70d6cfa53a5271d7193e4155 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Sun, 6 Jun 2010 18:38:27 +0200 Subject: [PATCH] Overhauled and modularized tests in `instspc.test'. The test `instspc.test' was way too big and fragile. Its running time was very long. It also produced a log that was nearly unreadable due to its lenght, making it very difficult to find out the reason of failures. Also, it was too much monolithic, with a single (maybe spurious) failure in a corner case causing the whole test to fail (even if everything worked as expected in the other 99% of cases). The present change should solve these problems, by separating `instspc.test' into many smaller, self-contained, auto-generated tests. * tests/gen-instspc-tests: New file, generates a distributed Makefile.am snippet `tests/instspc-tests.am'. This contains rules to generate a host of new tests `instspc*.test', which will take over the older `instspc.test'. * tests/instspc.test: Moved to ... * tests/instspc.sh: ... this, and modified (quite heavily) to adapt to the new circumstances (it will be included by all the newly generated `instspc*.test'). * tests/Makefile.am ($(srcdir)/instspc-tests.am): Include this snippet, which (among the other things) defines ... (instspc_tests): ... this new macro, containing the list of the newly generated `instspc*.test' tests, and ... (instspc_xfail_tests): ... this new macro, containing the list of the `instspc*.test' tests expected to fail. ($(instspc_tests:.test=.log)): New rule, registers the dependency of all `instspc*.test' tests from the `instspc.sh' script. (TESTS): Add `$(instspc_tests)', remove `instspc.test'. (XFAIL_TESTS): Add `$(xfail_instspc_tests)'. (EXTRA_DIST): Distribute gen-instspc-tests and instspc.sh. (MAINTAINERCLEANFILES): Added $(instspc_tests). Other minor cosmetic changes. * bootstrap: Generate instspc-tests.am. * tests/.gitignore: Updated. --- ChangeLog | 37 ++ bootstrap | 8 +- tests/.gitignore | 5 +- tests/Makefile.am | 28 ++- tests/Makefile.in | 712 +++++++++++++++++++++++++++++++++++- tests/gen-instspc-tests | 99 +++++ tests/{instspc.test => instspc.sh} | 176 +++++----- 7 files changed, 954 insertions(+), 111 deletions(-) create mode 100755 tests/gen-instspc-tests rename tests/{instspc.test => instspc.sh} (53%) mode change 100755 => 100644 diff --git a/ChangeLog b/ChangeLog index 4f94715..32b4dc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,41 @@ 2010-06-06 Stefano Lattarini <stefano.lattar...@gmail.com> + + Overhauled and modularized tests in `instspc.test'. + The test `instspc.test' was way too big and fragile. Its running + time was very long. It also produced a log that was nearly + unreadable due to its lenght, making it very difficult to find + out the reason of failures. + Also, it was too much monolithic, with a single (maybe spurious) + failure in a corner case causing the whole test to fail (even if + everything worked as expected in the other 99% of cases). + The present change should solve these problems, by separating + `instspc.test' into many smaller, self-contained, auto-generated + tests. + * tests/gen-instspc-tests: New file, generates a distributed + Makefile.am snippet `tests/instspc-tests.am'. This contains + rules to generate a host of new tests `instspc*.test', which + will take over the older `instspc.test'. + * tests/instspc.test: Moved to ... + * tests/instspc.sh: ... this, and modified (quite heavily) to + adapt to the new circumstances (it will be included by all the + newly generated `instspc*.test'). + * tests/Makefile.am ($(srcdir)/instspc-tests.am): Include this + snippet, which (among the other things) defines ... + (instspc_tests): ... this new macro, containing the list of the + newly generated `instspc*.test' tests, and ... + (instspc_xfail_tests): ... this new macro, containing the list + of the `instspc*.test' tests expected to fail. + ($(instspc_tests:.test=.log)): New rule, registers the dependency + of all `instspc*.test' tests from the `instspc.sh' script. + (TESTS): Add `$(instspc_tests)', remove `instspc.test'. + (XFAIL_TESTS): Add `$(xfail_instspc_tests)'. + (EXTRA_DIST): Distribute gen-instspc-tests and instspc.sh. + (MAINTAINERCLEANFILES): Added $(instspc_tests). + Other minor cosmetic changes. + * bootstrap: Generate instspc-tests.am. + * tests/.gitignore: Updated. + +2010-06-06 Stefano Lattarini <stefano.lattar...@gmail.com> Ralf Wildenhues <ralf.wildenh...@gmx.de> Fix distcheck failure with distributed generated parallel tests. diff --git a/bootstrap b/bootstrap index 2a86345..2b19efd 100755 --- a/bootstrap +++ b/bootstrap @@ -2,8 +2,8 @@ # This script helps bootstrap automake, when checked out from git. # -# Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, -# Inc. +# Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010 Free Software +# Foundation, Inc. # written by Pavel Roskin <pro...@gnu.org> September 2002 # # This program is free software; you can redistribute it and/or modify @@ -124,9 +124,11 @@ dosubst m4/amversion.in m4/amversion.m4 # Create temporary replacement for automake dosubst automake.in automake.tmp -# Create tests/parallel-tests.am. +# Create required makefile snippets. cd tests +rm -f parallel-tests.am instspc-tests.am $BOOTSTRAP_SHELL ./gen-parallel-tests > parallel-tests.am +$BOOTSTRAP_SHELL ./gen-instspc-tests > instspc-tests.am cd .. # Run the autotools. diff --git a/tests/.gitignore b/tests/.gitignore index 61b0783..3791060 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,9 +1,12 @@ aclocal-* automake-* defs +instspc-tests.am parallel-tests.am *.dir *.log *.log-t *-p.test -*-p.test-t +instspc[0-9]*-build.test +instspc[0-9]*-install.test +*.test-t diff --git a/tests/Makefile.am b/tests/Makefile.am index f709593..21c84cb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,6 +16,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +MAINTAINERCLEANFILES = ## updated later +EXTRA_DIST = ChangeLog-old ## likewise + XFAIL_TESTS = \ all.test \ auxdir2.test \ @@ -23,6 +26,7 @@ cond17.test \ gcj6.test \ txinfo5.test + include $(srcdir)/parallel-tests.am $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am @@ -41,7 +45,22 @@ $(parallel_tests): Makefile.am } > $...@-t $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ -MAINTAINERCLEANFILES = $(parallel_tests) +MAINTAINERCLEANFILES += $(parallel_tests) $(instspc_tests) +EXTRA_DIST += gen-parallel-tests + + +include $(srcdir)/instspc-tests.am + +$(srcdir)/instspc-tests.am: gen-instspc-tests Makefile.am + $(AM_V_GEN)(cd $(srcdir) && $(SHELL) ./gen-instspc-tests) >$@ + +# All instspc*.test tests work by sourcing the instspc.sh script. +$(instspc_tests:.test=.log): $(srcdir)/instspc.sh + +MAINTAINERCLEANFILES += $(parallel_tests) $(instspc_tests) +EXTRA_DIST += gen-instspc-tests instspc.sh +XFAIL_TESTS += $(instspc_xfail_tests) + TESTS = \ aclibobj.test \ @@ -391,7 +410,6 @@ instman2.test \ instmany.test \ instmany-mans.test \ instmany-python.test \ -instspc.test \ interp.test \ interp2.test \ java.test \ @@ -787,9 +805,11 @@ yacc7.test \ yacc8.test \ yaccpp.test \ yaccvpath.test \ -$(parallel_tests) +$(parallel_tests) \ +$(instspc_tests) + +EXTRA_DIST += $(TESTS) -EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) # Each test case depends on defs, aclocal, and automake. check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) diff --git a/tests/Makefile.in b/tests/Makefile.in index 36fb41e..6e3d8e1 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -50,7 +50,7 @@ POST_UNINSTALL = : build_triplet = @build@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs.in \ - $(srcdir)/parallel-tests.am + $(srcdir)/instspc-tests.am $(srcdir)/parallel-tests.am subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ @@ -250,13 +250,12 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -XFAIL_TESTS = \ -all.test \ -auxdir2.test \ -cond17.test \ -gcj6.test \ -txinfo5.test - +MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests) \ + $(parallel_tests) $(instspc_tests) +EXTRA_DIST = ChangeLog-old gen-parallel-tests gen-instspc-tests \ + instspc.sh $(TESTS) +XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test txinfo5.test \ + $(instspc_xfail_tests) parallel_tests = \ check-p.test \ check10-p.test \ @@ -280,7 +279,59 @@ pr401-p.test \ pr401b-p.test \ pr401c-p.test -MAINTAINERCLEANFILES = $(parallel_tests) +instspc_tests = instspc1-build.test instspc1-install.test \ + instspc2-build.test instspc2-install.test instspc3-build.test \ + instspc3-install.test instspc4-build.test \ + instspc4-install.test instspc5-build.test \ + instspc5-install.test instspc6-build.test \ + instspc6-install.test instspc7-build.test \ + instspc7-install.test instspc8-build.test \ + instspc8-install.test instspc9-build.test \ + instspc9-install.test instspc10-build.test \ + instspc10-install.test instspc11-build.test \ + instspc11-install.test instspc12-build.test \ + instspc12-install.test instspc13-build.test \ + instspc13-install.test instspc14-build.test \ + instspc14-install.test instspc15-build.test \ + instspc15-install.test instspc16-build.test \ + instspc16-install.test instspc17-build.test \ + instspc17-install.test instspc18-build.test \ + instspc18-install.test instspc19-build.test \ + instspc19-install.test instspc20-build.test \ + instspc20-install.test instspc21-build.test \ + instspc21-install.test instspc22-build.test \ + instspc22-install.test instspc23-build.test \ + instspc23-install.test instspc24-build.test \ + instspc24-install.test instspc25-build.test \ + instspc25-install.test instspc26-build.test \ + instspc26-install.test instspc27-build.test \ + instspc27-install.test instspc28-build.test \ + instspc28-install.test instspc29-build.test \ + instspc29-install.test instspc30-build.test \ + instspc30-install.test instspc31-build.test \ + instspc31-install.test instspc32-build.test \ + instspc32-install.test instspc33-build.test \ + instspc33-install.test instspc34-build.test \ + instspc34-install.test instspc35-build.test \ + instspc35-install.test instspc36-build.test \ + instspc36-install.test instspc37-build.test \ + instspc37-install.test instspc38-build.test \ + instspc38-install.test instspc39-build.test \ + instspc39-install.test instspc40-build.test \ + instspc40-install.test instspc41-build.test \ + instspc41-install.test instspc42-build.test \ + instspc42-install.test instspc43-build.test \ + instspc43-install.test instspc44-build.test \ + instspc44-install.test instspc45-build.test \ + instspc45-install.test +instspc_xfail_tests = instspc2-build.test instspc2-install.test \ + instspc3-build.test instspc3-install.test instspc4-build.test \ + instspc4-install.test instspc6-build.test instspc7-build.test \ + instspc7-install.test instspc22-build.test \ + instspc25-build.test instspc25-install.test \ + instspc34-build.test instspc34-install.test \ + instspc40-build.test instspc43-build.test \ + instspc43-install.test TESTS = \ aclibobj.test \ aclocal.test \ @@ -629,7 +680,6 @@ instman2.test \ instmany.test \ instmany-mans.test \ instmany-python.test \ -instspc.test \ interp.test \ interp2.test \ java.test \ @@ -1025,9 +1075,9 @@ yacc7.test \ yacc8.test \ yaccpp.test \ yaccvpath.test \ -$(parallel_tests) +$(parallel_tests) \ +$(instspc_tests) -EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) # Each test case depends on defs, aclocal, and automake. check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) @@ -1035,7 +1085,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .html .log .test -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(srcdir)/instspc-tests.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -1398,6 +1448,642 @@ $(parallel_tests): Makefile.am } > $...@-t $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ +instspc1-build.test instspc1-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''!'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc2-build.test instspc2-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''"'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc3-build.test instspc3-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${sh}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc4-build.test instspc4-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${dl}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc5-build.test instspc5-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''%'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc6-build.test instspc6-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''&'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc7-build.test instspc7-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${sq}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc8-build.test instspc8-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''('\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc9-build.test instspc9-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\'')'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc10-build.test instspc10-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''*'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc11-build.test instspc11-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''+'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc12-build.test instspc12-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\'','\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc13-build.test instspc13-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''-'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc14-build.test instspc14-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\'':'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc15-build.test instspc15-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\'';'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc16-build.test instspc16-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''<'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc17-build.test instspc17-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''='\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc18-build.test instspc18-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''>'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc19-build.test instspc19-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''?'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc20-build.test instspc20-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''@'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc21-build.test instspc21-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''['\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc22-build.test instspc22-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''\'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc23-build.test instspc23-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\'']'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc24-build.test instspc24-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''^'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc25-build.test instspc25-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''`'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc26-build.test instspc26-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''{'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc27-build.test instspc27-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''|'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc28-build.test instspc28-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc29-build.test instspc29-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''~'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc30-build.test instspc30-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${bs}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc31-build.test instspc31-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${cr}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc32-build.test instspc32-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${ff}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc33-build.test instspc33-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${ht}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc34-build.test instspc34-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${lf}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc35-build.test instspc35-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''$${sp}'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc36-build.test instspc36-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''@<:@'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc37-build.test instspc37-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''@:>@'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc38-build.test instspc38-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''@S|@'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc39-build.test instspc39-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''@%:@'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc40-build.test instspc40-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''@&t@'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc41-build.test instspc41-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''a$${sp}b'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc42-build.test instspc42-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''a$${sp}$${sp}b'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc43-build.test instspc43-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''a$${lf}b'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc44-build.test instspc44-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''...'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +instspc45-build.test instspc45-install.test: instspc-tests.am + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ + echo weird_chars=\''a:'\'; \ + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ + +$(srcdir)/instspc-tests.am: gen-instspc-tests Makefile.am + $(AM_V_GEN)(cd $(srcdir) && $(SHELL) ./gen-instspc-tests) >$@ + +# All instspc*.test tests work by sourcing the instspc.sh script. +$(instspc_tests:.test=.log): $(srcdir)/instspc.sh + clean-local: clean-local-check .PHONY: clean-local-check clean-local-check: diff --git a/tests/gen-instspc-tests b/tests/gen-instspc-tests new file mode 100755 index 0000000..e555d5f --- /dev/null +++ b/tests/gen-instspc-tests @@ -0,0 +1,99 @@ +#! /bin/sh +# Generate instspc-tests.am. +# +# Copyright (C) 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 <http://www.gnu.org/licenses/>. + +# Generate a Makefile fragment which defines: +# 1. Rules to generate tests that we can building from, and/or install +# to, directories having in their name shell/make metacharacters, +# control characters, white spaces, autoconf quadrigraphs, or other +# suspicious/problematic tokens. +# 2. The macro $(instspc_tests), containing the list of the tests +# generated by the makefile fragment. +# 3. The macro $(xfail_instspc_test), containing the list of those +# generated tests expected to fail. + +# Original report from James Amundson about file names with spaces. +# Other characters added by Paul Eggert. + +set -e # abort on unhandled errors + +# Defined to help avoiding headaches with multiple escaping into +# backquotes, below. +escape_dollar() { sed 's/\$/$$/g'; } + +cat <<'END' +## Generated by gen-instspc-tests. DO NOT EDIT! +instspc_tests = +instspc_xfail_tests = +END + +count=0 +# Some of these contain symbolic reperesentations of problematic +# characters, which could easily confuse make (e.g. `#', `$' or +# newline). They will be properly expanded by instspc.sh. +for weird_chars in \ + '!' '"' '${sh}' '${dl}' '%' '&' '${sq}' '(' ')' '*' '+' ',' '-' \ + ':' ';' '<' '=' '>' '?' '@' '[' '\' ']' '^' '`' '{' '|' '}' '~' \ + '${bs}' '${cr}' '${ff}' '${ht}' '${lf}' '${sp}' \ + '@<:@' '@:>@' '@S|@' '@%:@' '@&t@' \ + 'a${sp}b' 'a${sp}${sp}b' 'a${lf}b' '...' 'a:' +do + count=`expr $count + 1` + # Simply naming the tests using incremental numbers seems to + # be the best policy. + tst=instspc$count + # We have to escape `$' in makefiles. + case "$weird_chars" in + *\$*) weird_escaped=`printf '%s' "$weird_chars" | escape_dollar`;; + *) weird_escaped=$weird_chars;; + esac + echo # separate sections for different tests + echo "$tst-build.test $tst-install.test: instspc-tests.am" + cat <<'END' + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_GEN) { \ + action=`echo $@ | sed -e 's/\.test$$//' -e s/^.*-//;`; \ + echo '#!/bin/sh'; \ + echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ + echo 'required=gcc'; \ + echo '. ./defs || Exit 1'; \ + echo action=$$action; \ +END + # leading tab here + echo " echo weird_chars=\\''$weird_escaped'\\'; \\" + cat <<'END' + echo '. "$$testsrcdir/instspc.sh"'; \ + } > $...@-t + $(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@ +END + echo "instspc_tests += $tst-build.test $tst-install.test" + # Some of the above "weird" file names cannot be used as a build + # directory on a POSIX host. This list should be empty, but is + # not due to limitations in Autoconf, Automake, Make, M4, or the + # shell. + case $weird_chars in + \"|'${sh}'|'${dl}'|'${sq}'|\&|\\|\`|'${lf}'|'@&t@'|'a${lf}b') + echo "instspc_xfail_tests += $tst-build.test";; + esac + # Similarly, some of the "weird" file names cannot be used as an + # install directory on a POSIX host. This list should ideally + # also be empty. + case $weird_chars in + \"|'${sh}'|'${dl}'|'${sq}'|\`|'${lf}'|'a${lf}b') + echo "instspc_xfail_tests += $tst-install.test";; + esac +done diff --git a/tests/instspc.test b/tests/instspc.sh old mode 100755 new mode 100644 similarity index 53% rename from tests/instspc.test rename to tests/instspc.sh index 414b3e5..e401262 --- a/tests/instspc.test +++ b/tests/instspc.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 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 @@ -14,7 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Check that installation to directory with shell metacharacters succeed. +# Check that building from, or installing to, directories with shell +# metacharacters succeed. + +# This script is expected to be sourced by specific, individual tests, +# which, before its inclusion, should properly define the variable +# `$weird_chars' and `$action' (this last one to either "build" +# or "install"). + # Original report from James Amundson about file names with spaces. # Other characters added by Paul Eggert. @@ -23,13 +30,70 @@ # file names (Issue observed with ltmain.sh (GNU libtool) 1.5a (1.1323 # 2003/11/10 21:06:47)) +set -e -required='gcc' -. ./defs || Exit 1 +# This file will be sourced by many tests, so avoid cluttering up +# the verbose logs too much. +set +x +echo "INFO: disable shell traces" + +echo "INFO: \$action=$action" +echo "INFO: \$weird_chars='$weird_chars'" + +# Sanity check 1. +if test -z "$weird_chars"; then + echo "$me: FATAL: \$weird_chars unset or empty" + Exit 1 +fi + +# Sanity check 2. +case $action in + "") echo "$me: FATAL: \$action unset or empty"; Exit 1;; + build|install) ;; + *) echo "$me: FATAL: invalid \$action: '$action'"; Exit 1;; +esac + +# Some control characters that are white space. +bs='' # back space +cr=' ' # carriage return +ff='' # form feed +ht=' ' # horizontal tab +lf=' +' # line feed (aka newline) +sp=' ' # space -set -e +# Some other character that might be problematic in makefiles. +dl=\$ # dollar +sq=\' # single quote +sh=\# # sharp + +# Avoid headaches with backslashes into backquotes. +subst_spaces() { + printf '%s' "$*" | sed -e 's/\${sp}/ /g' -e 's/\${lf}/#/g' | tr "#" "$lf" +} -# Set up files that won't change each time through the loop. +# Now we might have to perform some substitutions in the given "weird +# file name". This is necessary, because some "unusual" characters +# can easily wreak havoc in makefiles (see the comments in the script +# `gen-instspc-tests' for more information). +case $weird_chars in + *\#*) + echo "$me: invalid \$weird_chars: '$weird_chars'" >&2; Exit 1;; + '${bs}'|'${cr}'|'${ff}'|'${ht}'|'${lf}'|'${sp}'|'${dl}'|'${sq}'|'${sh}') + eval "weird_chars=$weird_chars";; + *'${sp}'*|*'${lf}'*) + weird_chars=`subst_spaces "$weird_chars"`;; + *\$*) + echo "$me: invalid \$weird_chars: '$weird_chars'" >&2; Exit 1;; +esac + +echo "INFO: enable shell traces" +set -x + +# Skip if this system doesn't support this characters in file names. +mkdir "./$weird_chars" || Exit 77 + +mkdir sub1 cat >> configure.in <<'EOF' AC_PROG_CC @@ -78,6 +142,7 @@ nobase_fooexec_LIBRARIES = sub/libnobase.a sub_libbase_a_SOURCES = source.c sub_libnobase_a_SOURCES = source.c +:PHONY: test-install-sep test-install-sep: install test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.h' test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.h' @@ -100,88 +165,19 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -# Some control characters that are white space: -# back space, carriage return, form feed, horizontal tab, line feed, space -bs='' -cr=' ' -ff='' -ht=' ' -lf=' -' -sp=' ' - -build_failures= -install_failures= - -for file in \ - '!' '"' '#' '$' '%' '&' \' '(' ')' '*' '+' ',' '-' ':' ';' \ - '<' '=' '>' '?' '@' '[' '\' ']' '^' '`' '{' '|' '}' '~' \ - "$bs" "$cr" "$ff" "$ht" "$lf" "$sp" \ - '@<:@' '@:>@' '@S|@' '@%:@' '@&t@' \ - "a${sp}b" "a${sp}${sp}b" "a${lf}b" ... a: -do - for test in build install; do - case $test in - build) - build=$file - dest=`pwd`/sub1;; - install) - build=sub1 - dest=`pwd`/$file;; - esac - - # Make sure this system supports this character in file names. - mkdir sub1 "./$file" || Exit 77 - - cd "$build" - - ../configure --prefix "/$file-prefix" && - $MAKE && - DESTDIR=$dest file=$file $MAKE -e test-install-sep || - eval "${test}_failures=\"\$${test}_failures$lf\$file\"" - - cd .. - - rm -fr sub1 "./$file" - done -done - -# The list of the above file names that cannot be used as a build directory -# on a POSIX host. This list should be empty, but is not due to limitations -# in Autoconf, Automake, Make, M4, or the shell. -expected_build_failures=' -" -# -$ -& -'\'' -\ -` -'"$lf"' -@&t@ -a'"${lf}"'b' - -# Similarly, the list of file names that cannot be used as an install directory -# on a POSIX host. This list should also be empty. -expected_install_failures=' -" -# -$ -'\'' -` -'"$lf"' -a'"${lf}"'b' - -fail=0 -for test in build install; do - eval failures=\$${test}_failures - case $failures in - ?*) - cat >&2 <<EOF -$0: $test test failed for the following file names:$failures -EOF - eval test \"\$failures\" = \"\$expected_${test}_failures\" || fail=1 - esac -done +case $action in + build) + build=$weird_chars + dest=`pwd`/sub1;; + install) + build=sub1 + dest=`pwd`/$weird_chars;; +esac + +cd "./$build" + +../configure --prefix "/$weird_chars-prefix" +$MAKE +DESTDIR="$dest" file="$weird_chars" $MAKE -e test-install-sep -Exit $fail +: -- 1.6.5