tagged release 0.6.4
[parrot.git] / t / steps / auto_warnings-01.t
blob1b64ff752617924b22bcd59a81cf93234031483a
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_warnings-01.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  21;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::init::hints');
13 use_ok('config::inter::progs');
14 use_ok('config::auto::warnings');
15 use Parrot::Configure;
16 use Parrot::Configure::Options qw( process_options );
17 use Parrot::Configure::Test qw( test_step_thru_runstep);
19 my $args = process_options(
20     {
21         argv => [ ],
22         mode => q{configure},
23     }
26 my $conf = Parrot::Configure->new;
28 test_step_thru_runstep( $conf, q{init::defaults}, $args );
29 test_step_thru_runstep( $conf, q{init::hints}, $args );
30 test_step_thru_runstep( $conf, q{inter::progs}, $args );
32 my $pkg = q{auto::warnings};
34 $conf->add_steps($pkg);
35 $conf->options->set( %{$args} );
37 my ( $task, $step_name, $step);
38 $task        = $conf->steps->[-1];
39 $step_name   = $task->step;
41 $step = $step_name->new();
42 ok( defined $step, "$step_name constructor returned defined value" );
43 isa_ok( $step, $step_name );
44 ok( $step->description(), "$step_name has description" );
46 my %potential_warnings_seen;
47 $conf->options->set(cage => 1);
48 $step->_add_cage_warnings($conf);
49 %potential_warnings_seen = map { $_, 1 } @{ $step->{potential_warnings} };
50 ok($potential_warnings_seen{'-std=c89'}, "Cage warning added");
54 pass("Completed all tests in $0");
56 ################### DOCUMENTATION ###################
58 =head1 NAME
60 auto_warnings-01.t - test config::auto::warnings
62 =head1 SYNOPSIS
64     % prove t/steps/auto_warnings-01.t
66 =head1 DESCRIPTION
68 The files in this directory test functionality used by F<Configure.pl>.
70 The tests in this file test aspects of config::auto::warnings.
72 =head1 AUTHOR
74 James E Keenan
76 =head1 SEE ALSO
78 config::auto::warnings, F<Configure.pl>.
80 =cut
82 # Local Variables:
83 #   mode: cperl
84 #   cperl-indent-level: 4
85 #   fill-column: 100
86 # End:
87 # vim: expandtab shiftwidth=4: