Subject: | 01run.t and 02assert.t fail with HARNESS_OPTIONS=j2+ |
The test C filenames being sequentially generated causes the two tests
to step on each other when run in parallel. Attached is a patch to
randomly generate the filenames instead.
Subject: | rand_file.patch |
From 14fa6932c5137f637bee2d2d2db376b3885f0330 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Richard=20Sim=C3=B5es?= <rsimoes@cpan.org>
Date: Sat, 24 Mar 2012 07:31:58 -0500
Subject: [PATCH] use random filename generation instead of a sequential
scheme
---
lib/ExtUtils/CChecker.pm | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/ExtUtils/CChecker.pm b/lib/ExtUtils/CChecker.pm
index df0aa07..8a64bc5 100644
--- a/lib/ExtUtils/CChecker.pm
+++ b/lib/ExtUtils/CChecker.pm
@@ -11,7 +11,7 @@ use warnings;
our $VERSION = '0.07';
use Carp;
-
+use Digest::MD5 "md5_hex";
use ExtUtils::CBuilder;
=head1 NAME
@@ -88,7 +88,6 @@ sub new
return bless {
cb => $cb,
- seq => 0,
defines_to => $args{defines_to},
@@ -273,9 +272,8 @@ sub try_compile_run
defined $args{source} or croak "Expected 'source'";
- my $seq = $self->{seq}++;
-
- my $test_source = "test-$seq.c";
+ my $rand = md5_hex(rand);
+ my $test_source = "test-$rand.c";
open( my $test_source_fh, "> $test_source" ) or die "Cannot write $test_source - $!";
--
1.7.5.4