Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From bb227adcae287750a9b150a5889b5c011aac9c0f Mon Sep 17 00:00:00 2001
- From: Florian Ragwitz <rafl@debian.org>
- Date: Sat, 22 Jan 2011 09:03:20 +0100
- Subject: [PATCH] Stop EU::CBuilder's tests from failing in parallel
- It used to use the same paths for temporary files in all tests. This blew up
- randomly when the tests were run in parallel.
- ---
- dist/ExtUtils-CBuilder/t/01-basic.t | 10 +++++-----
- dist/ExtUtils-CBuilder/t/02-link.t | 6 +++---
- dist/ExtUtils-CBuilder/t/03-cplusplus.t | 10 +++++-----
- dist/ExtUtils-CBuilder/t/04-base.t | 12 ++++++------
- 4 files changed, 19 insertions(+), 19 deletions(-)
- diff --git a/dist/ExtUtils-CBuilder/t/01-basic.t b/dist/ExtUtils-CBuilder/t/01-basic.t
- index ffcd60c..70305af 100644
- --- a/dist/ExtUtils-CBuilder/t/01-basic.t
- +++ b/dist/ExtUtils-CBuilder/t/01-basic.t
- @@ -30,11 +30,11 @@ ok $b, "created EU::CB object";
- ok $b->have_compiler, "have_compiler";
- -$source_file = File::Spec->catfile('t', 'compilet.c');
- +$source_file = File::Spec->catfile('t', 'basict.c');
- {
- local *FH;
- open FH, "> $source_file" or die "Can't create $source_file: $!";
- - print FH "int boot_compilet(void) { return 1; }\n";
- + print FH "int boot_basict(void) { return 1; }\n";
- close FH;
- }
- ok -e $source_file, "source file '$source_file' created";
- @@ -48,7 +48,7 @@ $lib_file = $b->lib_file($object_file);
- ok 1;
- my ($lib, @temps) = $b->link(objects => $object_file,
- - module_name => 'compilet');
- + module_name => 'basict');
- $lib =~ tr/"'//d;
- is $lib_file, $lib;
- @@ -58,8 +58,8 @@ for ($source_file, $object_file, $lib_file) {
- }
- if ($^O eq 'VMS') {
- - 1 while unlink 'COMPILET.LIS';
- - 1 while unlink 'COMPILET.OPT';
- + 1 while unlink 'BASICT.LIS';
- + 1 while unlink 'BASICT.OPT';
- }
- my @words = $b->split_like_shell(' foo bar');
- diff --git a/dist/ExtUtils-CBuilder/t/02-link.t b/dist/ExtUtils-CBuilder/t/02-link.t
- index 822b071..e6dba55 100644
- --- a/dist/ExtUtils-CBuilder/t/02-link.t
- +++ b/dist/ExtUtils-CBuilder/t/02-link.t
- @@ -31,7 +31,7 @@ else {
- ok $b, "created EU::CB object";
- -$source_file = File::Spec->catfile('t', 'compilet.c');
- +$source_file = File::Spec->catfile('t', 'linkt.c');
- {
- open my $FH, "> $source_file" or die "Can't create $source_file: $!";
- print $FH "int main(void) { return 11; }\n";
- @@ -77,8 +77,8 @@ for ($source_file, $object_file, $exe_file) {
- }
- if ($^O eq 'VMS') {
- - 1 while unlink 'COMPILET.LIS';
- - 1 while unlink 'COMPILET.OPT';
- + 1 while unlink 'LINKT.LIS';
- + 1 while unlink 'LINKT.OPT';
- }
- sub my_system {
- diff --git a/dist/ExtUtils-CBuilder/t/03-cplusplus.t b/dist/ExtUtils-CBuilder/t/03-cplusplus.t
- index 02555df..638a0a2 100644
- --- a/dist/ExtUtils-CBuilder/t/03-cplusplus.t
- +++ b/dist/ExtUtils-CBuilder/t/03-cplusplus.t
- @@ -30,10 +30,10 @@ ok $b, "created EU::CB object";
- ok $b->have_cplusplus, "have_cplusplus";
- -$source_file = File::Spec->catfile('t', 'compilet.cc');
- +$source_file = File::Spec->catfile('t', 'cplust.cc');
- {
- open my $FH, "> $source_file" or die "Can't create $source_file: $!";
- - print $FH "class Bogus { public: int boot_compilet() { return 1; } };\n";
- + print $FH "class Bogus { public: int boot_cplust() { return 1; } };\n";
- close $FH;
- }
- ok -e $source_file, "source file '$source_file' created";
- @@ -47,7 +47,7 @@ $lib_file = $b->lib_file($object_file);
- ok 1;
- my ($lib, @temps) = $b->link(objects => $object_file,
- - module_name => 'compilet');
- + module_name => 'cplust');
- $lib =~ tr/"'//d;
- is $lib_file, $lib;
- @@ -57,7 +57,7 @@ for ($source_file, $object_file, $lib_file) {
- }
- if ($^O eq 'VMS') {
- - 1 while unlink 'COMPILET.LIS';
- - 1 while unlink 'COMPILET.OPT';
- + 1 while unlink 'CPLUST.LIS';
- + 1 while unlink 'CPLUST.OPT';
- }
- diff --git a/dist/ExtUtils-CBuilder/t/04-base.t b/dist/ExtUtils-CBuilder/t/04-base.t
- index 5b235a5..c3bf6b5 100644
- --- a/dist/ExtUtils-CBuilder/t/04-base.t
- +++ b/dist/ExtUtils-CBuilder/t/04-base.t
- @@ -129,14 +129,14 @@ $base = ExtUtils::CBuilder::Base->new( quiet => 1 );
- ok( $base, "ExtUtils::CBuilder::Base->new() returned true value" );
- isa_ok( $base, 'ExtUtils::CBuilder::Base' );
- -$source_file = File::Spec->catfile('t', 'compilet.c');
- +$source_file = File::Spec->catfile('t', 'baset.c');
- create_c_source_file($source_file);
- ok(-e $source_file, "source file '$source_file' created");
- # object filename automatically assigned
- my $obj_ext = $base->{config}{obj_ext};
- is( $base->object_file($source_file),
- - File::Spec->catfile('t', "compilet$obj_ext"),
- + File::Spec->catfile('t', "baset$obj_ext"),
- "object_file(): got expected automatically assigned name for object file"
- );
- @@ -155,7 +155,7 @@ $base = ExtUtils::CBuilder::Base->new( quiet => 1 );
- ok( $base, "ExtUtils::CBuilder::Base->new() returned true value" );
- isa_ok( $base, 'ExtUtils::CBuilder::Base' );
- -$source_file = File::Spec->catfile('t', 'compilet.c');
- +$source_file = File::Spec->catfile('t', 'baset.c');
- create_c_source_file($source_file);
- ok(-e $source_file, "source file '$source_file' created");
- @@ -337,14 +337,14 @@ for ($source_file, $object_file, $lib_file) {
- pass("Completed all tests in $0");
- if ($^O eq 'VMS') {
- - 1 while unlink 'COMPILET.LIS';
- - 1 while unlink 'COMPILET.OPT';
- + 1 while unlink 'BASET.LIS';
- + 1 while unlink 'BASET.OPT';
- }
- sub create_c_source_file {
- my $source_file = shift;
- open my $FH, '>', $source_file or die "Can't create $source_file: $!";
- - print $FH "int boot_compilet(void) { return 1; }\n";
- + print $FH "int boot_baset(void) { return 1; }\n";
- close $FH;
- }
- --
- 1.7.2.3
Add Comment
Please, Sign In to add comment