]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: remove require-perl script; use function instead
authorJim Meyering <meyering@redhat.com>
Thu, 1 Sep 2011 21:59:02 +0000 (23:59 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 2 Sep 2011 12:08:40 +0000 (14:08 +0200)
* tests/require-perl: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove it from this list.
* tests/init.cfg (require_perl_): New function.
* tests/misc/pwd-long: Use the new function, not the file.
* tests/ls/nameless-uid: Likewise.
* tests/misc/sum-sysv: Likewise.

tests/Makefile.am
tests/init.cfg
tests/ls/nameless-uid
tests/misc/pwd-long
tests/misc/sum-sysv
tests/require-perl [deleted file]

index c37cca61aa5f7c5a6ce90b9928fa6a22dce5f82f..b920abafcf969aa194d6e9e433add74f9d8373fa 100644 (file)
@@ -18,7 +18,6 @@ EXTRA_DIST =          \
   init.sh              \
   lang-default         \
   other-fs-tmpdir      \
-  require-perl         \
   sample-test          \
   shell-or-perl                \
   $(pr_data)
index 56df0336488a8b8f76202f80885c0eb2b6a934ec..f7615e6abd4d452d37685e1429a6be55d0f93f6f 100644 (file)
@@ -335,6 +335,14 @@ require_dirent_d_type_()
     || skip_ requires d_type support
 }
 
+# Skip the current test if we lack Perl.
+require_perl_()
+{
+  : ${PERL=perl}
+  $PERL -e 'use warnings' > /dev/null 2>&1 \
+    || skip_ 'configure did not find a usable version of Perl'
+}
+
 # Does the current (working-dir) file system support sparse files?
 require_sparse_support_()
 {
index 49521037ee9f230e5b7f263e470c899fdfbd9f16..9b81392043c6a1246933f79003539f2cb33e9ecc 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${srcdir=.}
-. $srcdir/require-perl
-
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ ls
 
 require_root_
+require_perl_
 
 nameless_uid=`$PERL -e '
   foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }
index e318457963e64c45dd8194e0a48e551845461103..bf088fb38826496a48c479c793f97ac26c714a48 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${srcdir=.}
-. $srcdir/require-perl
-
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ pwd
 
 require_readable_root_
+require_perl_
 
 ARGV_0=$0
 export ARGV_0
index 0e35ad319aa5b2f049599a6cedbff531b98f8e7c..f4d6a18ed37ff08e26d294d1e8bf4e102442029f 100755 (executable)
@@ -16,9 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-: ${srcdir=.}
-. $srcdir/require-perl
-
 # Avoid a problem when run in a UTF-8 locale.
 # Otherwise, Perl would try to (and fail to) interpret
 # each string below as a sequence of multi-byte characters.
@@ -28,6 +25,8 @@ export LC_ALL
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ sum
 
+require_perl_
+
 # FYI, 16843009 is floor (2^32 / 255).
 
 # aka: perl -e 'print chr(255) x 16843009'
diff --git a/tests/require-perl b/tests/require-perl
deleted file mode 100644 (file)
index a6d9dc9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-: ${PERL=perl}
-$PERL -e 'use warnings' > /dev/null 2>&1 || {
-  echo 1>&2 "$0: configure did not find a usable version of Perl," \
-    "so skipping this test"
-  Exit 77
-}