From 6877ae7874cff29b460459d8ab0ee8dca38bed49 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Sat, 29 Nov 2014 12:52:13 +0000 Subject: [PATCH] Skip tests requiring fork() when no fork() is available If you build perl on Windows without -DPERL_IMPLICIT_SYS (which I do, in order to enable -DPEL_MALLOC, which seems faster than using the system malloc()) then you don't get the fork() emulation and several of Filesys-Notify-Simple's tests fail. This commit skips those tests in the same manner as various other CPAN modules do in this case. This allows a normal "cpan install ..." of Filesys-Notify-Simple or anything depending on it (e.g. Plack) to succeed without having to "force" anything. --- t/move.t | 7 +++++++ t/rm_create.t | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/t/move.t b/t/move.t index 6779517..4ef0cbc 100644 --- a/t/move.t +++ b/t/move.t @@ -1,4 +1,5 @@ use strict; +use Config; use Filesys::Notify::Simple; use Test::More; use Test::SharedFork; @@ -6,6 +7,12 @@ use File::Temp qw( tempdir ); use FindBin; +plan skip_all => "fork not supported on this platform" + unless $Config::Config{d_fork} || $Config::Config{d_pseudofork} || + (($^O eq 'MSWin32' || $^O eq 'NetWare') and + $Config::Config{useithreads} and + $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); + plan tests => 2; my $dir = tempdir( DIR => "$FindBin::Bin/x" ); diff --git a/t/rm_create.t b/t/rm_create.t index 55dfd37..41ce486 100644 --- a/t/rm_create.t +++ b/t/rm_create.t @@ -1,4 +1,5 @@ use strict; +use Config; use Filesys::Notify::Simple; use Test::More; use Test::SharedFork; @@ -7,6 +8,11 @@ use File::Temp qw( tempdir ); my $dir = tempdir( DIR => "$FindBin::Bin/x" ); +plan skip_all => "fork not supported on this platform" + unless $Config::Config{d_fork} || $Config::Config{d_pseudofork} || + (($^O eq 'MSWin32' || $^O eq 'NetWare') and + $Config::Config{useithreads} and + $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); plan tests => 2;