Skip Menu |

This queue is for tickets about the Test-NoWarnings CPAN distribution.

Report information
The Basics
Id: 77352
Status: open
Priority: 0/
Queue: Test-NoWarnings

People
Owner: Nobody in particular
Requestors: shay [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.04
Fixed in: (no value)



Subject: [PATCH] Skip test using fork() when fork() is not available
The t/06_fork.t test uses fork() and therefore fails when using a perl which does not have fork() implemented, e.g. on a Windows system when perl is built without PERL_IMPLICIT_SYS defined. The attached patch arranges for all the tests to be skipped in this case, using an idiom borrowed from a fork() test in Test-Simple, and also checking for (the fairly recently added) d_pseudofork option too.
Subject: Test-NoWarnings-fork.patch
diff -ruN Test-NoWarnings-1.04.orig/t/06_fork.t Test-NoWarnings-1.04/t/06_fork.t --- Test-NoWarnings-1.04.orig/t/06_fork.t 2011-12-01 00:18:48.000000000 +0000 +++ Test-NoWarnings-1.04/t/06_fork.t 2012-05-22 08:54:52.301816300 +0100 @@ -1,7 +1,20 @@ #!/usr/bin/perl use strict; -use Test::More tests => 2; +use Config; +use Test::More; +BEGIN { + my $can_fork = $Config{d_fork} || $Config{d_pseudofork} || + (($^O eq 'MSWin32' || $^O eq 'NetWare') and + $Config{useithreads} and + $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); + if ($can_fork) { + plan tests => 2; + } + else { + plan skip_all => 'This system cannot fork'; + } +} use Test::NoWarnings; pass("just testing");
On Tue May 22 04:04:14 2012, SHAY wrote: Show quoted text
> The t/06_fork.t test uses fork() and therefore fails when using a perl > which does not have fork() implemented, e.g. on a Windows system when > perl is built without PERL_IMPLICIT_SYS defined. > > The attached patch arranges for all the tests to be skipped in this > case, using an idiom borrowed from a fork() test in Test-Simple, and > also checking for (the fairly recently added) d_pseudofork option too.
This is still a problem today. -------------------------------------- Reading 'C:\Documents and Settings\Owner\.cpan\Metadata' Database was generated on Sat, 31 May 2014 17:53:01 GMT Running install for module 'Test::NoWarnings' Checksum for C:\Documents and Settings\Owner\.cpan\sources\authors\id\A\AD\ADAMK \Test-NoWarnings-1.04.tar.gz ok 'YAML' not installed, will not store persistent state Configuring A/AD/ADAMK/Test-NoWarnings-1.04.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a nmake-style Makefile Writing Makefile for Test::NoWarnings Writing MYMETA.yml and MYMETA.json ADAMK/Test-NoWarnings-1.04.tar.gz C:\perl521\nosys\bin\perl.exe Makefile.PL -- OK Running make for A/AD/ADAMK/Test-NoWarnings-1.04.tar.gz Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. cp lib/Test/NoWarnings/Warning.pm blib\lib\Test\NoWarnings\Warning.pm cp lib/Test/NoWarnings.pm blib\lib\Test\NoWarnings.pm ADAMK/Test-NoWarnings-1.04.tar.gz "C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.EXE" -- OK Running make test Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. C:\perl521\nosys\bin\perl.exe "-MExtUtils::Command::MM" "-MTest::Harness " "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch') " t/*.t t/01_compile.t ... ok t/02_none.t ...... ok t/03_end.t ....... ok t/04_no_tests.t .. ok t/05_no_end.t .... ok t/06_fork.t ...... The fork function is unimplemented at t/06_fork.t line 10. t/06_fork.t ...... 1/2 # Looks like your test exited with 255 just after 2. t/06_fork.t ...... Dubious, test returned 255 (wstat 65280, 0xff00) All 2 subtests passed Test Summary Report ------------------- t/06_fork.t (Wstat: 65280 Tests: 2 Failed: 0) Non-zero exit status: 255 Files=6, Tests=46, 0 wallclock secs ( 0.08 usr + 0.01 sys = 0.09 CPU) Result: FAIL Failed 1/6 test programs. 0/46 subtests failed. NMAKE : fatal error U1077: 'C:\perl521\nosys\bin\perl.exe' : return code '0xff' Stop. ADAMK/Test-NoWarnings-1.04.tar.gz "C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.EXE" test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports ADAMK/Test-NoWarnings-1.04.tar.gz -------------------------------