diff options
author | Colin Kuskie <colink@perldreamer.com> | 2012-09-13 23:25:58 -0700 |
---|---|---|
committer | jkeenan <jkeenan@cpan.org> | 2012-09-16 11:44:59 -0400 |
commit | c3fcf49dfa6136c02c1f42a36f08c75a5f7a5c5c (patch) | |
tree | f87c70605ff2298147629979b130548a04bcc755 | |
parent | e8d9e9d0c5f9426c78756a60f2b68e10f38ce40e (diff) | |
download | perl-c3fcf49dfa6136c02c1f42a36f08c75a5f7a5c5c.tar.gz |
Refactor t/lib/1_compile.t to use test.pl instead of making TAP by hand.
-rw-r--r-- | t/lib/1_compile.t | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index a4dea83054..2802ae2ad6 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -7,9 +7,9 @@ BEGIN { chdir 't'; @INC = '../lib'; + require './test.pl'; } -use strict; use warnings; use File::Spec::Functions; @@ -27,28 +27,22 @@ if (eval { require Socket }) { @Core_Modules = sort @Core_Modules; -print "1..".(1+@Core_Modules)."\n"; +plan tests => 1+@Core_Modules; -my $message - = "ok 1 - All modules should have tests # TODO Make Schwern Poorer\n"; -if (@Core_Modules) { - print "not $message"; -} else { - print $message; -} -print <<'EOREWARD'; -# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg01223.html -# 20010421230349.P2946@blackrider.blackstar.co.uk -EOREWARD - -my $test_num = 2; +cmp_ok(@Core_Modules, '>', 0, "All modules should have tests"); +note("http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg01223.html"); +note("20010421230349.P2946\@blackrider.blackstar.co.uk"); foreach my $module (@Core_Modules) { - my $todo = ''; - $todo = "# TODO $module needs porting on $^O" if $module eq 'ByteLoader' && $^O eq 'VMS'; - print "# $module compile failed\nnot " unless compile_module($module); - print "ok $test_num $todo\n"; - $test_num++; + if ($module eq 'ByteLoader' && $^O eq 'VMS') { + TODO: { + local $TODO = "$module needs porting on $^O"; + ok(compile_module($module), "compile $module"); + } + } + else { + ok(compile_module($module), "compile $module"); + } } # We do this as a separate process else we'll blow the hell @@ -60,7 +54,6 @@ sub compile_module { my $lib = '-I' . catdir(updir(), 'lib'); my $out = scalar `$^X $lib $compmod $module`; - print "# $out"; return $out =~ /^ok/; } |