2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 22;
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);
18 use IO::CaptureOutput qw | capture |;
20 my $args = process_options(
27 my $conf = Parrot::Configure->new;
29 test_step_thru_runstep( $conf, q{init::defaults}, $args );
30 test_step_thru_runstep( $conf, q{init::hints}, $args );
31 test_step_thru_runstep( $conf, q{inter::progs}, $args );
33 my $pkg = q{auto::warnings};
35 $conf->add_steps($pkg);
36 $conf->options->set( %{$args} );
38 my ( $task, $step_name, $step);
39 $task = $conf->steps->[-1];
40 $step_name = $task->step;
42 $step = $step_name->new();
43 ok( defined $step, "$step_name constructor returned defined value" );
44 isa_ok( $step, $step_name );
49 # Mock case where C compiler is not gcc.
50 $conf->data->set( gccversion => undef );
51 $conf->options->set( verbose => 1 );
53 sub { $rv = $step->runstep($conf); },
56 ok($rv, "runstep() returned true value");
57 is($step->result(), q{skipped}, "Got expected result");
59 qr/Currently we only set warnings/,
60 "Got expected verbose output"
64 pass("Completed all tests in $0");
66 ################### DOCUMENTATION ###################
70 auto_warnings-08.t - test config::auto::warnings
74 % prove t/steps/auto_warnings-08.t
78 The files in this directory test functionality used by F<Configure.pl>.
80 The tests in this file test config::auto::warnings when the C compiler
81 being used is not I<gcc> and when C<--verbose> option has been selected.
89 config::auto::warnings, F<Configure.pl>.
95 # cperl-indent-level: 4
98 # vim: expandtab shiftwidth=4: