On Thu Jan 03 19:42:16 2008, [EMAIL PROTECTED] wrote: [snip] > What remains is: > (1) Eliminate code from Parrot::Configure and Parrot::Configure::Step > that was used to process the 'args' attribute. > (2) Adjust documentation in those modules and in docs/configuration.pod.
The patch attached tackles these two steps in the process. I'll apply it in 2-3 days unless someone objects, then proceed to step (3). kid51
Index: docs/configuration.pod =================================================================== --- docs/configuration.pod (revision 24563) +++ docs/configuration.pod (working copy) @@ -102,7 +102,6 @@ my $self = shift; my %data; $data{description} = q{This is the step description}; - $data{args} = [ qw( optional arguments ) ]; $data{result} = q{}; return \%data; } @@ -137,16 +136,6 @@ Determining if your compiler supports computed goto...done. -=item C<args> - -Returns a list of the names of any command-line arguments the step cares about. -Command-line arguments are standardized in F<Configure.pl>; this will be -described L<later|/"Command-line Arguments"> in more detail. - -I<XXX> Note that this method is currently unused but will be used in the futher -to register acceptable CLI parameters. New steps should continue to define -this method. - =item C<result> The C<result> is initialized to an empty string mainly to quiet @@ -160,8 +149,6 @@ Otherwise, the step should simply C<return>, I<i.e.>, return an undefined value. -I<XXX> In the near future there will be a means of passing additional parameters. - =back The configuration system won't execute your step by default unless it's @@ -178,7 +165,7 @@ use strict; use warnings; - use vars qw($description $result @args); + use vars qw($description $result); use base qw(Parrot::Configure::Step); @@ -188,7 +175,6 @@ my $self = shift; my %data; $data{description} = q{This is the step description}; - $data{args} = [ qw( optional arguments ) ]; $data{result} = q{}; return \%data; } @@ -238,9 +224,6 @@ object stored inside the L<Parrot::Configure> object. The options data object may be accessed via the L<Parrot::Configure/options> method. -Steps use the C<args> method to list any options they're interested in. They -should be listed without the dashes. - =head2 Building Up Configuration Data The second step is F<config/init/defaults.pm>, which sets up some defaults in a Index: MANIFEST =================================================================== --- MANIFEST (revision 24563) +++ MANIFEST (working copy) @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Sat Jan 5 14:38:15 2008 UT +# generated by tools/dev/mk_manifest_and_skip.pl Sat Jan 5 15:24:36 2008 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -3061,7 +3061,6 @@ t/configure/011-no_description.t [] t/configure/012-verbose.t [] t/configure/013-die.t [] -t/configure/014-params.t [] t/configure/015-no_return.t [] t/configure/016-no_return_but_result.t [] t/configure/017-revision_no_DEVELOPING.t [] Index: lib/Parrot/Configure/Step.pm =================================================================== --- lib/Parrot/Configure/Step.pm (revision 24563) +++ lib/Parrot/Configure/Step.pm (working copy) @@ -68,20 +68,6 @@ return $self->{description}; } -=item * C<args()> - -Accepts no arguments. In list context, returns a list of elements held in the -C<args> attribute set in the C<_init()> initializer in the inheriting class's -namespace. In scalar context, returns a reference to an array holding that -same list. - -=cut - -sub args { - my $self = shift; - return wantarray ? @{$self->{args}} : $self->{args}; -} - =item * C<set_result()> Accepts a scalar value and assigns it to the inheriting class's C<$result> @@ -116,7 +102,7 @@ =head1 SEE ALSO F<docs/configuration.pod>, L<Parrot::Configure>, L<Parrot::Configure::Data>, -L<Parrot::Configure::Step> +L<Parrot::Configure::Compiler> =cut Index: lib/Parrot/Configure/Test.pm =================================================================== --- lib/Parrot/Configure/Test.pm (revision 24563) +++ lib/Parrot/Configure/Test.pm (working copy) @@ -23,14 +23,13 @@ sub test_step_thru_runstep { my ( $conf, $pkg, $args ) = @_; - my ( $task, $step_name, @step_params, $step, $ret ); + my ( $task, $step_name, $step, $ret ); $conf->add_steps($pkg); $conf->options->set( %{$args} ); $task = $conf->steps->[ stepnum() ]; $step_name = $task->step; - @step_params = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: lib/Parrot/Configure.pm =================================================================== --- lib/Parrot/Configure.pm (revision 24563) +++ lib/Parrot/Configure.pm (working copy) @@ -48,7 +48,6 @@ struct( 'Parrot::Configure::Task' => { step => '$', - params => '@', object => 'Parrot::Configure::Step', }, ); @@ -175,12 +174,11 @@ =cut sub add_step { - my ( $conf, $step, @params ) = @_; + my ( $conf, $step ) = @_; push @{ $conf->{steps} }, Parrot::Configure::Task->new( step => $step, - params => [EMAIL PROTECTED], ); return 1; @@ -354,7 +352,6 @@ my $args = shift; my $step_name = $args->{task}->step; - my @step_params = @{ $args->{task}->params }; eval "use $step_name;"; die $@ if $@; @@ -399,15 +396,7 @@ my $ret; # When successful, a Parrot configuration step now returns 1 - eval { - if (@step_params) - { - $ret = $step->runstep( $conf, @step_params ); - } - else { - $ret = $step->runstep($conf); - } - }; + eval { $ret = $step->runstep($conf); }; if ($@) { carp "\nstep $step_name died during execution: [EMAIL PROTECTED]"; return; Index: Configure.pl =================================================================== --- Configure.pl (revision 24563) +++ Configure.pl (working copy) @@ -3,6 +3,73 @@ # Copyright (C) 2001-2007, The Perl Foundation. # $Id$ +use 5.008_000; +use strict; +use warnings; +use lib 'lib'; + +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Options::Test; +use Parrot::Configure::Messages qw( + print_introduction + print_conclusion +); +use Parrot::Configure::Step::List qw( get_steps_list ); + +$| = 1; # $OUTPUT_AUTOFLUSH = 1; + +# Install Option text was taken from: +# +# autoconf (GNU Autoconf) 2.59 +# Written by David J. MacKenzie and Akim Demaille. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# from Parrot::Configure::Options +my $args = process_options( + { + mode => 'configure', + argv => [EMAIL PROTECTED], + } +); +exit(1) unless defined $args; + +my $opttest = Parrot::Configure::Options::Test->new($args); + +# configuration tests will only be run if you requested them +# as command-line option +$opttest->run_configure_tests(); + +my $parrot_version = $Parrot::Configure::Options::Conf::parrot_version; + +# from Parrot::Configure::Messages +print_introduction($parrot_version); + +my $conf = Parrot::Configure->new; + +# from Parrot::Configure::Step::List +$conf->add_steps( get_steps_list() ); + +# from Parrot::Configure::Data +$conf->options->set( %{$args} ); + +# Run the actual steps +# from Parrot::Configure +$conf->runsteps or exit(1); + +# build tests will only be run if you requested them +# as command-line option +$opttest->run_build_tests(); + +my $make = $conf->data->get('make'); +# from Parrot::Configure::Messages +( print_conclusion( $conf, $make ) ) ? exit 0 : exit 1; + +################### DOCUMENTATION ################### + =head1 NAME Configure.pl - Parrot's Configuration Script @@ -291,73 +358,6 @@ =cut -use 5.008_000; -use strict; -use warnings; -use lib 'lib'; - -use Parrot::Configure; -use Parrot::Configure::Options qw( process_options ); -use Parrot::Configure::Options::Test; -use Parrot::Configure::Messages qw( - print_introduction - print_conclusion -); -use Parrot::Configure::Step::List qw( get_steps_list ); - -$| = 1; # $OUTPUT_AUTOFLUSH = 1; - -# Install Option text was taken from: -# -# autoconf (GNU Autoconf) 2.59 -# Written by David J. MacKenzie and Akim Demaille. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# from Parrot::Configure::Options -my $args = process_options( - { - mode => 'configure', - argv => [EMAIL PROTECTED], - } -); -exit(1) unless defined $args; - -my $opttest = Parrot::Configure::Options::Test->new($args); - -# configuration tests will only be run if you requested them -# as command-line option -$opttest->run_configure_tests(); - -my $parrot_version = $Parrot::Configure::Options::Conf::parrot_version; - -# from Parrot::Configure::Messages -print_introduction($parrot_version); - -my $conf = Parrot::Configure->new; - -# from Parrot::Configure::Step::List -$conf->add_steps( get_steps_list() ); - -# from Parrot::Configure::Data -$conf->options->set( %{$args} ); - -# Run the actual steps -# from Parrot::Configure -$conf->runsteps or exit(1); - -# build tests will only be run if you requested them -# as command-line option -$opttest->run_build_tests(); - -my $make = $conf->data->get('make'); -# from Parrot::Configure::Messages -( print_conclusion( $conf, $make ) ) ? exit 0 : exit 1; - -################### DOCUMENTATION ################### - # Local Variables: # mode: cperl # cperl-indent-level: 4 Index: t/configure/132-auto_arch-01.t =================================================================== --- t/configure/132-auto_arch-01.t (revision 24563) +++ t/configure/132-auto_arch-01.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/046-inter.t =================================================================== --- t/configure/046-inter.t (revision 24563) +++ t/configure/046-inter.t (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/047-inter.t =================================================================== --- t/configure/047-inter.t (revision 24563) +++ t/configure/047-inter.t (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 15; +use Test::More tests => 14; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/132-auto_arch-05.t =================================================================== --- t/configure/132-auto_arch-05.t (revision 24563) +++ t/configure/132-auto_arch-05.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/132-auto_arch-09.t =================================================================== --- t/configure/132-auto_arch-09.t (revision 24563) +++ t/configure/132-auto_arch-09.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/133-auto_cpu-02.t =================================================================== --- t/configure/133-auto_cpu-02.t (revision 24563) +++ t/configure/133-auto_cpu-02.t (working copy) @@ -31,10 +31,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[-1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/043-verbose_step_name.t =================================================================== --- t/configure/043-verbose_step_name.t (revision 24563) +++ t/configure/043-verbose_step_name.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,8 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); +#is( ref( $confsteps[0]->params ), +# 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/015-no_return.t =================================================================== --- t/configure/015-no_return.t (revision 24563) +++ t/configure/015-no_return.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 13; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/142-auto_aio-01.t =================================================================== --- t/configure/142-auto_aio-01.t (revision 24563) +++ t/configure/142-auto_aio-01.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/132-auto_arch-10.t =================================================================== --- t/configure/132-auto_arch-10.t (revision 24563) +++ t/configure/132-auto_arch-10.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/013-die.t =================================================================== --- t/configure/013-die.t (revision 24563) +++ t/configure/013-die.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/011-no_description.t =================================================================== --- t/configure/011-no_description.t (revision 24563) +++ t/configure/011-no_description.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/132-auto_arch-02.t =================================================================== --- t/configure/132-auto_arch-02.t (revision 24563) +++ t/configure/132-auto_arch-02.t (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More qw(no_plan); # tests => 13; +use Test::More tests => 14; use Carp; use lib qw( lib t/configure/testlib ); use_ok('config::init::defaults'); @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/132-auto_arch-06.t =================================================================== --- t/configure/132-auto_arch-06.t (revision 24563) +++ t/configure/132-auto_arch-06.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/005-run_one_step.t =================================================================== --- t/configure/005-run_one_step.t (revision 24563) +++ t/configure/005-run_one_step.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 21; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -59,8 +59,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/133-auto_cpu-03.t =================================================================== --- t/configure/133-auto_cpu-03.t (revision 24563) +++ t/configure/133-auto_cpu-03.t (working copy) @@ -31,10 +31,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[-1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/008-verbose_step_number.t =================================================================== --- t/configure/008-verbose_step_number.t (revision 24563) +++ t/configure/008-verbose_step_number.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/142-auto_aio-02.t =================================================================== --- t/configure/142-auto_aio-02.t (revision 24563) +++ t/configure/142-auto_aio-02.t (working copy) @@ -31,10 +31,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/132-auto_arch-11.t =================================================================== --- t/configure/132-auto_arch-11.t (revision 24563) +++ t/configure/132-auto_arch-11.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/009-verbose_step_regex.t =================================================================== --- t/configure/009-verbose_step_regex.t (revision 24563) +++ t/configure/009-verbose_step_regex.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/048-return_result_undef.t =================================================================== --- t/configure/048-return_result_undef.t (revision 24563) +++ t/configure/048-return_result_undef.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 13; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/014-params.t =================================================================== --- t/configure/014-params.t (revision 24563) +++ t/configure/014-params.t (working copy) @@ -1,104 +0,0 @@ -#! perl -# Copyright (C) 2007, The Perl Foundation. -# $Id$ -# 014-params.t - -use strict; -use warnings; - -use Test::More tests => 13; -use Carp; -use lib qw( lib t/configure/testlib ); -use Parrot::Configure; -use Parrot::Configure::Options qw( process_options ); -use IO::CaptureOutput qw | capture |; - -$| = 1; -is( $|, 1, "output autoflush is set" ); - -my $args = process_options( - { - argv => [], - mode => q{configure}, - } -); -ok( defined $args, "process_options returned successfully" ); -my %args = %$args; - -my $conf = Parrot::Configure->new; -ok( defined $conf, "Parrot::Configure->new() returned okay" ); - -my $step = q{init::delta}; -my $description = 'Determining if your computer does delta'; -my @params = qw| delta phi beta kappa |; -my $paramstr = join q{ }, @params; - -$conf->add_step( $step, @params ); -my @confsteps = @{ $conf->steps }; - -isnt( scalar @confsteps, 0, - "Parrot::Configure object 'steps' key holds non-empty array reference" ); -is( scalar @confsteps, 1, "Parrot::Configure object 'steps' key holds ref to 1-element array" ); -my $nontaskcount = 0; -foreach my $k (@confsteps) { - $nontaskcount++ unless $k->isa("Parrot::Configure::Task"); -} -is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); -is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); -ok( !ref( $confsteps[0]->object ), - "'object' element of Parrot::Configure::Task struct is not yet a ref" ); - -$conf->options->set(%args); -is( $conf->options->{c}->{debugging}, - 1, "command-line option '--debugging' has been stored in object" ); - -{ - my $rv; - my $stdout; - capture ( sub {$rv = $conf->runsteps}, \$stdout ); - ok( $rv, "runsteps successfully ran $step" ); - like( - $stdout, - qr/$description\.\.\..*$paramstr.*done\./s, - "Got message expected upon running $step" - ); -} - -pass("Completed all tests in $0"); - -################### DOCUMENTATION ################### - -=head1 NAME - -014-params.t - test what happens when a step is registered with parameters - -=head1 SYNOPSIS - - % prove t/configure/014-params.t - -=head1 DESCRIPTION - -The files in this directory test functionality used by F<Configure.pl>. - -The tests in this file examine what happens when you register a configuration -step with parameter. (This feature does not appear to be in current (April -16, 2007) use.) - -=head1 AUTHOR - -James E Keenan - -=head1 SEE ALSO - -Parrot::Configure, F<Configure.pl>. - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: Index: t/configure/132-auto_arch-03.t =================================================================== --- t/configure/132-auto_arch-03.t (revision 24563) +++ t/configure/132-auto_arch-03.t (working copy) @@ -31,10 +31,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[-1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/132-auto_arch-07.t =================================================================== --- t/configure/132-auto_arch-07.t (revision 24563) +++ t/configure/132-auto_arch-07.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/041-return_undef.t =================================================================== --- t/configure/041-return_undef.t (revision 24563) +++ t/configure/041-return_undef.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 13; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ is($nontaskcount, 0, "Each step is a Parrot::Configure::Task object"); is($confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified"); -is(ref($confsteps[0]->params), 'ARRAY', - "'params' element of Parrot::Configure::Task struct is array ref"); ok(! ref($confsteps[0]->object), "'object' element of Parrot::Configure::Task struct is not yet a ref"); Index: t/configure/012-verbose.t =================================================================== --- t/configure/012-verbose.t (revision 24563) +++ t/configure/012-verbose.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/006-bad_step.t =================================================================== --- t/configure/006-bad_step.t (revision 24563) +++ t/configure/006-bad_step.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 11; use Carp; use lib qw( lib ); use Parrot::Configure; @@ -41,8 +41,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $badstep, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/142-auto_aio-03.t =================================================================== --- t/configure/142-auto_aio-03.t (revision 24563) +++ t/configure/142-auto_aio-03.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/016-no_return_but_result.t =================================================================== --- t/configure/016-no_return_but_result.t (revision 24563) +++ t/configure/016-no_return_but_result.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 13; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/040-return_undef.t =================================================================== --- t/configure/040-return_undef.t (revision 24563) +++ t/configure/040-return_undef.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 13; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ is($nontaskcount, 0, "Each step is a Parrot::Configure::Task object"); is($confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified"); -is(ref($confsteps[0]->params), 'ARRAY', - "'params' element of Parrot::Configure::Task struct is array ref"); ok(! ref($confsteps[0]->object), "'object' element of Parrot::Configure::Task struct is not yet a ref"); Index: t/configure/132-auto_arch-04.t =================================================================== --- t/configure/132-auto_arch-04.t (revision 24563) +++ t/configure/132-auto_arch-04.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/132-auto_arch-08.t =================================================================== --- t/configure/132-auto_arch-08.t (revision 24563) +++ t/configure/132-auto_arch-08.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/060-silent.t =================================================================== --- t/configure/060-silent.t (revision 24563) +++ t/configure/060-silent.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 11; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/133-auto_cpu-01.t =================================================================== --- t/configure/133-auto_cpu-01.t (revision 24563) +++ t/configure/133-auto_cpu-01.t (working copy) @@ -30,10 +30,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[-1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/010-verbose_step_num_uncalled.t =================================================================== --- t/configure/010-verbose_step_num_uncalled.t (revision 24563) +++ t/configure/010-verbose_step_num_uncalled.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" ); Index: t/configure/142-auto_aio-04.t =================================================================== --- t/configure/142-auto_aio-04.t (revision 24563) +++ t/configure/142-auto_aio-04.t (working copy) @@ -31,10 +31,9 @@ $conf->add_steps($pkg); $conf->options->set( %{$args} ); -my ( $task, $step_name, @step_params, $step); +my ( $task, $step_name, $step); $task = $conf->steps->[1]; $step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; $step = $step_name->new(); ok( defined $step, "$step_name constructor returned defined value" ); Index: t/configure/007-verbose_two.t =================================================================== --- t/configure/007-verbose_two.t (revision 24563) +++ t/configure/007-verbose_two.t (working copy) @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 12; use Carp; use lib qw( lib t/configure/testlib ); use Parrot::Configure; @@ -42,8 +42,6 @@ } is( $nontaskcount, 0, "Each step is a Parrot::Configure::Task object" ); is( $confsteps[0]->step, $step, "'step' element of Parrot::Configure::Task struct identified" ); -is( ref( $confsteps[0]->params ), - 'ARRAY', "'params' element of Parrot::Configure::Task struct is array ref" ); ok( !ref( $confsteps[0]->object ), "'object' element of Parrot::Configure::Task struct is not yet a ref" );