Author: jkeenan
Date: Wed Jul 18 19:02:32 2007
New Revision: 19985

Modified:
   branches/reconfigure/t/configure/111-auto_gcc.t
   branches/reconfigure/t/configure/112-auto_msvc.t
   branches/reconfigure/t/configure/113-init_optimize.t

Log:
Add tests for 2 auto steps (only up thru test of $description) and preliminary
tests for init::optimize.


Modified: branches/reconfigure/t/configure/111-auto_gcc.t
==============================================================================
--- branches/reconfigure/t/configure/111-auto_gcc.t     (original)
+++ branches/reconfigure/t/configure/111-auto_gcc.t     Wed Jul 18 19:02:32 2007
@@ -5,16 +5,41 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  2;
+use Test::More tests => 10;
 use Carp;
-use lib qw( . lib ../lib ../../lib );
+use lib qw( . lib ../lib ../../lib t/configure/testlib );
+use_ok('config::init::defaults');
 use_ok('config::auto::gcc');
-
-=for hints_for_testing Check latest reports of Parrot configuration
-tools testing coverage to see where your time available for writing
-tests is spent.
-
-=cut
+use Parrot::BuildUtil;
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Auxiliary qw( test_step_thru_runstep);
+
+my $parrot_version = Parrot::BuildUtil::parrot_version();
+my $args = process_options( {
+    argv            => [],
+    script          => $0,
+    parrot_version  => $parrot_version,
+    svnid           => '$Id$',
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args, 0);
+
+my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{auto::gcc};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$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");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
 
 pass("Completed all tests in $0");
 

Modified: branches/reconfigure/t/configure/112-auto_msvc.t
==============================================================================
--- branches/reconfigure/t/configure/112-auto_msvc.t    (original)
+++ branches/reconfigure/t/configure/112-auto_msvc.t    Wed Jul 18 19:02:32 2007
@@ -5,18 +5,49 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  2;
+use Test::More tests => 10;
 use Carp;
-use lib qw( . lib ../lib ../../lib );
+use lib qw( . lib ../lib ../../lib t/configure/testlib );
+use_ok('config::init::defaults');
 use_ok('config::auto::msvc');
-
-=for hints_for_testing This test may be meaningless if you are not on
-Windows.  Consider writing a SKIP block.  Check latest reports of Parrot
-configuration tools testing coverage to see where your time available
-for writing tests is spent.
+use Parrot::BuildUtil;
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Auxiliary qw( test_step_thru_runstep);
+
+=for hints_for_testing Testing config::auto::msvc::runstep() may be
+meaningless if you are not on Windows.  Consider writing a SKIP block.  Check
+latest reports of Parrot configuration tools testing coverage to see where
+your time available for writing tests is spent.
 
 =cut
 
+my $parrot_version = Parrot::BuildUtil::parrot_version();
+my $args = process_options( {
+    argv            => [],
+    script          => $0,
+    parrot_version  => $parrot_version,
+    svnid           => '$Id$',
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args, 0);
+
+my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{auto::msvc};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$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");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
+
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Modified: branches/reconfigure/t/configure/113-init_optimize.t
==============================================================================
--- branches/reconfigure/t/configure/113-init_optimize.t        (original)
+++ branches/reconfigure/t/configure/113-init_optimize.t        Wed Jul 18 
19:02:32 2007
@@ -5,10 +5,15 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  2;
+use Test::More qw(no_plan); # tests =>  2;
 use Carp;
-use lib qw( . lib ../lib ../../lib );
+use lib qw( . lib ../lib ../../lib t/configure/testlib );
+use_ok('config::init::defaults');
 use_ok('config::init::optimize');
+use Parrot::BuildUtil;
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Auxiliary qw( test_step_thru_runstep);
 
 =for hints_for_testing Check latest reports of Parrot configuration
 tools testing coverage to see where your time available for writing
@@ -19,6 +24,35 @@
 
 =cut
 
+my $parrot_version = Parrot::BuildUtil::parrot_version();
+my $args = process_options( {
+    argv            => [],
+    script          => $0,
+    parrot_version  => $parrot_version,
+    svnid           => '$Id$',
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args, 0);
+
+my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{init::optimize};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$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");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
+
+$ret = $step->runstep($conf);
+ok(defined $ret, "$step_name runstep() returned defined value");
+
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Reply via email to