perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r25771 - branches/tcif/t/steps

Subject: [svn:parrot] r25771 - branches/tcif/t/steps
From:
Date: Sat, 16 Feb 2008 11:36:51 -0800 PST
Newsgroups: perl.cvs.parrot

Author: jkeenan
Date: Sat Feb 16 11:36:50 2008
New Revision: 25771

Modified:
   branches/tcif/t/steps/init_defaults-01.t
   branches/tcif/t/steps/init_defaults-02.t
   branches/tcif/t/steps/init_install-01.t
   branches/tcif/t/steps/init_install-02.t
   branches/tcif/t/steps/init_manifest-01.t
   branches/tcif/t/steps/init_manifest-02.t

Log:
Begin to convert configuration step tests to parallel trace mode.

Modified: branches/tcif/t/steps/init_defaults-01.t
==============================================================================
--- branches/tcif/t/steps/init_defaults-01.t    (original)
+++ branches/tcif/t/steps/init_defaults-01.t    Sat Feb 16 11:36:50 2008
@@ -5,12 +5,17 @@
 
 use strict;
 use warnings;
-use Test::More tests => 6;
+use Test::More tests =>  8;
 use Carp;
 use lib qw( lib );
 use_ok('config::init::defaults');
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Parallel::Trace;
+
+my $trace = Parrot::Configure::Parallel::Trace->new($0);
+ok(defined $trace, "Parallel::Trace constructor succeeded");
+is($trace->store_this_step(), 1, "Step stored");
 
 my $pkg  = q{init::defaults};
 my $args = process_options(
@@ -29,10 +34,11 @@
 );
 
 my $conf = Parrot::Configure->new;
+$conf->refresh($trace->get_previous_state());
 $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();

Modified: branches/tcif/t/steps/init_defaults-02.t
==============================================================================
--- branches/tcif/t/steps/init_defaults-02.t    (original)
+++ branches/tcif/t/steps/init_defaults-02.t    Sat Feb 16 11:36:50 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 12;
+use Test::More tests => 14;
 use Carp;
 use_ok('Cwd');
 use_ok('File::Copy');
@@ -16,6 +16,12 @@
 use Parrot::Configure::Step;
 use Parrot::Configure::Options qw( process_options );
 use base qw(Parrot::Configure::Step);
+use Parrot::Configure::Parallel::Trace;
+
+my $trace = Parrot::Configure::Parallel::Trace->new($0);
+ok(defined $trace, "Parallel::Trace constructor succeeded");
+is($trace->store_this_step(), 2,
+    "Step stored; has previously been tested");
 
 # DEVELOPING non-existence is faked by working in a tempdir which lacks it
 
@@ -34,10 +40,11 @@
     );
 
     my $conf = Parrot::Configure->new;
+    $conf->refresh($trace->get_previous_state());
     $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();

Modified: branches/tcif/t/steps/init_install-01.t
==============================================================================
--- branches/tcif/t/steps/init_install-01.t     (original)
+++ branches/tcif/t/steps/init_install-01.t     Sat Feb 16 11:36:50 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 19;
+use Test::More qw(no_plan); # tests => 19;
 use Carp;
 use Cwd;
 use Data::Dumper;
@@ -14,9 +14,14 @@
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
 use_ok('config::init::install');
-use Parrot::Configure::Test qw( test_step_thru_runstep);
+use Parrot::Configure::Parallel::Trace;
+
+my $trace = Parrot::Configure::Parallel::Trace->new($0);
+ok(defined $trace, "Parallel::Trace constructor succeeded");
+is($trace->store_this_step(), 1, "Step stored");
 
 my $cwd = cwd();
+my $pkg  = q{init::install};
 {
     my $tdir  = tempdir( CLEANUP => 1 );
     my $tdir1 = tempdir( CLEANUP => 1 );
@@ -36,7 +41,19 @@
     );
 
     my $conf = Parrot::Configure->new;
