tagged release 0.6.4
[parrot.git] / t / steps / auto_gcc-10.t
blob68c6487666161be519d506d2e031cc972079c996
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_gcc-10.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  12;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::auto::gcc');
13 use Parrot::Configure;
14 use Parrot::Configure::Options qw( process_options );
15 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 my $args = process_options( {
18     argv            => [ ],
19     mode            => q{configure},
20 } );
22 my $conf = Parrot::Configure->new();
24 test_step_thru_runstep($conf, q{init::defaults}, $args);
26 my ($task, $step_name, $step, $ret);
27 my $pkg = q{auto::gcc};
29 $conf->add_steps($pkg);
30 $conf->options->set(%{$args});
31 $task = $conf->steps->[-1];
32 $step_name   = $task->step;
34 $step = $step_name->new();
35 ok(defined $step, "$step_name constructor returned defined value");
36 isa_ok($step, $step_name);
39 my $gnucref = {};
40 $gnucref->{__GNUC__} = q{abc123};
41 ok($step->_evaluate_gcc($conf, $gnucref),
42     "_evaluate_gcc() returned true value");
43 ok(! defined $conf->data->get( 'gccversion' ),
44     "gccversion undef as expected");
45 is($step->result(), q{no}, "Got expected result");
48 pass("Completed all tests in $0");
50 ################### DOCUMENTATION ###################
52 =head1 NAME
54 auto_gcc-10.t - test config::auto::gcc
56 =head1 SYNOPSIS
58     % prove t/steps/auto_gcc-10.t
60 =head1 DESCRIPTION
62 The files in this directory test functionality used by F<Configure.pl>.
64 The tests in this file test subroutines exported by config::auto::gcc.
66 =head1 AUTHOR
68 James E Keenan
70 =head1 SEE ALSO
72 config::auto::gcc, F<Configure.pl>.
74 =cut
76 # Local Variables:
77 #   mode: cperl
78 #   cperl-indent-level: 4
79 #   fill-column: 100
80 # End:
81 # vim: expandtab shiftwidth=4: