Further corrects previously mentioned tests.
[catagits/Catalyst-Runtime.git] / t / optional_stress.t
CommitLineData
c7ded7aa 1use strict;
2use warnings;
3
4853fb50 4use Test::More;
5BEGIN {
6 plan skip_all => 'set TEST_STRESS to enable this test'
7 unless $ENV{TEST_STRESS};
8}
9
c7ded7aa 10use FindBin;
11use lib "$FindBin::Bin/lib";
c7ded7aa 12use Catalyst::Test 'TestApp';
c7ded7aa 13
14our ( $iters, $tests );
15
16BEGIN {
15f0ede8 17 eval "use YAML";
18 plan skip_all => 'YAML is required for this test' if $@;
19
c7ded7aa 20 $iters = $ENV{TEST_STRESS} || 10;
21 $tests = YAML::LoadFile("$FindBin::Bin/optional_stress.yml");
22
23 my $total_tests = 0;
24 map { $total_tests += scalar @{ $tests->{$_} } } keys %{$tests};
25 plan tests => $iters * $total_tests;
26}
27
28for ( 1 .. $iters ) {
29 run_tests();
30}
31
32sub run_tests {
33 foreach my $test_group ( keys %{$tests} ) {
34 foreach my $test ( @{ $tests->{$test_group} } ) {
35 ok( request($test), $test_group . ' - ' . $test );
36 }
37 }
38}