Skip to content
Browse files

bug fixed: run tests in clean environment

  • Loading branch information...
1 parent 0169ece commit 373e68039ed16297361081a3913ee0d815971154 @tokuhirom committed Nov 9, 2009
Showing with 14 additions and 3 deletions.
  1. +13 −2 t/003_mi/test.t
  2. +1 −1 t/MITest.pm
View
15 t/003_mi/test.t
@@ -1,10 +1,21 @@
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More tests => 4;
use t::MITest;
+use Config;
+use File::Temp ();
+use File::Path ();
+use File::Spec;
+use File::Copy;
+
+my $tmpdir = File::Temp::tempdir(CLEANUP => 1);
+my $dir = File::Spec->catdir($tmpdir, $Config{archname});
+my $container = File::Spec->catdir( $dir, , 'auto', 'Clib', 'include', 'nanotap' );
+ok File::Path::mkpath($container);
+ok copy('nanotap.h', File::Spec->catfile($container, 'nanotap.h'));
setup;
-run_makefile_pl;
+run_makefile_pl('-I', $dir);
run_make;
ok -f 'Makefile';
View
2 t/MITest.pm
@@ -25,7 +25,7 @@ sub cleanup {
}
sub run_makefile_pl {
- system $^X, '-I../../lib/', 'Makefile.PL';
+ system $^X, @_, '-I../../lib/', 'Makefile.PL';
}
sub run_make {

0 comments on commit 373e680

Please sign in to comment.
Something went wrong with that request. Please try again.