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