Author: dagolden
Date: Tue Dec 15 21:15:09 2009
New Revision: 13661

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/t/00-compile.t

Log:
make t/00-compile.t more portable

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Tue Dec 15 21:15:09 2009
@@ -4,6 +4,8 @@
 
  Bug fixes:
 
+ - Change t/00-compile.t test for more portability
+
  - Skip ppm.t if Pod::HTML is not available
 
  - Ensure bundle_inc.t doesn't accidentally uninstall the installed M::B

Modified: Module-Build/trunk/t/00-compile.t
==============================================================================
--- Module-Build/trunk/t/00-compile.t   (original)
+++ Module-Build/trunk/t/00-compile.t   Tue Dec 15 21:15:09 2009
@@ -1,8 +1,8 @@
 use strict;
 use warnings;
-use Test::More;
+use lib 't/lib';
+use MBTest;
 use File::Find qw/find/;
-use File::Spec;
 
 my @files;
 find( sub { -f && /\.pm$/ && push @files, $File::Find::name }, 'lib' );
@@ -10,8 +10,8 @@
 plan tests => scalar @files;
 
 for my $f ( sort @files ) {
-  my $mod = join("::",File::Spec->splitdir(File::Spec->abs2rel($f, 'lib')));
-  $mod =~ s{\.pm$}{};
-  require_ok( $mod );
+  my $ec;
+  my $output = stdout_stderr_of( sub { $ec = system( $^X, '-c', $f ) } );
+  ok( ! $ec, "compiling $f" ) or diag $output;
 }
 

Reply via email to