tagged release 0.6.4
[parrot.git] / t / steps / init_optimize-04.t
blob8e86f91962505155d6db174d7bb8e118972b9735
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # init_optimize-04.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  10;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::init::optimize');
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     {
19         argv => [q{--optimize=O2}],
20         mode => q{configure},
21     }
24 my $conf = Parrot::Configure->new();
26 test_step_thru_runstep( $conf, q{init::defaults}, $args );
28 my ( $task, $step_name, $step, $ret );
29 my $pkg = q{init::optimize};
31 $conf->add_steps($pkg);
32 $conf->options->set( %{$args} );
33 $task        = $conf->steps->[-1];
34 $step_name   = $task->step;
36 $step = $step_name->new();
37 ok( defined $step, "$step_name constructor returned defined value" );
38 isa_ok( $step, $step_name );
41 $ret = $step->runstep($conf);
42 ok( defined $ret, "$step_name runstep() returned defined value" );
45 pass("Completed all tests in $0");
47 ################### DOCUMENTATION ###################
49 =head1 NAME
51 init_optimize-04.t - test config::init::optimize
53 =head1 SYNOPSIS
55     % prove t/steps/init_optimize-04.t
57 =head1 DESCRIPTION
59 The files in this directory test functionality used by F<Configure.pl>.
61 The tests in this file test subroutines exported by
62 config::init::optimize in the case where a specific optimization is
63 passed as the value of C<--optimize>.
65 =head1 AUTHOR
67 James E Keenan
69 =head1 SEE ALSO
71 config::init::optimize, F<Configure.pl>.
73 =cut
75 # Local Variables:
76 #   mode: cperl
77 #   cperl-indent-level: 4
78 #   fill-column: 100
79 # End:
80 # vim: expandtab shiftwidth=4: