Skip to content

Instantly share code, notes, and snippets.

@turugina
Created August 24, 2010 06:23
Show Gist options
  • Save turugina/547057 to your computer and use it in GitHub Desktop.
Save turugina/547057 to your computer and use it in GitHub Desktop.
=== modified file 'Makefile.PL'
--- Makefile.PL 2010-08-24 05:03:18 +0000
+++ Makefile.PL 2010-08-24 06:21:15 +0000
@@ -20,6 +20,7 @@
test_requires 'Test::More' => 0.88; # done_testing()
test_requires 'Test::Requires';
+test_requires 'IPC::Run';
#test_requires 'Test::LeakTrace';
install_script 'xslate';
=== modified file 't/300_examples/100_eg_pl.t'
--- t/300_examples/100_eg_pl.t 2010-08-24 05:03:18 +0000
+++ t/300_examples/100_eg_pl.t 2010-08-24 06:07:30 +0000
@@ -4,26 +4,15 @@
use strict;
use Test::More;
-use IPC::Open3 qw(open3);
+use IPC::Run qw(run timeout);
use File::Path qw(rmtree);
rmtree '.eg_cache';
END{ rmtree '.eg_cache' }
sub perl {
- local(*IN, *OUT, *ERR);
- my $pid = open3(\*IN, \*OUT, \*ERR, $^X,
- (map { "-I$_" } @INC),
- @_,
- );
-
- close IN;
- local $/;
- my $out = <OUT>;
- my $err = <ERR>;
-
- close OUT;
- close ERR;
+ run [$^X, (map { "-I$_" } @INC), @_],
+ \my $in, \my $out, \my $err, timeout(5);
foreach my $s($out, $err) {
$s =~ s/\r\n/\n/g;
@turugina
Copy link
Author

mingwビルドのperl5.12.1 でText::Xslateのテストがハングする問題の修正パッチ。
IPC::Open3ではなくて、IPC::Runを使ってtimeoutさせるとテストが通るようになりました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment