A little cleanup patch for the testsuite, both for maint and master. No semantic change here, just a tiny reduction of code duplication.
Attached are the patch for master and the diff of the merge to master. Both changes tested and pushed. Regards, Stefano
diff --git a/ChangeLog b/ChangeLog index 338b567..afeac95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2011-04-12 Stefano Lattarini <stefano.lattar...@gmail.com> + + test defs: define default $distdir (help reducing duplication) + * tests/defs ($distdir): New variable, might be used in + testcases checking distribution-related features. + * tests/pr9.test: Use it. + * tests/subdir9.test: Likewise. + * tests/lex3.test: Likewise. + * tests/lexvpath.test: Likewise. + * tests/remake-moved-m4-file.test: Likewise. + * tests/remake-renamed-m4-file.test: Likewise. + * tests/remake-renamed-m4-macro-and-file.test: Likewise. + * tests/yacc-basic.test: Likewise. + * tests/yacc-d-basic.test: Likewise. + * tests/yacc-d-vpath.test: Likewise. + * tests/yacc-dist-nobuild.test: Likewise. + * tests/vtexi3.test: Add comment explaining why we redefine + $distdir in this test. + 2011-04-11 Stefano Lattarini <stefano.lattar...@gmail.com> depcomp: fix bugs in tests and in the depcomp script diff --git a/tests/defs b/tests/defs index a36f718..f67491a 100644 --- a/tests/defs +++ b/tests/defs @@ -501,6 +501,10 @@ esac ## Set up of the exit trap for cleanup of said directory. ## ## ---------------------------------------------------------------- ## +# This might be used in testcases checking distribution-related features. +# Test scripts are free to override this if they need to. +distdir=$me-1.0 + # The subdirectory where the current test script will run and write its # temporary/data files. This will be created shortly, and will be removed # by the cleanup trap below if the test passes. If the test doesn't pass, diff --git a/tests/lex3.test b/tests/lex3.test index bc88399..f702864 100755 --- a/tests/lex3.test +++ b/tests/lex3.test @@ -26,8 +26,6 @@ required='gcc flex GNUmake' CFLAGS= export CFLAGS -distdir=$me-1.0 - cat >> configure.in << 'END' AC_PROG_CC AM_PROG_LEX diff --git a/tests/lexvpath.test b/tests/lexvpath.test index 876541a..300a476 100755 --- a/tests/lexvpath.test +++ b/tests/lexvpath.test @@ -25,8 +25,6 @@ required='gcc flex' . ./defs || Exit 1 -distdir=$me-1.0 - cat > lexoutroot.in << 'END' LEX_OUTPUT_ROOT='@LEX_OUTPUT_ROOT@' END diff --git a/tests/pr9.test b/tests/pr9.test index 4a9a47e..71a535a 100755 --- a/tests/pr9.test +++ b/tests/pr9.test @@ -46,8 +46,6 @@ $AUTOMAKE -a -c $MAKE $MAKE distcheck -distdir=$me-1.0 - gzip -d $distdir.tar.gz tar tf $distdir.tar | $FGREP support diff --git a/tests/remake-moved-m4-file.test b/tests/remake-moved-m4-file.test index 55b0bce..4af4fdd 100755 --- a/tests/remake-moved-m4-file.test +++ b/tests/remake-moved-m4-file.test @@ -19,8 +19,6 @@ . ./defs || Exit 1 -distdir=$me-1.0 - cat >> configure.in <<'END' MY_MACRO AC_OUTPUT diff --git a/tests/remake-renamed-m4-file.test b/tests/remake-renamed-m4-file.test index b2ebd79..3378fab 100755 --- a/tests/remake-renamed-m4-file.test +++ b/tests/remake-renamed-m4-file.test @@ -18,8 +18,6 @@ . ./defs || Exit 1 -distdir=$me-1.0 - cat >> configure.in <<'END' MY_MACRO AC_OUTPUT diff --git a/tests/remake-renamed-m4-macro-and-file.test b/tests/remake-renamed-m4-macro-and-file.test index 370c1ce..beedb58 100755 --- a/tests/remake-renamed-m4-macro-and-file.test +++ b/tests/remake-renamed-m4-macro-and-file.test @@ -20,8 +20,6 @@ . ./defs || Exit 1 -distdir=$me-1.0 - cat >> configure.in <<'END' MY_MACRO AC_OUTPUT diff --git a/tests/subdir9.test b/tests/subdir9.test index 55e9608..dd7799f 100755 --- a/tests/subdir9.test +++ b/tests/subdir9.test @@ -41,8 +41,6 @@ cat >src/subdir2/Makefile.am <<'EOF' EXTRA_DIST = foo EOF -distdir=$me-1.0 - $ACLOCAL $AUTOCONF $AUTOMAKE --copy --add-missing diff --git a/tests/vtexi3.test b/tests/vtexi3.test index 83e6482..04fb7d7 100755 --- a/tests/vtexi3.test +++ b/tests/vtexi3.test @@ -22,6 +22,8 @@ . ./defs || Exit 1 +# We are going to override package version in AC_INIT, so we need +# to redefine the name of the distdir as well. distdir=$me-7.45.3a # This should work without tex, texinfo or makeinfo diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test index 26dc4a9..351b409 100755 --- a/tests/yacc-basic.test +++ b/tests/yacc-basic.test @@ -19,8 +19,6 @@ required=yacc . ./defs || Exit 1 -distdir=$me-1.0 - cat >> configure.in << 'END' AC_PROG_CC AC_PROG_YACC diff --git a/tests/yacc-d-basic.test b/tests/yacc-d-basic.test index ae60084..015c44c 100755 --- a/tests/yacc-d-basic.test +++ b/tests/yacc-d-basic.test @@ -21,7 +21,6 @@ required=yacc . ./defs || Exit 1 tab=' ' -distdir=$me-1.0 cat >> configure.in << 'END' AC_PROG_CC diff --git a/tests/yacc-d-vpath.test b/tests/yacc-d-vpath.test index b331bf5..401998e 100755 --- a/tests/yacc-d-vpath.test +++ b/tests/yacc-d-vpath.test @@ -25,8 +25,6 @@ required=yacc . ./defs || Exit 1 -distdir=$me-1.0 - cat >> configure.in << 'END' AC_PROG_CC AC_PROG_YACC diff --git a/tests/yacc-dist-nobuild.test b/tests/yacc-dist-nobuild.test index 85a960d..7961a5f 100755 --- a/tests/yacc-dist-nobuild.test +++ b/tests/yacc-dist-nobuild.test @@ -20,8 +20,6 @@ required=yacc . ./defs || Exit 1 -distdir=$me-1.0 - cat >> configure.in << 'END' AC_PROG_CC AC_PROG_YACC
From d66a7c60468a4f098b3248e9a467a278c6c65198 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 12 Apr 2011 16:50:33 +0200 Subject: [PATCH] test defs: define default $distdir (help reducing duplication) * tests/defs.in ($distdir): New variable, might be used in testcases checking distribution-related features. * tests/pr9.test: Use it. * tests/subdir9.test: Likewise. * tests/vtexi3.test: Add comment explaining why we redefine $distdir in this test. --- ChangeLog | 10 ++++++++++ tests/defs.in | 4 ++++ tests/pr9.test | 2 -- tests/subdir9.test | 2 -- tests/vtexi3.test | 2 ++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20862ea..8a144af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-04-12 Stefano Lattarini <stefano.lattar...@gmail.com> + + test defs: define default $distdir (help reducing duplication) + * tests/defs.in ($distdir): New variable, might be used in + testcases checking distribution-related features. + * tests/pr9.test: Use it. + * tests/subdir9.test: Likewise. + * tests/vtexi3.test: Add comment explaining why we redefine + $distdir in this test. + 2011-04-11 Stefano Lattarini <stefano.lattar...@gmail.com> depcomp: fix bugs in tests and in the depcomp script diff --git a/tests/defs.in b/tests/defs.in index 8aaf108..cf07a4e 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -66,6 +66,10 @@ test -f "$srcdir/defs.in" || { me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` +# This might be used in testcases checking distribution-related features. +# Test scripts are free to override this if they need to. +distdir=$me-1.0 + APIVERSION='@APIVERSION@' PATH_SEPARATOR='@PATH_SEPARATOR@' diff --git a/tests/pr9.test b/tests/pr9.test index a2e71d7..1f27f69 100755 --- a/tests/pr9.test +++ b/tests/pr9.test @@ -47,8 +47,6 @@ $AUTOMAKE -a -c $MAKE $MAKE distcheck -distdir=$me-1.0 - gzip -d $distdir.tar.gz tar tf $distdir.tar | $FGREP support diff --git a/tests/subdir9.test b/tests/subdir9.test index c73ca18..403a376 100755 --- a/tests/subdir9.test +++ b/tests/subdir9.test @@ -43,8 +43,6 @@ cat >src/subdir2/Makefile.am <<'EOF' EXTRA_DIST = foo EOF -distdir=$me-1.0 - $ACLOCAL $AUTOCONF $AUTOMAKE --copy --add-missing diff --git a/tests/vtexi3.test b/tests/vtexi3.test index 34f46c5..4b0f45d 100755 --- a/tests/vtexi3.test +++ b/tests/vtexi3.test @@ -24,6 +24,8 @@ set -e +# We are going to override package version in AC_INIT, so we need +# to redefine the name of the distdir as well. distdir=$me-7.45.3a # This should work without tex, texinfo or makeinfo -- 1.7.2.3