Permalink
Browse files

No fork tests on Windows.

Forking on Windows requires ithreads which precludes Devel::Cover.

Problem noted by Christian Walde.
  • Loading branch information...
1 parent 8bc24fd commit c6f17100a25e9071cd6566c6f810efec73453fe6 @pjcj committed Oct 15, 2011
Showing with 24 additions and 17 deletions.
  1. +20 −16 test_output/cover/exec_die.5.006001
  2. +4 −1 tests/exec_die
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/exec_die 50.0 50.0 n/a 0.0 44.4
-Total 50.0 50.0 n/a 0.0 44.4
+tests/exec_die 50.0 50.0 n/a 0.0 45.5
+Total 50.0 50.0 n/a 0.0 45.5
------------------------------------------ ------ ------ ------ ------ ------
@@ -20,40 +20,44 @@ tests/exec_die
line err stmt bran cond sub code
1 #!/usr/bin/perl
2
-3 # Copyright 2007-2011, Paul Johnson (pjcj@cpan.org)
+3 # Copyright 2011, Paul Johnson (pjcj@cpan.org)
4
5 # This software is free. It is licensed under the same terms as Perl itself.
6
7 # The latest version of this software should be available from my homepage:
8 # http://www.pjcj.net
9
-10 1 my $pid = fork;
-11
-12 *** 1 50 if ($pid)
-13 {
-14 1 wait;
-15 }
-16 else
-17 {
-18 *** 0 0 local *Devel::Cover::_report = sub { die "Badness happened!" };
+10 # __COVER__ skip_test $^O eq "MSWin32"
+11 # __COVER__ skip_reason Fork uses threads on Windows
+12
+13 *** 1 50 die unless defined ($pid = fork);
+14
+15 *** 1 50 if ($pid)
+16 {
+17 1 wait;
+18 }
+19 else
+20 {
+21 *** 0 0 local *Devel::Cover::_report = sub { die "Badness happened!" };
*** 0
-19 *** 0 exec "echo We want to be able to see this.";
-20 }
+22 *** 0 exec "echo We want to be able to see this.";
+23 }
Branches
--------
line err % true false branch
----- --- ------ ------ ------ ------
-12 *** 50 1 0 if ($pid) { }
+13 *** 50 0 1 unless defined($pid = fork)
+15 *** 50 1 0 if ($pid) { }
Uncovered Subroutines
---------------------
Subroutine Count Location
---------- ----- -----------------
-__ANON__ 0 tests/exec_die:18
+__ANON__ 0 tests/exec_die:21
View
@@ -7,7 +7,10 @@
# The latest version of this software should be available from my homepage:
# http://www.pjcj.net
-my $pid = fork;
+# __COVER__ skip_test $^O eq "MSWin32"
+# __COVER__ skip_reason Fork uses threads on Windows
+
+die unless defined ($pid = fork);
if ($pid)
{

0 comments on commit c6f1710

Please sign in to comment.