Tried installing Moose 0.78 this evening on Windows... everything passed
fine except for t/010_basics/020-global-destruction.t

With the prodding & help of Sartak and doy, I came up with a probable patch
(attached)

Rob
From 5c2f0c93f332edff2c41714e728af14c48ba4455 Mon Sep 17 00:00:00 2001
From: robertkrimen <robertkri...@gmail.com>
Date: Wed, 13 May 2009 02:08:47 -0700
Subject: [PATCH] Refactored 010_basics/020-global-destruction.t to use external .pl to pass on Windows (fork problem?)

---
 t/010_basics/020-global-destruction-helper.pl |   23 +++++++++++++++++++++++
 t/010_basics/020-global-destruction.t         |    8 ++------
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 t/010_basics/020-global-destruction-helper.pl

diff --git a/t/010_basics/020-global-destruction-helper.pl b/t/010_basics/020-global-destruction-helper.pl
new file mode 100644
index 0000000..882cc46
--- /dev/null
+++ b/t/010_basics/020-global-destruction-helper.pl
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+my $builder = Test::More->builder;
+$builder->no_header(1);
+$builder->no_plan;
+$builder->current_test(1);
+
+package Foo;
+use Moose;
+
+sub DEMOLISH {
+    my $self = shift;
+    my ($igd) = @_;
+    ::is($igd, 1,
+         "in_global_destruction state is passed to DEMOLISH properly");
+}
+
+package main;
+our $foo = Foo->new;
diff --git a/t/010_basics/020-global-destruction.t b/t/010_basics/020-global-destruction.t
index f4b6877..290f6ae 100644
--- a/t/010_basics/020-global-destruction.t
+++ b/t/010_basics/020-global-destruction.t
@@ -20,14 +20,10 @@ package main;
 {
     my $foo = Foo->new;
 }
-$expected_igd = 1;
 # Test::Builder checks for a valid plan at END time, which is before global
 # destruction, so need to test that in a subprocess
-unless (fork) {
-    our $foo = Foo->new;
-    exit;
-}
-wait;
+# $expected_igd = 1 for the following test
+system( $^X, "t/010_basics/020-global-destruction-helper.pl" );
 # but stuff that happens in a subprocess doesn't update Test::Builder's state
 # in this process, so do that manually here
 my $builder = Test::More->builder;
-- 
1.5.6.3

Reply via email to