tests: avoid test failure on Solaris 10 due to lack of PATH export
[pspp] / tests / test-update-copyright.sh
index 859c75d0f128a58217a12d1c71757ff723913e2a..ea700c902b8be30f9de761f32db81316db5b6143 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Test suite for update-copyright.
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009-2010 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -23,6 +23,10 @@ else
   compare() { cmp "$@"; }
 fi
 
+# Ensure the update-copyright program gets found.
+PATH=$abs_aux_dir:$PATH
+export PATH
+
 TMP_BASE=update-copyright.test
 trap 'rm -f $TMP_BASE*' 0 1 2 3 15
 
@@ -47,6 +51,17 @@ echo a > $TMP-in
     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' || {
+  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
+
 ## ----------------------------- ##
 ## Examples from documentation.  ##
 ## ----------------------------- ##
@@ -223,7 +238,7 @@ rm $TMP*
 ## -------------- ##
 
 TMP=$TMP_BASE-current-year
-YEAR=`/usr/bin/perl -e 'print [localtime]->[5] + 1900'`;
+YEAR=`date +%Y`
 cat > $TMP <<EOF
 '\" Copyright (C) 2006
 '\" Free Software Foundation,