Permalink
Browse files

arggghhhhhhh Test::Fork is schwern's namespace! renamed to Test::Shar…

…edFork
  • Loading branch information...
1 parent c4430c6 commit f9e1f2d258a435caeea79babe2eab793c7e4442f @tokuhirom tokuhirom committed Mar 25, 2009
View
@@ -1,4 +1,4 @@
-Revision history for Perl extension Test::Fork
+Revision history for Perl extension Test::SharedFork
0.01 Wed Mar 25 14:06:28 2009
- original version
View
@@ -1,6 +1,6 @@
use inc::Module::Install;
-name 'Test-Fork';
-all_from 'lib/Test/Fork.pm';
+name 'Test-SharedFork';
+all_from 'lib/Test/SharedFork.pm';
requires 'IPC::ShareLite' => 0.17;
View
10 README
@@ -1,11 +1,11 @@
-This is Perl module Test::Fork.
+This is Perl module Test::SharedFork.
INSTALLATION
-Test::Fork installation is straightforward. If your CPAN shell is set up,
+Test::SharedFork installation is straightforward. If your CPAN shell is set up,
you should just be able to do
- % cpan Test::Fork
+ % cpan Test::SharedFork
Download it, unpack it, then build it as per the usual:
@@ -18,9 +18,9 @@ Then install it:
DOCUMENTATION
-Test::Fork documentation is available as in POD. So you can do:
+Test::SharedFork documentation is available as in POD. So you can do:
- % perldoc Test::Fork
+ % perldoc Test::SharedFork
to read the documentation online with your favorite pager.
@@ -1,19 +1,19 @@
-package Test::Fork;
+package Test::SharedFork;
use strict;
use warnings;
our $VERSION = '0.01';
use Test::Builder;
-use Test::Fork::Scalar;
-use Test::Fork::Array;
-use Test::Fork::Store;
+use Test::SharedFork::Scalar;
+use Test::SharedFork::Array;
+use Test::SharedFork::Store;
use IPC::ShareLite ':lock';
use Storable ();
our $TEST;
sub import {
$TEST = Test::Builder->new();
- my $store = Test::Fork::Store->new();
+ my $store = Test::SharedFork::Store->new();
$store->lock_cb(sub {
$store->{share}->store(Storable::nfreeze(+{
array => [],
@@ -37,9 +37,9 @@ sub child {
}
sub _setup {
- my $store = Test::Fork::Store->new();
- tie $TEST->{Curr_Test}, 'Test::Fork::Scalar', 0, $store;
- tie @{$TEST->{Test_Results}}, 'Test::Fork::Array', $store;
+ my $store = Test::SharedFork::Store->new();
+ tie $TEST->{Curr_Test}, 'Test::SharedFork::Scalar', 0, $store;
+ tie @{$TEST->{Test_Results}}, 'Test::SharedFork::Array', $store;
no strict 'refs';
no warnings 'redefine';
@@ -66,21 +66,21 @@ __END__
=head1 NAME
-Test::Fork - fork test
+Test::SharedFork - fork test
=head1 SYNOPSIS
use Test::More tests => 200;
- use Test::Fork;
+ use Test::SharedFork;
my $pid = fork();
if ($pid == 0) {
# child
- Test::Fork->child;
+ Test::SharedFork->child;
ok 1, "child $_" for 1..100;
} elsif ($pid) {
# parent
- Test::Fork->parent;
+ Test::SharedFork->parent;
ok 1, "parent $_" for 1..100;
waitpid($pid, 0);
} else {
@@ -89,7 +89,7 @@ Test::Fork - fork test
=head1 DESCRIPTION
-Test::Fork is utility module for Test::Builder.
+Test::SharedFork is utility module for Test::Builder.
This module makes forking test!
This module merges test count with parent process & child process.
@@ -118,7 +118,7 @@ yappo
=head1 SEE ALSO
-L<Test::TCP>
+L<Test::TCP>, L<Test::Fork>, L<Test::MultipleFork>
=head1 LICENSE
@@ -1,4 +1,4 @@
-package Test::Fork::Array;
+package Test::SharedFork::Array;
use strict;
use warnings;
use base 'Tie::Array';
@@ -1,4 +1,4 @@
-package Test::Fork::Scalar;
+package Test::SharedFork::Scalar;
use strict;
use warnings;
use base 'Tie::Scalar';
@@ -1,4 +1,4 @@
-package Test::Fork::Store;
+package Test::SharedFork::Store;
use strict;
use warnings;
use IPC::ShareLite ':lock';
View
@@ -1,4 +1,4 @@
use strict;
use Test::More tests => 1;
-BEGIN { use_ok 'Test::Fork' }
+BEGIN { use_ok 'Test::SharedFork' }
View
@@ -1,12 +1,12 @@
use strict;
use warnings;
use Test::More tests => 42;
-use Test::Fork;
+use Test::SharedFork;
my $pid = fork();
if ($pid == 0) {
# child
- Test::Fork->child;
+ Test::SharedFork->child;
my $i = 0;
for (1..20) {
@@ -18,7 +18,7 @@ if ($pid == 0) {
exit;
} elsif ($pid) {
# parent
- Test::Fork->parent;
+ Test::SharedFork->parent;
my $i = 0;
for (1..20) {
View
@@ -7,5 +7,5 @@ all_pod_files_spelling_ok('lib');
__DATA__
Tokuhiro Matsuno
tokuhirom slkjfd gmail.com
-Test::Fork
+Test::SharedFork
yappo

0 comments on commit f9e1f2d

Please sign in to comment.