Add ARM files
[dh-make-perl] / dev / arm / libtest-harness-perl / libtest-harness-perl-3.12 / t / parser-config.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if ( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = ( '../lib', 'lib' );
7     }
8     else {
9         unshift @INC, 't/lib';
10     }
11 }
12
13 use strict;
14 use vars qw(%INIT %CUSTOM);
15
16 use Test::More tests => 11;
17 use File::Spec::Functions qw( catfile );
18 use TAP::Parser;
19
20 use_ok('MySource');
21 use_ok('MyPerlSource');
22 use_ok('MyGrammar');
23 use_ok('MyIteratorFactory');
24 use_ok('MyResultFactory');
25
26 my $t_dir = $ENV{PERL_CORE} ? 'lib' : 't';
27 my $source = catfile( $t_dir, 'source_tests', 'source' );
28 my %customize = (
29     source_class           => 'MySource',
30     perl_source_class      => 'MyPerlSource',
31     grammar_class          => 'MyGrammar',
32     iterator_factory_class => 'MyIteratorFactory',
33     result_factory_class   => 'MyResultFactory',
34 );
35 my $p = TAP::Parser->new(
36     {   source => $source,
37         %customize,
38     }
39 );
40 ok( $p, 'new customized parser' );
41
42 foreach my $key ( keys %customize ) {
43     is( $p->$key(), $customize{$key}, "customized $key" );
44 }
45
46 # TODO: make sure these things are propogated down through the parser...