tagged release 0.6.4
[parrot.git] / t / steps / auto_warnings-08.t
blobe0a6c81ed1f09f3e02c71bcbdd9499114da163e0
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_warnings-08.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  22;
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);
18 use IO::CaptureOutput qw | capture |;
20 my $args = process_options(
21     {
22         argv => [ ],
23         mode => q{configure},
24     }
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 );
48     my ($stdout, $rv);
49     # Mock case where C compiler is not gcc.
50     $conf->data->set( gccversion => undef );
51     $conf->options->set( verbose => 1 );
52     capture(
53         sub { $rv = $step->runstep($conf); },
54         \$stdout,
55     );
56     ok($rv, "runstep() returned true value");
57     is($step->result(), q{skipped}, "Got expected result");
58     like($stdout,
59         qr/Currently we only set warnings/,
60         "Got expected verbose output"
61     );
64 pass("Completed all tests in $0");
66 ################### DOCUMENTATION ###################
68 =head1 NAME
70 auto_warnings-08.t - test config::auto::warnings
72 =head1 SYNOPSIS
74     % prove t/steps/auto_warnings-08.t
76 =head1 DESCRIPTION
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.
83 =head1 AUTHOR
85 James E Keenan
87 =head1 SEE ALSO
89 config::auto::warnings, F<Configure.pl>.
91 =cut
93 # Local Variables:
94 #   mode: cperl
95 #   cperl-indent-level: 4
96 #   fill-column: 100
97 # End:
98 # vim: expandtab shiftwidth=4: