tagged release 0.6.4
[parrot.git] / t / steps / init_defaults-04.t
blob8e5181b6e96cf77feec5da7d9c95ce1e6f20a65c
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # init_defaults-03.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  14;
9 use Carp;
10 use lib qw( lib );
11 use_ok('config::init::defaults');
12 use Parrot::Configure;
13 use Parrot::Configure::Options qw( process_options );
15 my $pkg  = q{init::defaults};
16 my $args = process_options(
17     {
18         argv => [ ],
19         mode => q{configure},
20     }
23 my $conf = Parrot::Configure->new;
24 $conf->add_steps($pkg);
25 $conf->options->set( %{$args} );
27 my $task        = $conf->steps->[-1];
28 my $step_name   = $task->step;
30 my $step = $step_name->new();
31 ok( defined $step, "$step_name constructor returned defined value" );
32 isa_ok( $step, $step_name );
35 $conf->data->set( archname => 'x86_64' );
36 $conf->data->set( cc => 'cc' );
37 $conf->data->set( cxx => 'c++' );
38 $conf->data->set( link => 'cc' );
39 $conf->data->set( ld => 'env cc' );
40 $conf->data->set( ld_load_flags => '-bundle -L/usr/local/lib64' );
41 $conf->data->set( ld_share_flags => '-bundle -L/usr/local/lib64' );
42 $conf->data->set( ldflags => '-bundle -L/usr/local/lib64' );
43 $conf->data->set( linkflags => '-bundle -L/usr/local/lib64' );
44 ok(init::defaults::_64_bit_adjustments($conf),
45     "_64_bit_adjustments() returned true");
46 is($conf->data->get( 'archname' ), 'x86_64', "Got expected value for 'archname'");
47 is($conf->data->get( 'cc' ), 'cc', "Got expected value for 'cc'");
48 is($conf->data->get( 'cxx' ), 'c++', "Got expected value for 'cxx'");
49 is($conf->data->get( 'link' ), 'cc', "Got expected value for 'link'");
50 is($conf->data->get( 'ld' ), 'env cc', "Got expected value for 'ld'");
51 is($conf->data->get( 'ld_load_flags' ), '-bundle -L/usr/local/lib64',
52     "Got expected value for 'ld_load_flags'");
53 is($conf->data->get( 'ld_share_flags' ), '-bundle -L/usr/local/lib64',
54     "Got expected value for 'ld_share_flags");
55 is($conf->data->get( 'ldflags' ), '-bundle -L/usr/local/lib64',
56     "Got expected value for 'ldflags'");
57 is($conf->data->get( 'linkflags' ), '-bundle -L/usr/local/lib64',
58     "Got expected value for 'linkflags'");
60 pass("Completed all tests in $0");
62 ################### DOCUMENTATION ###################
64 =head1 NAME
66 init_defaults-03.t - test config::init::defaults
68 =head1 SYNOPSIS
70     % prove t/steps/init_defaults-03.t
72 =head1 DESCRIPTION
74 The files in this directory test functionality used by F<Configure.pl>.
76 The tests in this file test internal subroutine
77 config::init::defaults::_64_bit_adjustments().
79 =head1 AUTHOR
81 James E Keenan
83 =head1 SEE ALSO
85 config::init::defaults, F<Configure.pl>.
87 =cut
89 # Local Variables:
90 #   mode: cperl
91 #   cperl-indent-level: 4
92 #   fill-column: 100
93 # End:
94 # vim: expandtab shiftwidth=4: