Author: jkeenan
Date: Sun Jul 27 06:55:08 2008
New Revision: 29797

Modified:
   branches/parallel/t/steps/auto_arch-01.t
   branches/parallel/t/steps/inter_lex-01.t
   branches/parallel/t/steps/inter_lex-02.t
   branches/parallel/t/steps/inter_lex-03.t
   branches/parallel/t/steps/inter_make-01.t

Log:
[configure] Fine-tuning of tests for configuration steps.  Clarify POD.
Provide inline comments functioning as subheads where tests previously found
in multiple files have been moved into a single file.  Use
Parrot::Configure::Test::test_step_constructor_and_description() to eliminate
repeated code.  Delete outdated comments.


Modified: branches/parallel/t/steps/auto_arch-01.t
==============================================================================
--- branches/parallel/t/steps/auto_arch-01.t    (original)
+++ branches/parallel/t/steps/auto_arch-01.t    Sun Jul 27 06:55:08 2008
@@ -18,6 +18,8 @@
 );
 use IO::CaptureOutput qw| capture |;
 
+########## miniparrot ##########
+
 my $args = process_options(
     {
         argv => [ q{--miniparrot} ],

Modified: branches/parallel/t/steps/inter_lex-01.t
==============================================================================
--- branches/parallel/t/steps/inter_lex-01.t    (original)
+++ branches/parallel/t/steps/inter_lex-01.t    Sun Jul 27 06:55:08 2008
@@ -144,7 +144,7 @@
 
 =head1 NAME
 
-inter_lex-01.t - test config::inter::lex
+inter_lex-01.t - test inter::lex
 
 =head1 SYNOPSIS
 
@@ -154,9 +154,7 @@
 
 The files in this directory test functionality used by F<Configure.pl>.
 
-The tests in this file test subroutines exported by config::inter::lex.  In
-this case, only the C<--ask> option is provided.  Because the C<--maintainer>
-option is not provided, the step is skipped and no prompt is ever reached.
+The tests in this file test inter::lex.
 
 =head1 AUTHOR
 

Modified: branches/parallel/t/steps/inter_lex-02.t
==============================================================================
--- branches/parallel/t/steps/inter_lex-02.t    (original)
+++ branches/parallel/t/steps/inter_lex-02.t    Sun Jul 27 06:55:08 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  11;
+use Test::More tests =>  12;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::init::defaults');
@@ -13,7 +13,12 @@
 use_ok('config::inter::lex');
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw( test_step_thru_runstep);
+use Parrot::Configure::Test qw(
+    test_step_thru_runstep
+    test_step_constructor_and_description
+);
+
+########## ask; maintainer; $ENV{TEST_LEX} ##########
 
 my $args = process_options(
     {
@@ -26,21 +31,14 @@
 
 test_step_thru_runstep( $conf, q{init::defaults}, $args );
 
-my ( $task, $step_name, $step, $ret );
 my $pkg = q{inter::lex};
 
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
+my $step = test_step_constructor_and_description($conf);
 
-$task        = $conf->steps->[-1];
-$step_name   = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
-
-$ret = $step->runstep($conf);
-is( $ret, undef, "$step_name runstep() returned undefined value" );
+my $ret = $step->runstep($conf);
+is( $ret, undef, "runstep() returned undefined value" );
 my $result_expected = q{no lex program was found};
 is( $step->result(), $result_expected, "Result was $result_expected" );
 

Modified: branches/parallel/t/steps/inter_lex-03.t
==============================================================================
--- branches/parallel/t/steps/inter_lex-03.t    (original)
+++ branches/parallel/t/steps/inter_lex-03.t    Sun Jul 27 06:55:08 2008
@@ -15,12 +15,13 @@
 use Parrot::Configure::Options qw( process_options );
 use Parrot::Configure::Test qw(
     test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
 use IO::CaptureOutput qw | capture |;
 
+########## ask; maintainer; prompt flex ##########
+
 my $args = process_options(
     {
         argv => [ q{--ask}, q{--maintainer} ],

Modified: branches/parallel/t/steps/inter_make-01.t
==============================================================================
--- branches/parallel/t/steps/inter_make-01.t   (original)
+++ branches/parallel/t/steps/inter_make-01.t   Sun Jul 27 06:55:08 2008
@@ -5,16 +5,21 @@
 
 use strict;
 use warnings;
-use Test::More tests => 17;
+use Test::More tests => 18;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::init::defaults');
 use_ok('config::inter::make');
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw( test_step_thru_runstep);
+use Parrot::Configure::Test qw(
+    test_step_thru_runstep
+    test_step_constructor_and_description
+);
 use Tie::Filehandle::Preempt::Stdin;
 
+########## ask  ##########
+
 my $args = process_options(
     {
         argv => [q{--ask}],
@@ -26,7 +31,6 @@
 
 test_step_thru_runstep( $conf, q{init::defaults}, $args );
 
-my ( $task, $step_name, $step, $ret );
 my $pkg = q{inter::make};
 
 $conf->add_steps($pkg);
@@ -34,14 +38,7 @@
 my $serialized = $conf->pcfreeze();
 
 $conf->options->set( %{$args} );
-
-$task        = $conf->steps->[-1];
-$step_name   = $task->step;
-
-$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 $step = test_step_constructor_and_description($conf);
 
 my ( @prompts, $object );
 @prompts = (q{make});
@@ -49,14 +46,16 @@
 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
 
-$ret = $step->runstep($conf);
-ok( defined $ret, "$step_name runstep() returned defined value" );
+my $ret = $step->runstep($conf);
+ok( defined $ret, "runstep() returned defined value" );
 
 $object = undef;
 untie *STDIN;
 
 $conf->replenish($serialized);
 
+########## ask  ##########
+
 $args = process_options(
     {
         argv => [q{--ask}],
@@ -65,13 +64,7 @@
 );
 
 $conf->options->set( %{$args} );
-
-$task        = $conf->steps->[-1];
-$step_name   = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
+$step = test_step_constructor_and_description($conf);
 
 $conf->data->set('gmake_version' => '4.1');
 my $prog = 'gmake';

Reply via email to