From: Michael G. Schwern Date: Wed, 12 Dec 2001 21:53:46 +0000 (-0500) Subject: Re: [PATCH t/test.pl t/op/stat.t lib/Net/hostent.t] Unbail out X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4fbe2471f42249bd57e1c071c99349d2331aea5;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH t/test.pl t/op/stat.t lib/Net/hostent.t] Unbail out Message-ID: <20011213025346.GH25129@blackrider> p4raw-id: //depot/perl@13668 --- diff --git a/lib/Net/hostent.t b/lib/Net/hostent.t index 0a6a79e..e82cf85 100644 --- a/lib/Net/hostent.t +++ b/lib/Net/hostent.t @@ -20,9 +20,9 @@ BEGIN { BEGIN { use_ok 'Net::hostent' } # Remind me to add this to Test::More. -sub BAILOUT { - print "Bail Out! @_\n"; - exit; +sub DIE { + print "# @_\n"; + exit 1; } # test basic resolution of localhost <-> 127.0.0.1 @@ -30,13 +30,13 @@ use Socket; my $h = gethost('localhost'); ok(defined $h, "gethost('localhost')") || - BAILOUT("Can't continue without working gethost: $!"); + DIE("Can't continue without working gethost: $!"); is( inet_ntoa($h->addr), "127.0.0.1", 'addr from gethost' ); my $i = gethostbyaddr(inet_aton("127.0.0.1")); ok(defined $i, "gethostbyaddr('127.0.0.1')") || - BAILOUT("Can't continue without working gethostbyaddr: $!"); + DIE("Can't continue without working gethostbyaddr: $!"); is( inet_ntoa($i->addr), "127.0.0.1", 'addr from gethostbyaddr' ); diff --git a/t/op/stat.t b/t/op/stat.t index 299972d..57460fc 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -36,10 +36,10 @@ my $tmpfile_link = $tmpfile.'2'; unlink $tmpfile; -open(FOO, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!"); close FOO; -open(FOO, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!"); my($nlink, $mtime, $ctime) = (stat(FOO))[$NLINK, $MTIME, $CTIME]; SKIP: { @@ -109,13 +109,13 @@ DIAG } # truncate and touch $tmpfile. -open(F, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(F, ">$tmpfile") || DIE("Can't open temp test file: $!"); close F; ok(-z $tmpfile, '-z on empty file'); ok(! -s $tmpfile, ' and -s'); -open(F, ">$tmpfile") || BAILOUT("Can't open temp test file: $!"); +open(F, ">$tmpfile") || DIE("Can't open temp test file: $!"); print F "hi\n"; close F; @@ -296,7 +296,7 @@ my $Null = File::Spec->devnull; SKIP: { skip "No null device to test with", 1 unless -e $Null; - open(NULL, $Null) or BAIL_OUT("Can't open $Null: $!"); + open(NULL, $Null) or DIE("Can't open $Null: $!"); ok(! -t NULL, 'null device is not a TTY'); close(NULL); } diff --git a/t/test.pl b/t/test.pl index e0220f5..efdb6b4 100644 --- a/t/test.pl +++ b/t/test.pl @@ -325,9 +325,9 @@ sub runperl { } -sub BAILOUT { - print STDOUT "Bail out! @_\n"; - exit; +sub DIE { + print STDOUT "# @_\n"; + exit 1; } # A somewhat safer version of the sometimes wrong $^X.