4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
17 use vars qw( %samples );
20 bailout => [qw( header test test test bailout )],
21 combined => ['header', ('test') x 10],
22 descriptive => ['header', ('test') x 5 ],
23 duplicates => ['header', ('test') x 11 ],
24 head_end => [qw( other test test test test
25 other header other other )],
26 head_fail => [qw( other test test test test
27 other header other other )],
28 no_nums => ['header', ('test') x 5 ],
29 out_of_order=> [('test') x 10, 'header', ('test') x 5],
30 simple => [qw( header test test test test test )],
31 simple_fail => [qw( header test test test test test )],
32 'skip' => [qw( header test test test test test )],
33 skipall => [qw( header )],
34 skipall_nomsg => [qw( header )],
35 skip_nomsg => [qw( header test )],
36 taint => [qw( header test )],
37 'todo' => [qw( header test test test test test )],
38 todo_inline => [qw( header test test test )],
39 vms_nit => [qw( header other test test )],
40 with_comments => [qw( other header other test other test test
41 test other other test other )],
43 plan tests => 2 + scalar keys %samples;
46 BEGIN { use_ok( 'Test::Harness::Straps' ); }
48 my $Curdir = File::Spec->curdir;
49 my $SAMPLE_TESTS = $ENV{PERL_CORE}
50 ? File::Spec->catdir($Curdir, 'lib', 'sample-tests')
51 : File::Spec->catdir($Curdir, 't', 'sample-tests');
53 my $strap = Test::Harness::Straps->new;
54 isa_ok( $strap, 'Test::Harness::Straps' );
57 my($self, $line, $type, $totals) = @_;
62 for my $test ( sort keys %samples ) {
63 my $expect = $samples{$test};
66 $strap->analyze_file(File::Spec->catfile($SAMPLE_TESTS, $test));
68 is_deeply(\@out, $expect, "$test callback");