This patch fixes potential false negatives in the new tests. Regards, Stefano
-*-*-*- Internationalization tests: do not ignore failures. Some tests used the idiom: test $builddir = '.' || test ! -f posub/foo-bar.pot to check that a file is build in the source directory, not in the build directory. But even when the `errexit' shell flag is active, the above does not abort the script even if the file `posub/foo-bar.pot' exists, since the failing `test' is in a `||' compound command. Fix this problem by explicitly calling `Exit 1' where needed. The tests have been fixed by the following sed command: $ sed -i 's/ || test ! -f [^ ]*/& || Exit 1/' tests/pot-*.test * tests/pot-copyright.test: Fixed. * tests/pot-format-csharp1.test: Likewise. * tests/pot-format-java1.test: Likewise. * tests/pot-format-java2.test: Likewise. * tests/pot-format-qt1.test: Likewise. * tests/pot-format-tcl1.test: Likewise. * tests/pot-linguas.test: Likewise. * tests/pot-msgidbugs.test: Likewise. * tests/pot-no-linguas.test: Likewise. * tests/pot-noinst.test: Likewise. * tests/pot-override1.test: Likewise. * tests/pot-samedir.test: Likewise. * tests/pot-topsrcdir.test: Likewise. * tests/pot-xgettext1.test: Likewise. * tests/pot-xgettext2.test: Likewise. * tests/pot-xgettext3.test: Likewise. * tests/pot-xgettext4.test: Likewise.
From 790585e13605b005a43e61e8bba18db34dfbf4e8 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Mon, 6 Sep 2010 17:02:36 +0200 Subject: [PATCH] Internationalization tests: do not ignore failures. Some tests used the idiom: test $builddir = '.' || test ! -f posub/foo-bar.pot to check that a file is build in the source directory, not in the build directory. But even when the `errexit' shell flag is active, the above does not abort the script even if the file `posub/foo-bar.pot' exists, since the failing `test' is in a `||' compound command. Fix this problem by explicitly calling `Exit 1' where needed. * tests/pot-copyright.test: Fixed. * tests/pot-format-csharp1.test: Likewise. * tests/pot-format-java1.test: Likewise. * tests/pot-format-java2.test: Likewise. * tests/pot-format-qt1.test: Likewise. * tests/pot-format-tcl1.test: Likewise. * tests/pot-linguas.test: Likewise. * tests/pot-msgidbugs.test: Likewise. * tests/pot-no-linguas.test: Likewise. * tests/pot-noinst.test: Likewise. * tests/pot-override1.test: Likewise. * tests/pot-samedir.test: Likewise. * tests/pot-topsrcdir.test: Likewise. * tests/pot-xgettext1.test: Likewise. * tests/pot-xgettext2.test: Likewise. * tests/pot-xgettext3.test: Likewise. * tests/pot-xgettext4.test: Likewise. --- ChangeLog | 28 ++++++++++++++++++++++++++++ tests/pot-copyright.test | 2 +- tests/pot-format-csharp1.test | 4 ++-- tests/pot-format-java1.test | 4 ++-- tests/pot-format-java2.test | 4 ++-- tests/pot-format-qt1.test | 4 ++-- tests/pot-format-tcl1.test | 4 ++-- tests/pot-linguas.test | 4 ++-- tests/pot-msgidbugs.test | 4 ++-- tests/pot-no-linguas.test | 4 ++-- tests/pot-noinst.test | 2 +- tests/pot-override1.test | 4 ++-- tests/pot-samedir.test | 4 ++-- tests/pot-topsrcdir.test | 4 ++-- tests/pot-xgettext1.test | 2 +- tests/pot-xgettext2.test | 2 +- tests/pot-xgettext3.test | 2 +- tests/pot-xgettext4.test | 2 +- 18 files changed, 56 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bac14e..8f00345 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,33 @@ 2010-09-06 Stefano Lattarini <stefano.lattar...@gmail.com> + Internationalization tests: do not ignore failures. + Some tests used the idiom: + test $builddir = '.' || test ! -f posub/foo-bar.pot + to check that a file is build in the source directory, not in + the build directory. But even when the `errexit' shell flag + is active, the above does not abort the script even if the file + `posub/foo-bar.pot' exists, since the failing `test' is in a + `||' compound command. Fix this problem by explicitly calling + `Exit 1' where needed. + * tests/pot-copyright.test: Fixed. + * tests/pot-format-csharp1.test: Likewise. + * tests/pot-format-java1.test: Likewise. + * tests/pot-format-java2.test: Likewise. + * tests/pot-format-qt1.test: Likewise. + * tests/pot-format-tcl1.test: Likewise. + * tests/pot-linguas.test: Likewise. + * tests/pot-msgidbugs.test: Likewise. + * tests/pot-no-linguas.test: Likewise. + * tests/pot-noinst.test: Likewise. + * tests/pot-override1.test: Likewise. + * tests/pot-samedir.test: Likewise. + * tests/pot-topsrcdir.test: Likewise. + * tests/pot-xgettext1.test: Likewise. + * tests/pot-xgettext2.test: Likewise. + * tests/pot-xgettext3.test: Likewise. + * tests/pot-xgettext4.test: Likewise. + + Internationalization tests: prefer `make distdir' over `make dist'. Instead of running `make dist', then uncompressing the created tarball, and then grepping the uncompressed tar archive, we can diff --git a/tests/pot-copyright.test b/tests/pot-copyright.test index fb11367..437026e 100755 --- a/tests/pot-copyright.test +++ b/tests/pot-copyright.test @@ -91,7 +91,7 @@ for builddir in . sub; do $MAKE dist test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 cat $sourcedir/posub/foo-bar.pot | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-format-csharp1.test b/tests/pot-format-csharp1.test index 7e85c4d..6db7577 100755 --- a/tests/pot-format-csharp1.test +++ b/tests/pot-format-csharp1.test @@ -136,7 +136,7 @@ for builddir in . sub; do $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -175,7 +175,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-format-java1.test b/tests/pot-format-java1.test index c5fdfd4..6e6a438 100755 --- a/tests/pot-format-java1.test +++ b/tests/pot-format-java1.test @@ -137,7 +137,7 @@ for builddir in . sub; do $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -176,7 +176,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-format-java2.test b/tests/pot-format-java2.test index 644bc47..d604eb3 100755 --- a/tests/pot-format-java2.test +++ b/tests/pot-format-java2.test @@ -137,7 +137,7 @@ for builddir in . sub; do $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -176,7 +176,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-format-qt1.test b/tests/pot-format-qt1.test index c88f6cd..fcd76d0 100755 --- a/tests/pot-format-qt1.test +++ b/tests/pot-format-qt1.test @@ -162,7 +162,7 @@ for builddir in . sub; do $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -199,7 +199,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-format-tcl1.test b/tests/pot-format-tcl1.test index ab3d5ae..048560a 100755 --- a/tests/pot-format-tcl1.test +++ b/tests/pot-format-tcl1.test @@ -132,7 +132,7 @@ for builddir in . sub; do $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -171,7 +171,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-linguas.test b/tests/pot-linguas.test index 595c095..aaefb66 100755 --- a/tests/pot-linguas.test +++ b/tests/pot-linguas.test @@ -152,7 +152,7 @@ END $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -181,7 +181,7 @@ END $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-msgidbugs.test b/tests/pot-msgidbugs.test index aba3df2..d636ef0 100755 --- a/tests/pot-msgidbugs.test +++ b/tests/pot-msgidbugs.test @@ -94,7 +94,7 @@ for builddir in . sub1; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 cat $sourcedir/posub/foo-bar.pot | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -157,7 +157,7 @@ for builddir in . sub2; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-no-linguas.test b/tests/pot-no-linguas.test index 4f34264..c2b4cfd 100755 --- a/tests/pot-no-linguas.test +++ b/tests/pot-no-linguas.test @@ -120,7 +120,7 @@ END $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -132,7 +132,7 @@ END $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-noinst.test b/tests/pot-noinst.test index 70fb831..e05c9d5 100755 --- a/tests/pot-noinst.test +++ b/tests/pot-noinst.test @@ -163,7 +163,7 @@ END $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-override1.test b/tests/pot-override1.test index e2e4a77..0d74962 100755 --- a/tests/pot-override1.test +++ b/tests/pot-override1.test @@ -97,7 +97,7 @@ END $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 diff $sourcedir/posub/foo-bar.pot $sourcedir/expected rm -f $sourcedir/posub/foo-bar.pot @@ -107,7 +107,7 @@ END $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 diff $sourcedir/posub/foo-bar.pot $sourcedir/expected # Try modifying a source file. diff --git a/tests/pot-samedir.test b/tests/pot-samedir.test index ccdd41d..f070c28 100755 --- a/tests/pot-samedir.test +++ b/tests/pot-samedir.test @@ -168,13 +168,13 @@ for builddir in . sub; do $MAKE install test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected1 rm -f actual test -f $sourcedir/posub/foo-baz.pot - test $builddir = '.' || test ! -f posub/foo-baz.pot + test $builddir = '.' || test ! -f posub/foo-baz.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-baz.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected2 rm -f actual diff --git a/tests/pot-topsrcdir.test b/tests/pot-topsrcdir.test index 3745f3e..24837dc 100755 --- a/tests/pot-topsrcdir.test +++ b/tests/pot-topsrcdir.test @@ -149,7 +149,7 @@ END $MAKE install test -f $sourcedir/foo-bar.pot - test $builddir = '.' || test ! -f foo-bar.pot + test $builddir = '.' || test ! -f foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual @@ -178,7 +178,7 @@ END $MAKE distdir test -f $sourcedir/foo-bar.pot - test $builddir = '.' || test ! -f foo-bar.pot + test $builddir = '.' || test ! -f foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-xgettext1.test b/tests/pot-xgettext1.test index d018fa7..704657a 100755 --- a/tests/pot-xgettext1.test +++ b/tests/pot-xgettext1.test @@ -91,7 +91,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-xgettext2.test b/tests/pot-xgettext2.test index 0bd2407..c4006e4 100755 --- a/tests/pot-xgettext2.test +++ b/tests/pot-xgettext2.test @@ -91,7 +91,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-xgettext3.test b/tests/pot-xgettext3.test index ef5ad8b..9be72ef 100755 --- a/tests/pot-xgettext3.test +++ b/tests/pot-xgettext3.test @@ -106,7 +106,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/posub/foo-bar.pot - test $builddir = '.' || test ! -f posub/foo-bar.pot + test $builddir = '.' || test ! -f posub/foo-bar.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual diff --git a/tests/pot-xgettext4.test b/tests/pot-xgettext4.test index 61b59de..545c53d 100755 --- a/tests/pot-xgettext4.test +++ b/tests/pot-xgettext4.test @@ -101,7 +101,7 @@ for builddir in . sub; do $MAKE distdir test -f $sourcedir/maude.pot - test $builddir = '.' || test ! -f maude.pot + test $builddir = '.' || test ! -f maude.pot || Exit 1 grep -v 'POT-Creation-Date' $sourcedir/maude.pot | LC_ALL=C tr -d '\r' > actual diff actual $sourcedir/expected rm -f actual -- 1.7.1