test-update-copyright: skip if perl is insufficient
authorEric Blake <ebb9@byu.net>
Sat, 15 Aug 2009 16:28:30 +0000 (10:28 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 15 Aug 2009 16:28:30 +0000 (10:28 -0600)
* tests/test-update-copyright.sh: Failure to run maintainer tool
should not cause testsuite failure on cygwin 1.5.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
tests/test-update-copyright.sh

index 626400a792cf525c97e82257cfc58956b105f78c..b919f1d859041bf7b41e569eb50954cdd07bae97 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-15  Eric Blake  <ebb9@byu.net>
+       and Jim Meyering  <meyering@redhat.com>
+
+       test-update-copyright: skip if perl is insufficient
+       * tests/test-update-copyright.sh: Failure to run maintainer tool
+       should not cause testsuite failure on cygwin 1.5.
+
 2009-08-14  Eric Blake  <ebb9@byu.net>
 
        doc: mention more functions added in cygwin 1.7.0
index e8a71ce581ec2931ab8a02b41f21cf8c56065fa9..24574b29f9685f1da96cb2fc0befe2f65fb1ef29 100755 (executable)
@@ -24,6 +24,23 @@ else
 fi
 
 TMP_BASE=update-copyright.test
+trap 'rm -f $TMP_BASE*' 0 1 2 3 15
+
+## --------------------------------- ##
+## Skip if user does not have perl.  ##
+## --------------------------------- ##
+
+TMP=$TMP_BASE
+s=$TMP-script
+printf '#!/usr/bin/perl -pi\ns/a/b/\n' > $s
+chmod a+x $s
+echo a > $TMP-in
+./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" ||
+  {
+    printf '%s\n' "$0: skipping this test;" \
+      'your system has insufficient support for Perl' 1>&2
+    exit 77
+  }
 
 ## ----------------------------- ##
 ## Examples from documentation.  ##