2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 14;
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(
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 ###################
66 init_defaults-03.t - test config::init::defaults
70 % prove t/steps/init_defaults-03.t
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().
85 config::init::defaults, F<Configure.pl>.
91 # cperl-indent-level: 4
94 # vim: expandtab shiftwidth=4: