bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minimum perl version


From: Bruno Haible
Subject: Re: minimum perl version
Date: Sat, 4 Sep 2010 12:26:37 +0200
User-agent: KMail/1.9.9

Hi Jim,

> diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
> index 2d1022a..607928d 100755
> --- a/tests/test-update-copyright.sh
> +++ b/tests/test-update-copyright.sh
> @@ -16,6 +16,10 @@
>  # You should have received a copy of the GNU General Public License
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
> 
> +# Skip this test if Perl is too old.  FIXME: 5.6.0 is just a guess.
> +# We have a report that 5.004_05 is inadequate and that 5.8.8 works.
> +perl -e 'require 5.6.0' || exit 77
> +
>  diffout=`diff -u /dev/null /dev/null 2>&1`
>  if test x"$diffout" = x"" && test $? -eq 0; then
>    compare() { diff -u "$@"; }

A little down in this test, there is a check whether perl exists at all.
It makes no sense IMO to test the perl version, risking a message to stderr
if it is missing, and then afterwards to test whether perl exists.

Also, when the test is skipped, we should output an explanation why.
This explanation has already uncovered bugs. A message like
  "Perl v5.8.0 required--this is only v5.6.0, stopped at -e line 1."
sounds more like an error message than like an explanation why a test is
being skipped.

How about this proposed change?


2010-09-04  Bruno Haible  <address@hidden>

        update-copyright test: Improve output when perl is missing or too old.
        * tests/test-update-copyright.sh: Move test of Perl version down after
        the test whether Perl exists. Provide an explanation why the test is
        skipped.

*** tests/test-update-copyright.sh.orig Sat Sep  4 12:24:31 2010
--- tests/test-update-copyright.sh      Sat Sep  4 12:24:26 2010
***************
*** 16,25 ****
  # You should have received a copy of the GNU General Public License
  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
- # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
- # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
- perl -e 'require 5.8.0' || exit 77
- 
  diffout=`diff -u /dev/null /dev/null 2>&1`
  if test x"$diffout" = x"" && test $? -eq 0; then
    compare() { diff -u "$@"; }
--- 16,21 ----
***************
*** 51,56 ****
--- 50,62 ----
      exit 77
    }
  
+ # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
+ # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
+ perl -e 'require 5.8.0' 2>/dev/null || {
+   echo '$0: skipping this test; Perl version is too old' 1>&2
+   exit 77
+ }
+ 
  # Do not let a different envvar setting perturb results.
  UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
  export UPDATE_COPYRIGHT_MAX_LINE_LENGTH



reply via email to

[Prev in Thread] Current Thread [Next in Thread]