-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Jim Meyering on 8/15/2009 9:50 AM: >> I'm not sure why some invocations work and others fail, but the point is >> that update-copyright doesn't work as-is on cygwin 1.5; and it also has >> the annoying failure path of either renaming or worse deleting the >> original file. So I'm not sure how best to add skip logic to >> test-update-copyright to avoid spurious test failures. > > Well, with that, adjusting the test script > to detect and skip should be trivial.
Thanks - that was enough to get going. Here's what I'm pushing (I don't think you'll mind being listed in the ChangeLog). > However, eventually, (for improved portability) I want to convert > update-copyright itself not to use that mechanism. I.e., to have the > usual #!/usr/bin/perl first line, without any options. That's also in > line with the goal of adding --help and --version options. Yes, it would be good to clean up the #! line. But we still have to remember that #!/usr/bin/perl is not required to exist on end user's machines. Coreutils even goes so far as to dynamically use $(PERL) during the testsuite (check.mk's shell_or_perl_ function), exploiting the checks for perl done during configure. But while packages like coreutils or autoconf that already require perl during configure can get away with that, I don't think it is worth bloating configure to add $(PERL) checking to simpler packages like m4 that have no other perl dependency. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqG4zcACgkQ84KuGfSFAYAQowCgk7CzuG4VQSzeULfDFyZY/sq4 60AAnidCSVy+6Lj7AUfVShrZM+Rps/aG =pIJK -----END PGP SIGNATURE-----
>From 66a0ae8baa37cf767dc21fbc429c0570d5d8d951 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> 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 <e...@byu.net> --- ChangeLog | 7 +++++++ tests/test-update-copyright.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 626400a..b919f1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-15 Eric Blake <e...@byu.net> + and Jim Meyering <meyer...@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 <e...@byu.net> 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 e8a71ce..24574b2 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. ## -- 1.6.3.3.334.g916e1