2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 13;
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 => [ q{--miniparrot} ],
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);
40 $gnucref->{__GNUC__} = q{3};
41 $gnucref->{__GNUC_MINOR__} = q{1};
42 ok($step->_evaluate_gcc($conf, $gnucref),
43 "_evaluate_gcc() returned true value");
44 ok(! defined $conf->data->get( 'gccversion' ),
45 "gccversion undefined as expected");
46 is($conf->data->get( 'ccwarn' ), q{-ansi -pedantic},
47 "ccwarn set as expected for miniparrot");
48 is($step->result(), q{yes}, "Got expected result");
51 pass("Completed all tests in $0");
53 ################### DOCUMENTATION ###################
57 auto_gcc-12.t - test config::auto::gcc
61 % prove t/steps/auto_gcc-12.t
65 The files in this directory test functionality used by F<Configure.pl>.
67 The tests in this file test subroutines exported by config::auto::gcc.
75 config::auto::gcc, F<Configure.pl>.
81 # cperl-indent-level: 4
84 # vim: expandtab shiftwidth=4: