Tests defs: new subroutine `skip' for test skipping. * tests/defs.in (skip): New subroutine, causing the running test script to be SKIP'd, possibly with a meaningful message. Use it throughout. * tests/REAMDE: Updated. * tests/color.test: Use the new `skip' subroutine. * tests/color2.test: Likewise. * tests/compile2.test: Likewise. * tests/defs.in: Likewise. * tests/dejagnu7.test: Likewise. * tests/distlinks.test: Likewise. * tests/distlinksbrk.test: Likewise. * tests/fn99.test: Likewise. * tests/fn99subdir.test: Likewise. * tests/forcemiss2.test: Likewise. * tests/fort5.test: Likewise. * tests/gettext3.test: Likewise. * tests/install2.test: Likewise. * tests/instfail-info.test: Likewise. * tests/instfail-java.test: Likewise. * tests/instfail-libtool.test: Likewise. * tests/instfail.test: Likewise. * tests/instmany-mans.test: Likewise. * tests/instmany-python.test: Likewise. * tests/instmany.test: Likewise. * tests/instsh3.test: Likewise. * tests/makej2.test: Likewise. * tests/mkinst3.test: Likewise. * tests/parallel-tests3.test: Likewise. * tests/subobj9.test: Likewise. * tests/symlink2.test: Likewise. * tests/tar.test: Likewise. * tests/tar2.test: Likewise. * tests/txinfo26.test: Likewise. * tests/vala2.test: Likewise. * tests/vala3.test: Likewise. * tests/vala5.test: Likewise. * tests/instdir-texi.test: Likewise, plus some other minor improvements. * tests/txinfo21.test: Likewise. --- ChangeLog | 41 ++++++++++++++++++++++++++++++++++++ tests/README | 2 + tests/color.test | 2 +- tests/color2.test | 8 ++---- tests/compile2.test | 9 ++++++- tests/defs | 48 +++++++++++++++++++++--------------------- tests/dejagnu7.test | 2 +- tests/distlinks.test | 5 +--- tests/distlinksbrk.test | 5 +--- tests/fn99.test | 14 ++++-------- tests/fn99subdir.test | 14 ++++-------- tests/forcemiss2.test | 5 +--- tests/fort5.test | 4 +- tests/gettext3.test | 4 +- tests/install2.test | 2 +- tests/instdir-texi.test | 9 +++---- tests/instfail-info.test | 4 +- tests/instfail-java.test | 4 +- tests/instfail-libtool.test | 4 +- tests/instfail.test | 4 +- tests/instmany-mans.test | 2 +- tests/instmany-python.test | 2 +- tests/instmany.test | 2 +- tests/instsh3.test | 5 ++- tests/makej2.test | 4 +- tests/mkinst3.test | 4 +- tests/parallel-tests3.test | 3 +- tests/subobj9.test | 2 +- tests/symlink2.test | 5 +--- tests/tar.test | 4 +- tests/tar2.test | 4 +- tests/txinfo21.test | 8 +++--- tests/txinfo26.test | 6 ++-- tests/vala2.test | 6 ++-- tests/vala3.test | 8 +++--- tests/vala5.test | 6 ++-- 36 files changed, 143 insertions(+), 118 deletions(-)
From c7e40c4b723dd848e5956a5975c9c147fe0be42a Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Thu, 3 Jun 2010 00:30:03 +0200 Subject: [PATCH 2/5] Tests defs: new subroutine `skip' for test skipping.
* tests/defs.in (skip): New subroutine, causing the running test script to be SKIP'd, possibly with a meaningful message. Use it throughout. * tests/REAMDE: Updated. * tests/color.test: Use the new `skip' subroutine. * tests/color2.test: Likewise. * tests/compile2.test: Likewise. * tests/defs.in: Likewise. * tests/dejagnu7.test: Likewise. * tests/distlinks.test: Likewise. * tests/distlinksbrk.test: Likewise. * tests/fn99.test: Likewise. * tests/fn99subdir.test: Likewise. * tests/forcemiss2.test: Likewise. * tests/fort5.test: Likewise. * tests/gettext3.test: Likewise. * tests/install2.test: Likewise. * tests/instfail-info.test: Likewise. * tests/instfail-java.test: Likewise. * tests/instfail-libtool.test: Likewise. * tests/instfail.test: Likewise. * tests/instmany-mans.test: Likewise. * tests/instmany-python.test: Likewise. * tests/instmany.test: Likewise. * tests/instsh3.test: Likewise. * tests/makej2.test: Likewise. * tests/mkinst3.test: Likewise. * tests/parallel-tests3.test: Likewise. * tests/subobj9.test: Likewise. * tests/symlink2.test: Likewise. * tests/tar.test: Likewise. * tests/tar2.test: Likewise. * tests/txinfo26.test: Likewise. * tests/vala2.test: Likewise. * tests/vala3.test: Likewise. * tests/vala5.test: Likewise. * tests/instdir-texi.test: Likewise, plus some other minor improvements. * tests/txinfo21.test: Likewise. --- ChangeLog | 41 ++++++++++++++++++++++++++++++++++++ tests/README | 2 + tests/color.test | 2 +- tests/color2.test | 8 ++---- tests/compile2.test | 9 ++++++- tests/defs | 48 +++++++++++++++++++++--------------------- tests/dejagnu7.test | 2 +- tests/distlinks.test | 5 +--- tests/distlinksbrk.test | 5 +--- tests/fn99.test | 14 ++++-------- tests/fn99subdir.test | 14 ++++-------- tests/forcemiss2.test | 5 +--- tests/fort5.test | 4 +- tests/gettext3.test | 4 +- tests/install2.test | 2 +- tests/instdir-texi.test | 9 +++---- tests/instfail-info.test | 4 +- tests/instfail-java.test | 4 +- tests/instfail-libtool.test | 4 +- tests/instfail.test | 4 +- tests/instmany-mans.test | 2 +- tests/instmany-python.test | 2 +- tests/instmany.test | 2 +- tests/instsh3.test | 5 ++- tests/makej2.test | 4 +- tests/mkinst3.test | 4 +- tests/parallel-tests3.test | 3 +- tests/subobj9.test | 2 +- tests/symlink2.test | 5 +--- tests/tar.test | 4 +- tests/tar2.test | 4 +- tests/txinfo21.test | 8 +++--- tests/txinfo26.test | 6 ++-- tests/vala2.test | 6 ++-- tests/vala3.test | 8 +++--- tests/vala5.test | 6 ++-- 36 files changed, 143 insertions(+), 118 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c5bf41..b23ddc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,46 @@ 2010-11-12 Stefano Lattarini <stefano.lattar...@gmail.com> + Tests defs: new subroutine `skip' for test skipping. + * tests/defs.in (skip): New subroutine, causing the running + test script to be SKIP'd, possibly with a meaningful message. + Use it throughout. + * tests/REAMDE: Updated. + * tests/color.test: Use the new `skip' subroutine. + * tests/color2.test: Likewise. + * tests/compile2.test: Likewise. + * tests/defs.in: Likewise. + * tests/dejagnu7.test: Likewise. + * tests/distlinks.test: Likewise. + * tests/distlinksbrk.test: Likewise. + * tests/fn99.test: Likewise. + * tests/fn99subdir.test: Likewise. + * tests/forcemiss2.test: Likewise. + * tests/fort5.test: Likewise. + * tests/gettext3.test: Likewise. + * tests/install2.test: Likewise. + * tests/instfail-info.test: Likewise. + * tests/instfail-java.test: Likewise. + * tests/instfail-libtool.test: Likewise. + * tests/instfail.test: Likewise. + * tests/instmany-mans.test: Likewise. + * tests/instmany-python.test: Likewise. + * tests/instmany.test: Likewise. + * tests/instsh3.test: Likewise. + * tests/makej2.test: Likewise. + * tests/mkinst3.test: Likewise. + * tests/parallel-tests3.test: Likewise. + * tests/subobj9.test: Likewise. + * tests/symlink2.test: Likewise. + * tests/tar.test: Likewise. + * tests/tar2.test: Likewise. + * tests/txinfo26.test: Likewise. + * tests/vala2.test: Likewise. + * tests/vala3.test: Likewise. + * tests/vala5.test: Likewise. + * tests/instdir-texi.test: Likewise, plus some other minor + improvements. + * tests/txinfo21.test: Likewise. + Tests defs: don't let useless variables leak in test scripts. * tests/defs ($priv_check_temp, $overwrite_status, $ro_dir_temp, $create_status, $r2h, $libtool_found, $gettext_found, $aclocaldir, diff --git a/tests/README b/tests/README index 88da783..ec8769d 100644 --- a/tests/README +++ b/tests/README @@ -118,6 +118,8 @@ Do Include ./defs in every test script (see existing tests for examples of how to do this). + Use the `skip' function to skip tests. + 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 diff --git a/tests/color.test b/tests/color.test index 9d86785..248f986 100755 --- a/tests/color.test +++ b/tests/color.test @@ -35,7 +35,7 @@ std='[m' # GNU or BSD 'grep -a' works on files, but is not portable. case `echo "$std" | grep .` in $std) ;; - *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;; + *) skip "grep can't parse nonprinting characters";; esac cat >>configure.in <<END diff --git a/tests/color2.test b/tests/color2.test index eedd37d..ac727bb 100755 --- a/tests/color2.test +++ b/tests/color2.test @@ -35,7 +35,7 @@ std='[m' # GNU or BSD 'grep -a' works on files, but is not portable. case `echo "$std" | grep .` in $std) ;; - *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;; + *) skip "grep can't parse nonprinting characters";; esac # Check that we have a working expect program. @@ -44,10 +44,8 @@ cat >expect-check <<'END' spawn $env(THE_SYSTEM_SHELL) -c : expect eof END -THE_SYSTEM_SHELL=/bin/sh expect -f expect-check || { - echo "$me: failed to find a working expect program" >&2 - Exit 77 -} +THE_SYSTEM_SHELL=/bin/sh expect -f expect-check \ + || skip "$me: failed to find a working expect program" # Do the tests. diff --git a/tests/compile2.test b/tests/compile2.test index 2f812c5..b929b57 100755 --- a/tests/compile2.test +++ b/tests/compile2.test @@ -65,8 +65,13 @@ test -f "$amtest_object" # Absolute w32 paths should be accepted. # Do not actually run this test on anything that could be w32. -test -d "C:\\" && Exit 77 -case $PATH_SEPARATOR in ';'|':');; *) Exit 77;; esac +if test -d "C:\\"; then + skip "this test shouldn't be run on a win32-like system" +fi +case $PATH_SEPARATOR in + ';'|':');; + *) skip "unrecognized PATH separator \`$PATH_SEPARATOR'" +esac amtest_source='C:\libltdl\libltdl\slist.c' amtest_object='C:\libltdl\libltdl\libltdl_libltdl_la-slist.obj' diff --git a/tests/defs b/tests/defs index e5f54ba..65f08b3 100644 --- a/tests/defs +++ b/tests/defs @@ -93,6 +93,17 @@ Exit () exit $1 } +# skip [messages...] +# ------------------ +# Cause the running test script to be SKIP'd, possibly with a meaningful +# message. The stderr redirection is there to remove useless shell traces. +skip() +{ + (test $# -eq 0 || echo "$me: SKIP: $*") 2>/dev/null + Exit 77 +} + + # is_newest FILE FILES # -------------------- # Return false if any file in FILES is newer than FILE. @@ -230,15 +241,13 @@ do overwrite_status=$? rm -f $priv_check_temp if test $overwrite_status -eq 0; then - echo "$me: cannot drop file write permissions" >&2 - exit 77 + skip "cannot drop file write permissions" >&2 fi unset priv_check_temp overwrite_status ;; perl-threads) if test "$WANT_NO_THREADS" = "yes"; then - echo "$me: skip with Devel::Cover: cannot cope with threads" >&2 - exit 77 + skip "Devel::Cover cannot cope with threads" >&2 fi ;; python) @@ -256,8 +265,7 @@ do create_status=$? rm -rf $ro_dir_temp if test $create_status -eq 0; then - echo "$me: cannot drop directory write permissions" >&2 - exit 77 + skip "cannot drop directory write permissions" >&2 fi unset ro_dir_temp create_status ;; @@ -268,8 +276,7 @@ do echo "$me: running $r2h --version" $r2h --version && break 2 done - echo "$me: no proper rst2html program found" >&2 - exit 77 + skip "no proper rst2html program found" >&2 done unset r2h ;; @@ -284,8 +291,7 @@ do # No all versions of Tex support `--version', so we use # a configure check. if test -z "$TEX"; then - echo "$me: TeX is required, but it wasn't found by configure" >&2 - exit 77 + skip "TeX is required, but it wasn't found by configure" >&2 fi ;; texi2dvi-o) @@ -308,10 +314,8 @@ case $testbuilddir in *\ *|*\ *) case " $required " in *' libtool '* | *' libtoolize '* ) - echo "$me: libtool/libtoolized cannot cope correctly" >&2 - echo "$me: with spaces in the build tree" >&2 - exit 77 - ;; + skip "libtool and libtoolize cannot cope correctly" \ + "with spaces in the build tree";; esac ;; esac @@ -324,10 +328,8 @@ case $testsrcdir in *\ * |*\ *) case " $required " in *' libtool '* | *' libtoolize '* | *' gettext '* ) - echo "$me: our testsuite setup cannot cope correctly with spaces" >&2 - echo "$me: in the source tree for libtool/gettext tests" >&2 - exit 77 - ;; + skip "our testsuite setup cannot cope with spaces in the" \ + "source tree name for libtool/gettext tests.";; esac ;; esac @@ -364,16 +366,14 @@ case " $required " in case " $required " in *' libtool '*|*' libtoolize '*) if test $libtool_found != yes; then - echo "$me: libtool/libtoolize is required, but libtool.m4 wasn't" >&2 - echo "$me: found in directories $aclocaldir $extra_includes" >&2 - exit 77 + skip "libtool is required, but libtool.m4 wasn't found in" \ + "directories $aclocaldir $extra_includes" fi ;; *' gettext '*) if test $gettext_found != yes; then - echo "$me: gettext is required, but gettext.m4 wasn't found" >&2 - echo "$me: in directories $aclocaldir $extra_includes" >&2 - exit 77 + skip "gettext is required, but gettext.m4 wasn't found in" \ + "directories $aclocaldir $extra_includes" fi ;; esac diff --git a/tests/dejagnu7.test b/tests/dejagnu7.test index 552c2ca..4d66491 100755 --- a/tests/dejagnu7.test +++ b/tests/dejagnu7.test @@ -23,7 +23,7 @@ required=runtest set -e # Check whether DejaGnu supports --status -runtest --help | grep '.*--status' || Exit 77 +runtest --help | grep '.*--status' || skip "dejagnu lacks --status support" cat > failtcl << 'END' #! /bin/sh diff --git a/tests/distlinks.test b/tests/distlinks.test index 268cfcb..b05dbf6 100755 --- a/tests/distlinks.test +++ b/tests/distlinks.test @@ -23,10 +23,7 @@ set -e echo text > file -ln -s file lnk || { - echo "$me: cannot create symlinks to files" >&2 - Exit 77 -} +ln -s file lnk || skip "cannot create symlinks to files" mkdir A mkdir B diff --git a/tests/distlinksbrk.test b/tests/distlinksbrk.test index 1e478ab..6a1d130 100755 --- a/tests/distlinksbrk.test +++ b/tests/distlinksbrk.test @@ -29,10 +29,7 @@ lnk2=${lnk_base}__002 lnka=${lnk_base}__aaa lnkb=${lnk_base}__bbb -ln -s nonesuch $lnk1 || { - echo "$me: cannot create broken symlinks" >&2 - Exit 77 -} +ln -s nonesuch $lnk1 || skip "cannot create broken symlinks" ln -s "`pwd`/nonesuch" $lnk2 diff --git a/tests/fn99.test b/tests/fn99.test index 982a989..1a7bc94 100755 --- a/tests/fn99.test +++ b/tests/fn99.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2008, 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 @@ -29,10 +29,8 @@ END (for i in 1 2 3 4 5 6 7 8 9 do - mkdir -p 12345678 || Exit 77 - cd 12345678 - touch x -done) || Exit 77 + mkdir -p 12345678 && cd 12345678 && touch x || Exit 1 +done) || skip "creation of long nested dirs chain failed" $ACLOCAL $AUTOCONF @@ -42,10 +40,8 @@ $MAKE distcheck (for i in 1 2 3 4 5 6 7 8 9 10 11 do - mkdir -p 12345678 || Exit 77 - cd 12345678 - touch x -done) || Exit 77 + mkdir -p 12345678 && cd 12345678 && touch x || Exit 1 +done) || skip "creation of longer nested dirs chain failed" $MAKE dist 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 diff --git a/tests/fn99subdir.test b/tests/fn99subdir.test index 465f2af..8b09e4a 100755 --- a/tests/fn99subdir.test +++ b/tests/fn99subdir.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 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 @@ -50,10 +50,8 @@ END (cd ${subdirname}; for i in 1 2 3 4 5 6 7 8 do - mkdir -p 12345678 || Exit 77 - cd 12345678 - touch x -done) + mkdir -p 12345678 && cd 12345678 && touch x || Exit 1 +done) || skip "creation of long nested dirs chain failed" for init_dir in ${subdirname} .; do ( @@ -68,10 +66,8 @@ $MAKE distcheck (cd ${subdirname}; for i in 1 2 3 4 5 6 7 8 9 do - mkdir -p 12345678 || Exit 77 - cd 12345678 - touch x -done) + mkdir -p 12345678 && cd 12345678 && touch x || Exit 1 +done) || skip "creation of longer nested dirs chain failed" $MAKE dist 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 diff --git a/tests/forcemiss2.test b/tests/forcemiss2.test index 408ea8a..8dc073c 100755 --- a/tests/forcemiss2.test +++ b/tests/forcemiss2.test @@ -26,10 +26,7 @@ rm -f install-sh echo zot > foo cp foo foo2 -ln -s foo2 install-sh || { - echo "$me: cannot create symlinks to files" >&2 - Exit 77 -} +ln -s foo2 install-sh || skip "cannot create symlinks to files" : > Makefile.am diff --git a/tests/fort5.test b/tests/fort5.test index cd2a7d5..d1c86ef 100755 --- a/tests/fort5.test +++ b/tests/fort5.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006, 2009 Free Software Foundation, Inc. +# Copyright (C) 2006, 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 @@ -82,7 +82,7 @@ $AUTOCONF # This test requires Libtool >= 2.0. Earlier Libtool does not # have the LT_PREREQ macro to cause autoconf failure, so let's # skip in this case: -grep LT_PREREQ configure && Exit 77 +grep LT_PREREQ configure && skip "libtool is too old (probably < 2.0)" # Ensure we use --tag for f90, too. grep " --tag=FC" Makefile.in diff --git a/tests/gettext3.test b/tests/gettext3.test index a25af87..c193f4e 100755 --- a/tests/gettext3.test +++ b/tests/gettext3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 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 @@ -32,7 +32,7 @@ mkdir po # if aclocal fails, assume the gettext macros are too old and do not # define AM_GNU_GETTEXT_INTL_SUBDIR. -$ACLOCAL || Exit 77 +$ACLOCAL || skip "your gettext macros are probably too old" # config.rpath is required. : >config.rpath diff --git a/tests/install2.test b/tests/install2.test index 3cc71f5..da19316 100755 --- a/tests/install2.test +++ b/tests/install2.test @@ -41,7 +41,7 @@ $AUTOMAKE -a chmod 000 Makefile.am # On some systems (like DOS and Windows), files are always readable. -test ! -r Makefile.am || Exit 77 +test ! -r Makefile.am || skip "files are always readable on your system" ./configure diff --git a/tests/instdir-texi.test b/tests/instdir-texi.test index 50617c8..9a91499 100755 --- a/tests/instdir-texi.test +++ b/tests/instdir-texi.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,12 +17,11 @@ # If $(infodir) is the empty string, then nothing should be installed there. # Likewise for the other install-* targets used for texinfo files. -required='makeinfo-html tex texi2dvi' +required='makeinfo-html tex texi2dvi dvips' . ./defs || Exit 1 -(dvips --help 2>/dev/null >/dev/null) || Exit 77 -(pdfetex --help 2>/dev/null >/dev/null) || - (pdftex --help 2>/dev/null >/dev/null) || Exit 77 +dvips --help || skip "dvips is missing" +pdfetex --version || pdftex --version || skip "pdeftex and pdftex both missing" set -e diff --git a/tests/instfail-info.test b/tests/instfail-info.test index 70d4657..f7b6ffa 100755 --- a/tests/instfail-info.test +++ b/tests/instfail-info.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 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 @@ -57,7 +57,7 @@ $MAKE uninstall for file in info1.info do chmod a-r $file - test ! -r $file || Exit 77 + test ! -r $file || skip "cannot make files unreadable" $MAKE install-data && Exit 1 chmod u+r $file done diff --git a/tests/instfail-java.test b/tests/instfail-java.test index 2cb8afb..3e33f9e 100755 --- a/tests/instfail-java.test +++ b/tests/instfail-java.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 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 @@ -56,7 +56,7 @@ $MAKE uninstall for file in java1.class do chmod a-r $file - test ! -r $file || Exit 77 + test ! -r $file || skip "cannot make files unreadable" $MAKE install-data && Exit 1 chmod u+r $file done diff --git a/tests/instfail-libtool.test b/tests/instfail-libtool.test index 1e756a6..ff4a1b0 100755 --- a/tests/instfail-libtool.test +++ b/tests/instfail-libtool.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 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 @@ -66,7 +66,7 @@ $MAKE uninstall for file in liblt1.la libltn1.la do chmod a-r $file - test ! -r $file || Exit 77 + test ! -r $file || skip "cannot make files unreadable" $MAKE install-exec && Exit 1 chmod u+r $file done diff --git a/tests/instfail.test b/tests/instfail.test index 38a1c9c..67290b6 100755 --- a/tests/instfail.test +++ b/tests/instfail.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 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 @@ -70,7 +70,7 @@ $MAKE uninstall for file in lib1.a libn1.a do chmod a-r $file - test ! -r $file || Exit 77 + test ! -r $file || skip "cannot make files unreadable" $MAKE install-exec && Exit 1 chmod u+r $file done diff --git a/tests/instmany-mans.test b/tests/instmany-mans.test index fe55be4..52ad755 100755 --- a/tests/instmany-mans.test +++ b/tests/instmany-mans.test @@ -136,7 +136,7 @@ srcdir=../../$subdir for file in page3.1 page$nfiles.1 npage3.1 npage$nfiles.1; do chmod a-r $srcdir/$file - test ! -r $srcdir/$file || Exit 77 + test ! -r $srcdir/$file || skip "cannot make files unreadable" $MAKE install-man1 && Exit 1 chmod u+r $srcdir/$file done diff --git a/tests/instmany-python.test b/tests/instmany-python.test index 7648e1b..f14ffcc 100755 --- a/tests/instmany-python.test +++ b/tests/instmany-python.test @@ -123,7 +123,7 @@ srcdir=../../$subdir for file in python3.py python$nfiles.py do chmod a-r $srcdir/$file - test ! -r $srcdir/$file || Exit 77 + test ! -r $srcdir/$file || skip "cannot make files unreadable" $MAKE install && Exit 1 chmod u+r $srcdir/$file done diff --git a/tests/instmany.test b/tests/instmany.test index 2de026d..8ec8b4f 100755 --- a/tests/instmany.test +++ b/tests/instmany.test @@ -151,7 +151,7 @@ srcdir=../../$subdir for file in script3 script$nfiles do chmod a-r $srcdir/$file - test ! -r $srcdir/$file || Exit 77 + test ! -r $srcdir/$file || skip "cannot make files unreadable" $MAKE install-binSCRIPTS && Exit 1 chmod u+r $srcdir/$file done diff --git a/tests/instsh3.test b/tests/instsh3.test index b7b8761..4fa4316 100755 --- a/tests/instsh3.test +++ b/tests/instsh3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 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,10 +18,11 @@ required=non-root . ./defs || Exit 1 + set -e # Solaris /usr/ucb/touch does not accept -t. -touch -t $old_timestamp foo || Exit 77 +touch -t $old_timestamp foo || "touch utility doesn't accept '-t' option" ./install-sh -d d1 diff --git a/tests/makej2.test b/tests/makej2.test index e702999..b38f173 100755 --- a/tests/makej2.test +++ b/tests/makej2.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 @@ -39,7 +39,7 @@ mkdir build cd build ../configure "--prefix=`pwd`/inst" -$MAKE -j2 || Exit 77 +$MAKE -j2 || skip "$MAKE failed to run with two parallel jobs" $MAKE -j2 distcheck $MAKE test-distdir-removed diff --git a/tests/mkinst3.test b/tests/mkinst3.test index da999d3..32893f4 100755 --- a/tests/mkinst3.test +++ b/tests/mkinst3.test @@ -21,8 +21,8 @@ set -e # Make sure the directory we will create can be created... -mkdir '~a b' || Exit 77 -mkdir '~a b/-x y' || Exit 77 +mkdir '~a b' && mkdir '~a b/-x y' \ + || skip "cannot create directories with funny names" rm -rf '~a b' cp "$top_testsrcdir/lib/mkinstalldirs" . diff --git a/tests/parallel-tests3.test b/tests/parallel-tests3.test index a138f90..08ecab7 100755 --- a/tests/parallel-tests3.test +++ b/tests/parallel-tests3.test @@ -21,9 +21,8 @@ parallel_tests=yes required=GNUmake . ./defs || Exit 1 -# This test does not work well if $MAKE contains -j. case $MAKE in -*\ -j*) Exit 77 ;; + *\ -j*) skip "this test does not work well if \$MAKE contains \`-j'";; esac set -e diff --git a/tests/subobj9.test b/tests/subobj9.test index 2045d58..ebed8b9 100755 --- a/tests/subobj9.test +++ b/tests/subobj9.test @@ -62,7 +62,7 @@ $AUTOCONF $AUTOMAKE -a # Skip this test on configure errors (e.g., broken C++ compilers). -./configure || Exit 77 +./configure || skip "configure failure" # Opportunistically check that --tag=CXX is used when supported. if ./libtool --help | grep tag=TAG; then diff --git a/tests/symlink2.test b/tests/symlink2.test index 97a3d26..2827844 100755 --- a/tests/symlink2.test +++ b/tests/symlink2.test @@ -21,10 +21,7 @@ set -e rm -f install-sh -ln -s Zardoz install-sh || { - echo "$me: cannot create broken symlinks" >&2 - Exit 77 -} +ln -s Zardoz install-sh || skip "cannot create broken symlinks" : > Makefile.am diff --git a/tests/tar.test b/tests/tar.test index dc5353c..a0fd05a 100755 --- a/tests/tar.test +++ b/tests/tar.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2008, 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 @@ -34,7 +34,7 @@ $AUTOCONF $AUTOMAKE ./configure -grep 'am__tar.*false' Makefile && Exit 77 +grep 'am__tar.*false' Makefile && skip #FIXME: reason of this skip? $MAKE distcheck test -f tar-1.0.tar.gz diff --git a/tests/tar2.test b/tests/tar2.test index e62f0cc..fb19847 100755 --- a/tests/tar2.test +++ b/tests/tar2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 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 @@ -34,7 +34,7 @@ $AUTOCONF $AUTOMAKE ./configure -grep 'am__tar.*false' Makefile && Exit 77 +grep 'am__tar.*false' Makefile && skip #FIXME: reason of this skip? $MAKE distcheck test -f tar2-1.0.tar.gz diff --git a/tests/txinfo21.test b/tests/txinfo21.test index 4bbce4a..11594ed 100755 --- a/tests/txinfo21.test +++ b/tests/txinfo21.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2006, 2008, 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 @@ -150,7 +151,7 @@ test ! -f share/txinfo21/dvi/main.dvi test ! -f share/txinfo21/dvi/main2.dvi test ! -f share/txinfo21/dvi/main3.dvi -(dvips --help 2>/dev/null >/dev/null) || Exit 77 +dvips --help || skip "dvips is missing" $MAKE install-ps test -f share/txinfo21/ps/main.ps @@ -161,8 +162,7 @@ test ! -f share/txinfo21/ps/main.ps test ! -f share/txinfo21/ps/main2.ps test ! -f share/txinfo21/ps/main3.ps -(pdfetex --help 2>/dev/null >/dev/null) || - (pdftex --help 2>/dev/null >/dev/null) || Exit 77 +pdfetex --help || pdftex --help || skip "pdftex and pdfetex both missing" $MAKE install-pdf test -f share/txinfo21/pdf/main.pdf diff --git a/tests/txinfo26.test b/tests/txinfo26.test index e5e8f84..586eda4 100755 --- a/tests/txinfo26.test +++ b/tests/txinfo26.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 2007, 2008, 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 @@ -48,9 +48,9 @@ $AUTOCONF $MAKE $MAKE distclean -# We do not require this to work with a directory that contains white space. case `pwd` in - *\ * | *\ *) Exit 77;; + *\ * | *\ *) + skip "this test might fail with a directory containing white spaces";; esac mkdir build diff --git a/tests/vala2.test b/tests/vala2.test index e559540..c390f18 100755 --- a/tests/vala2.test +++ b/tests/vala2.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # This file is part of GNU Automake. # @@ -66,7 +66,7 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure || Exit 77 +./configure || skip "configure failure" $MAKE # test rebuild rules diff --git a/tests/vala3.test b/tests/vala3.test index 138e853..1116a1c 100755 --- a/tests/vala3.test +++ b/tests/vala3.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # This file is part of GNU Automake. # @@ -60,7 +60,7 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure || Exit 77 +./configure || skip "configure failure" $MAKE $MAKE distcheck $MAKE distclean @@ -90,7 +90,7 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure || Exit 77 +./configure || skip "configure failure" $MAKE $MAKE distcheck $MAKE distclean diff --git a/tests/vala5.test b/tests/vala5.test index 8fc703c..d27334c 100755 --- a/tests/vala5.test +++ b/tests/vala5.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # This file is part of GNU Automake. # @@ -69,6 +69,6 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure || Exit 77 +./configure || skip "configure failure" $MAKE -- 1.7.1