X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F50-threads.t;h=925b8bb44b04549dfbad85bae5662409788f527c;hb=f424a623070821112b8dd42506aa772ad19f22bb;hp=258bf08f8ab15fb1dbd8f41e16c3c496db5c13d7;hpb=2f09368e79cc5a25515ba2845ce3afd8875c7f6e;p=perl%2Fmodules%2Fautovivification.git diff --git a/t/50-threads.t b/t/50-threads.t index 258bf08..925b8bb 100644 --- a/t/50-threads.t +++ b/t/50-threads.t @@ -27,7 +27,16 @@ BEGIN { require autovivification; skipall 'This autovivification isn\'t thread safe' unless autovivification::A_THREADSAFE(); - plan tests => 10 * 2 * 3 * (1 + 2); +} + +my ($threads, $runs); +BEGIN { + $threads = 10; + $runs = 2; +} + +BEGIN { + plan tests => $threads * $runs * 3 * (1 + 2); defined and diag "Using threads $_" for $threads::VERSION; } @@ -37,7 +46,7 @@ BEGIN { sub try { my $tid = threads->tid(); - for my $run (1 .. 2) { + for my $run (1 .. $runs) { { my $x; my $y = $x->{foo}; @@ -81,5 +90,5 @@ SKIP: } } -my @t = map threads->create(\&try), 1 .. 10; +my @t = map threads->create(\&try), 1 .. $threads; $_->join for @t;