X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-update-copyright.sh;h=24574b29f9685f1da96cb2fc0befe2f65fb1ef29;hb=d396a88a816427f9e33ebc6616b9ec019266d130;hp=0f5de4b302d9ac7fde62935207aace66941a7fc0;hpb=9faeba562c0527b5cf1fca4f79ba657553c2a31b;p=gnulib.git diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh index 0f5de4b30..24574b29f 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. ## @@ -45,15 +62,15 @@ cat > $TMP.3 < $TMP.4 < $TMP.5 < $TMP.6 < $TMP-stdout 2> $TMP-stderr compare /dev/null $TMP-stdout || exit 1 compare - $TMP-stderr < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare - $TMP-stderr < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP < $TMP < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP < $TMP-exp <<\EOF -Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,@ -Rem 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ -Rem 2009-2010 Free Software Foundation, Inc.@ +Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@ +Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ +Rem 2009, 2010 Free Software Foundation, Inc.@ EOF compare $TMP-exp $TMP || exit 1 rm $TMP* +## --------------- ## +## Omitted "(C)". ## +## --------------- ## + +TMP=$TMP_BASE-omitted-circle-c +cat > $TMP < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP < $TMP.star < $TMP.space < $TMP.single-line < $TMP.single-line-wrapped < $TMP.extra-text-star < $TMP.extra-text-space < $TMP-stdout 2> $TMP-stderr +compare /dev/null $TMP-stdout || exit 1 +compare /dev/null $TMP-stderr || exit 1 +compare - $TMP.star <