This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Replace quit() in t/op/groups.t with test.pl's skip_all()
authorNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 19:37:13 +0000 (19:37 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 19:37:13 +0000 (19:37 +0000)
t/op/groups.t

index d90884f..e6b2035 100644 (file)
@@ -20,15 +20,11 @@ use strict;
 use Config ();
 use POSIX ();
 
-unless (eval { my($foo) = getgrgid(0); 1 }) {
-    quit( "getgrgid() not implemented" );
-}
+skip_all('getgrgid() not implemented')
+    unless eval { my($foo) = getgrgid(0); 1 };
 
-quit("No `id' or `groups'") if
-    $^O eq 'MSWin32'
-    || $^O eq 'NetWare'
-    || $^O eq 'VMS'
-    || $^O =~ /lynxos/i;
+skip_all("No 'id' or 'groups'") if
+    $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS' || $^O =~ /lynxos/i;
 
 Test();
 exit;
@@ -40,9 +36,9 @@ sub Test {
     # Get our supplementary groups from the system by running commands
     # like `id -a'.
     my ( $groups_command, $groups_string ) = system_groups()
-        or quit( "No `id' or `groups'" );
+        or skip_all("No 'id' or 'groups'");
     my @extracted_groups = extract_system_groups( $groups_string )
-        or quit( "Can't parse `${groups_command}'" );
+        or skip_all("Can't parse '${groups_command}'");
 
     my $pwgid = $( + 0;
     my ($pwgnam) = getgrgid($pwgid);
@@ -136,12 +132,6 @@ sub Test {
     return;
 }
 
-# Cleanly abort this entire test file
-sub quit {
-    print "1..0 # SKIP: @_\n";
-    exit 0;
-}
-
 # Get the system groups and the command used to fetch them.
 #
 sub system_groups {