From 11ea77c506634ef402471f4a078b60f79302be3f Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Wed, 27 Jun 2001 17:17:30 +0000 Subject: [PATCH] Upgrade to Test::Simple 0.09. p4raw-id: //depot/perl@10993 --- MANIFEST | 1 + lib/Test/Simple.pm | 2 +- lib/Test/Simple/Changes | 44 ++++++++++++++++++++++++++++++++++++++ lib/Test/Simple/t/exit.t | 12 ++++++----- lib/Test/Simple/t/extra.t | 16 ++++++++------ lib/Test/Simple/t/fail.t | 16 ++++++++------ lib/Test/Simple/t/missing.t | 14 ++++++------ lib/Test/Simple/t/no_plan.t | 12 ++++++----- lib/Test/Simple/t/plan_is_noplan.t | 12 ++++++----- 9 files changed, 93 insertions(+), 36 deletions(-) create mode 100644 lib/Test/Simple/Changes diff --git a/MANIFEST b/MANIFEST index 6d31ecc..b9119d0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1101,6 +1101,7 @@ lib/Test/More/t/fail.t Test::More test, failing tests lib/Test/More/t/plan_is_noplan.t Test::More test, noplan lib/Test/More/t/skipall.t Test::More test, skipping all tests lib/Test/Simple.pm Basic utility for writing tests +lib/Test/Simple/Changes Test::Simple changes lib/Test/Simple/t/exit.t Test::Simple test, exit codes lib/Test/Simple/t/extra.t Test::Simple test lib/Test/Simple/t/fail.t Test::Simple test, test failures diff --git a/lib/Test/Simple.pm b/lib/Test/Simple.pm index a66f5ce..e4727da 100644 --- a/lib/Test/Simple.pm +++ b/lib/Test/Simple.pm @@ -2,7 +2,7 @@ package Test::Simple; require 5.004; -$Test::Simple::VERSION = '0.08'; +$Test::Simple::VERSION = '0.09'; my(@Test_Results) = (); my($Num_Tests, $Planned_Tests, $Test_Died) = (0,0,0); diff --git a/lib/Test/Simple/Changes b/lib/Test/Simple/Changes new file mode 100644 index 0000000..ef69c61 --- /dev/null +++ b/lib/Test/Simple/Changes @@ -0,0 +1,44 @@ +Revision history for Perl extension Test::Simple + +0.09 Wed Jun 27 02:55:54 EDT 2001 + - VMS fixes + +0.08 Fri Jun 15 14:39:50 EDT 2001 + - Guarding against $/ and -l + - Reformatted the way failed tests are reported to make them stand out + a bit better. + +0.07 Tue Jun 12 15:55:54 BST 2001 + - 'use Test::Simple' by itself no longer causes death + - Yet more fixes for death in eval + - Limiting max failures reported via exit code to 254. + +0.06 Wed May 9 23:38:17 BST 2001 + - Whoops, left a private method in the public docs. + +0.05 Wed May 9 20:40:35 BST 2001 + - Forgot to include the exit tests. + - Trouble with exiting properly under 5.005_03 and 5.6.1 fixed + - Turned off buffering + * 5.004 new minimum version + - Now explicitly tested with 5.6.1, 5.6.0, 5.005_03 and 5.004 + +0.04 Mon Apr 2 11:05:01 BST 2001 + - Fixed "require Test::Simple" so it doesn't bitch and exit 255 + - Now installable with the CPAN shell. + +0.03 Fri Mar 30 08:08:33 BST 2001 + - ok() now prints on what line and file it failed. + - eval 'die' was considered abnormal. Fixed. + +0.02 Fri Mar 30 05:12:14 BST 2001 *UNRELEASED* + - exit codes tested + * exit code on abnormal exit changed to 255 (thanks to Tim Bunce for + pointing out that Unix can't do negative exit codes) + - abnormal exits now better caught. + - No longer using Test.pm to test this, but still minimum of 5.005 + due to needing $^S. + +0.01 Wed Mar 28 06:44:44 BST 2001 + - First working version released to CPAN + diff --git a/lib/Test/Simple/t/exit.t b/lib/Test/Simple/t/exit.t index 369a417..7247a0c 100644 --- a/lib/Test/Simple/t/exit.t +++ b/lib/Test/Simple/t/exit.t @@ -5,10 +5,12 @@ my $test_num = 1; # Utility testing functions. sub ok ($;$) { my($test, $name) = @_; - print "not " unless $test; - print "ok $test_num"; - print " - $name" if defined $name; - print "\n"; + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; $test_num++; } @@ -32,7 +34,7 @@ print "1..".keys(%Tests)."\n"; chdir 't' if -d 't'; while( my($test_name, $exit_code) = each %Tests ) { - my $wait_stat = system("$^X -I../lib -Ilib/Test/Simple/ lib/Test/Simple/sample_tests/$test_name"); + my $wait_stat = system(qq{$^X -"I../blib/lib" sample_tests/$test_name}); My::Test::ok( $wait_stat >> 8 == $exit_code, "$test_name exited with $exit_code" ); } diff --git a/lib/Test/Simple/t/extra.t b/lib/Test/Simple/t/extra.t index 707162a..ba04517 100644 --- a/lib/Test/Simple/t/extra.t +++ b/lib/Test/Simple/t/extra.t @@ -7,10 +7,12 @@ my $test_num = 1; # Utility testing functions. sub ok ($;$) { my($test, $name) = @_; - print "not " unless $test; - print "ok $test_num"; - print " - $name" if defined $name; - print "\n"; + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; $test_num++; } @@ -19,7 +21,7 @@ package main; require Test::Simple; -push @INC, 'lib/Test/Simple'; +push @INC, 't', '.'; require Catch; my($out, $err) = Catch::caught(); @@ -42,8 +44,8 @@ not ok 5 - Sar OUT My::Test::ok($$err eq <