From 66a0ae8baa37cf767dc21fbc429c0570d5d8d951 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 15 Aug 2009 10:28:30 -0600 Subject: [PATCH] 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. Signed-off-by: Eric Blake --- ChangeLog | 7 +++++++ tests/test-update-copyright.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 626400a792..b919f1d859 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-15 Eric Blake + and Jim Meyering + + 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 doc: mention more functions added in cygwin 1.7.0 diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh index e8a71ce581..24574b29f9 100755 --- a/tests/test-update-copyright.sh +++ b/tests/test-update-copyright.sh @@ -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. ## -- 2.30.2