Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 6 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 30, 2012
Philip Garrett Merge branch 'release/v0.40' into develop baf2235
Commits on Mar 03, 2012
Philip Garrett RT-75400: Added LICENSE to Makefile.PL 19751b2
Philip Garrett Fix Win32 test suite errors (hopefully) 946f1dd
Philip Garrett Solve Win32 "can't remove...permission denied" problem 40d4780
Commits on Mar 04, 2012
Philip Garrett Version bump v0.41 f7b9adb
Philip Garrett Merge branch 'release/v0.41' 039ce0a
View
4 Changes
@@ -1,5 +1,9 @@
Revision history for Perl extension Test::Spec.
+0.41 Sat Mar 03 19:04:00 EST 2012
+ - Added license info to Makefile.PL (RT #75400)
+ - Fixed test suite problems on Windows
+
0.40 Mon Jan 30 18:38:00 EST 2012
- Fixed problem that caused Test::Spec usage errors (e.g. 'describe "foo";'
without a subroutine argument) to be reported from inside the library,
View
1  Makefile.PL
@@ -21,4 +21,5 @@ WriteMakefile(
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/Test/Spec.pm', # retrieve abstract from module
AUTHOR => 'Philip Garrett <philip.garrett@icainformatics.com>') : ()),
+ LICENSE => 'perl',
);
View
2  lib/Test/Spec.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use Test::Trap (); # load as early as possible to override CORE::exit
-our $VERSION = '0.40';
+our $VERSION = '0.41';
use base qw(Exporter);
View
2  t/another_shared_examples_spec.pl
@@ -11,6 +11,8 @@
#
package Testcase::Spec::AnotherSharedExamplesSpec;
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
spec_helper 'shared_examples_spec.pl';
View
2  t/disabled_spec.pl
@@ -9,6 +9,8 @@
package Testcase::Spec::Disabled;
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
describe 'Test::Spec' => sub {
xdescribe 'disabled spec' => sub {
View
2  t/dying_spec.pl
@@ -9,6 +9,8 @@
#
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
describe "Test::Spec" => sub {
it "should trap die message" => sub {
View
2  t/perl_warning_spec.pl
@@ -8,6 +8,8 @@
########################################################################
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
describe "Test::Spec" => sub {
it "turns on perl warnings in test file" => sub {
View
2  t/shared_examples_spec.pl
@@ -9,6 +9,8 @@
#
package Testcase::Spec::SharedExamplesSpec;
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
shared_examples_for "example group" => sub {
it "can take at least one example";
View
2  t/strict_violating_spec.pl
@@ -7,6 +7,8 @@
########################################################################
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
$undefined_variable_violates_strict_mode_and_test_should_not_compile;
View
35 t/test_helper.pl
@@ -1,6 +1,17 @@
use strict;
use FindBin qw($Bin);
+#
+# Shim to make Win32 behave during the test suite.
+#
+# Using fork+exec causes an APPCRASH during show_exceptions.t. Simply
+# reopening STDOUT and STDERR to the same duped filehandle causes errors in
+# the output where STDOUT and STDERR are written on top of each other (even
+# when autoflush is turned on). Reopening STDERR on top of STDOUT in the child
+# process seems to fix this problem.
+open(STDERR, ">&STDOUT") || die "can't reopen STDERR on STDOUT: $!";
+
+
{
package SpecStub;
sub new { bless do { \my $stub }, shift() }
@@ -25,16 +36,24 @@ sub capture_tap {
require File::Spec;
require File::Temp;
- my ($fh,$filename) = File::Temp::tempfile('tmpfileXXXXXX', UNLINK => 1, TMPDIR => 1);
- my $pid = fork || do {
- STDOUT->fdopen(fileno($fh), "w") || die "can't reopen stdout: $!";
- STDERR->fdopen(fileno($fh), "w") || die "can't reopen stderr: $!";
- exec($^X, (map { "-I$_" } @INC), File::Spec->catfile($Bin, $spec_name));
- die "couldn't exec '$spec_name'";
+ my ($fh,$filename) = File::Temp::tempfile('tmpfileXXXXXX', TMPDIR => 1);
+ close($fh);
+
+ open my $oldout, ">&STDOUT" or die "can't dup stdout: $!";
+ open my $olderr, ">&STDERR" or die "can't dup stderr: $!";
+ open(STDOUT, ">", $filename) || die "can't open '$filename' for out: $!";
+ open(STDERR, ">&STDOUT") || die "can't reopen stderr on stdout: $!";
+
+ system($^X, (map { "-I$_" } @INC), File::Spec->catfile($Bin, $spec_name));
+
+ open(STDERR, ">&", $olderr) || do {
+ print {$olderr} "can't reopen stderr: $! " . "at " . __FILE__ . " line " . __LINE__ . "\n";
+ exit(1);
};
- waitpid($pid,0);
- seek($fh, 0, 0);
+ open(STDOUT, ">&", $oldout) || die "can't reopen stdout: $!";
+ open($fh, "<", $filename) || die "can't open '$filename' for read: $!";
my $tap = do { local $/; <$fh> };
+ unlink($filename) || warn "can't unlink '$filename': $!";
return $tap;
}
View
2  t/uncompilable_spec.pl
@@ -9,6 +9,8 @@
#
use Test::Spec;
+use FindBin qw($Bin);
+BEGIN { require "$Bin/test_helper.pl" };
describe "Test::Spec";

No commit comments for this range

Something went wrong with that request. Please try again.