-    test_step_thru_runstep( $conf, q{init::install}, $args );
+    $conf->refresh($trace->get_previous_state());
+    $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" );
+    my $ret = $step->runstep($conf);
+    ok( defined $ret, "$step_name runstep() returned defined value" );
 
     is( $conf->data->get('prefix'),         $tdir,  "--prefix option 
confirmed" );
     is( $conf->data->get('exec_prefix'),    $tdir,  "--exec-prefix option 
confirmed" );

Modified: branches/tcif/t/steps/init_install-02.t
==============================================================================
--- branches/tcif/t/steps/init_install-02.t     (original)
+++ branches/tcif/t/steps/init_install-02.t     Sat Feb 16 11:36:50 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 19;
+use Test::More qw(no_plan); # tests => 19;
 use Carp;
 use Cwd;
 use Data::Dumper;
@@ -14,9 +14,15 @@
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
 use_ok('config::init::install');
-use Parrot::Configure::Test qw( test_step_thru_runstep);
+use Parrot::Configure::Parallel::Trace;
+
+my $trace = Parrot::Configure::Parallel::Trace->new($0);
+ok(defined $trace, "Parallel::Trace constructor succeeded");
+is($trace->store_this_step(), 2,
+    "Step stored; has previously been tested");
 
 my $cwd = cwd();
+my $pkg  = q{init::install};
 {
     my $tdir      = tempdir( CLEANUP => 1 );
     my $tdir_orig = $tdir;
@@ -38,7 +44,19 @@
     );
 
     my $conf = Parrot::Configure->new;
-    test_step_thru_runstep( $conf, q{init::install}, $args );
+    $conf->refresh($trace->get_previous_state());
+    $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" );
+    my $ret = $step->runstep($conf);
+    ok( defined $ret, "$step_name runstep() returned defined value" );
 
     is( $conf->data->get('prefix'),
         $tdir_orig, "--prefix option confirmed; trailing slash stripped" );

Modified: branches/tcif/t/steps/init_manifest-01.t
==============================================================================
--- branches/tcif/t/steps/init_manifest-01.t    (original)
+++ branches/tcif/t/steps/init_manifest-01.t    Sat Feb 16 11:36:50 2008
@@ -5,13 +5,18 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  9;
+use Test::More tests => 11;
 use Carp;
 use Data::Dumper;
 use lib qw( lib );
 use_ok('config::init::manifest');
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Parallel::Trace;
+
+my $trace = Parrot::Configure::Parallel::Trace->new($0);
+ok(defined $trace, "Parallel::Trace constructor succeeded");
+is($trace->store_this_step(), 1, "Step stored");
 
 my $pkg  = q{init::manifest};
 my $args = process_options(
@@ -22,10 +27,11 @@
 );
 
 my $conf = Parrot::Configure->new;
+$conf->refresh($trace->get_previous_state());
 $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();

Modified: branches/tcif/t/steps/init_manifest-02.t
==============================================================================
--- branches/tcif/t/steps/init_manifest-02.t    (original)
+++ branches/tcif/t/steps/init_manifest-02.t    Sat Feb 16 11:36:50 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 6;
+use Test::More tests =>  8;
 use Carp;
 use Cwd;
 use Data::Dumper;
@@ -16,6 +16,12 @@
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
 use IO::CaptureOutput qw | capture |;
+use Parrot::Configure::Parallel::Trace;
+
+my $trace = Parrot::Configure::Parallel::Trace->new($0);
+ok(defined $trace, "Parallel::Trace constructor succeeded");
+is($trace->store_this_step(), 2,
+    "Step stored; has previously been tested");
 
 my $pkg  = q{init::manifest};
 my $args = process_options(
@@ -26,10 +32,11 @@
 );
 
 my $conf = Parrot::Configure->new;
+$conf->refresh($trace->get_previous_state());
 $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();

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r25771 - branches/tcif/t/steps, jkeenan <=