Author: jkeenan Date: Tue Jan 1 07:55:59 2008 New Revision: 24410 Added: trunk/t/configure/102-init_defaults-04.t (contents, props changed) Modified: trunk/MANIFEST trunk/t/configure/102-init_defaults-03.t
Log: Add one test file to test previously uncovered condition in init::defaults. Modified: trunk/MANIFEST ============================================================================== --- trunk/MANIFEST (original) +++ trunk/MANIFEST Tue Jan 1 07:55:59 2008 @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Tue Jan 1 15:12:28 2008 UT +# generated by tools/dev/mk_manifest_and_skip.pl Tue Jan 1 15:54:51 2008 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -3094,6 +3094,7 @@ t/configure/102-init_defaults-01.t [] t/configure/102-init_defaults-02.t [] t/configure/102-init_defaults-03.t [] +t/configure/102-init_defaults-04.t [] t/configure/103-init_install-01.t [] t/configure/103-init_install-02.t [] t/configure/104-init_miniparrot-01.t [] Modified: trunk/t/configure/102-init_defaults-03.t ============================================================================== --- trunk/t/configure/102-init_defaults-03.t (original) +++ trunk/t/configure/102-init_defaults-03.t Tue Jan 1 07:55:59 2008 @@ -24,18 +24,13 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my $task = $conf->steps->[0]; +my $task = $conf->steps->[-1]; my $step_name = $task->step; my $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); isa_ok( $step, $step_name ); ok( $step->description(), "$step_name has description" ); -#my $ret = $step->runstep($conf); -#ok( defined $ret, "$step_name runstep() returned defined value" ); - -# RT#44451: Write a SKIP block which will test the one OS-specific branch in -# init::defaults. $conf->data->set( archname => 'x86_64' ); $conf->data->set( cc => 'cc' ); Added: trunk/t/configure/102-init_defaults-04.t ============================================================================== --- (empty file) +++ trunk/t/configure/102-init_defaults-04.t Tue Jan 1 07:55:59 2008 @@ -0,0 +1,94 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 102-init_defaults-03.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib ); +use_ok('config::init::defaults'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); + +my $pkg = q{init::defaults}; +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my $task = $conf->steps->[-1]; +my $step_name = $task->step; + +my $step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +$conf->data->set( archname => 'x86_64' ); +$conf->data->set( cc => 'cc' ); +$conf->data->set( cxx => 'c++' ); +$conf->data->set( link => 'cc' ); +$conf->data->set( ld => 'env cc' ); +$conf->data->set( ld_load_flags => '-bundle -L/usr/local/lib64' ); +$conf->data->set( ld_share_flags => '-bundle -L/usr/local/lib64' ); +$conf->data->set( ldflags => '-bundle -L/usr/local/lib64' ); +$conf->data->set( linkflags => '-bundle -L/usr/local/lib64' ); +ok(init::defaults::_64_bit_adjustments($conf), + "_64_bit_adjustments() returned true"); +is($conf->data->get( 'archname' ), 'x86_64', "Got expected value for 'archname'"); +is($conf->data->get( 'cc' ), 'cc', "Got expected value for 'cc'"); +is($conf->data->get( 'cxx' ), 'c++', "Got expected value for 'cxx'"); +is($conf->data->get( 'link' ), 'cc', "Got expected value for 'link'"); +is($conf->data->get( 'ld' ), 'env cc', "Got expected value for 'ld'"); +is($conf->data->get( 'ld_load_flags' ), '-bundle -L/usr/local/lib64', + "Got expected value for 'ld_load_flags'"); +is($conf->data->get( 'ld_share_flags' ), '-bundle -L/usr/local/lib64', + "Got expected value for 'ld_share_flags"); +is($conf->data->get( 'ldflags' ), '-bundle -L/usr/local/lib64', + "Got expected value for 'ldflags'"); +is($conf->data->get( 'linkflags' ), '-bundle -L/usr/local/lib64', + "Got expected value for 'linkflags'"); + +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +102-init_defaults-03.t - test config::init::defaults + +=head1 SYNOPSIS + + % prove t/configure/102-init_defaults-03.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test internal subroutine +config::init::defaults::_64_bit_adjustments(). + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::init::defaults, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: