Author: jkeenan
Date: Fri Jul 25 18:24:45 2008
New Revision: 29743

Modified:
   branches/parallel/config/gen/config_h.pm
   branches/parallel/t/steps/gen_config_h-01.t

Log:
Pull hard-coded strings holding names of source files into _init(), then
modify tests appropriately.


Modified: branches/parallel/config/gen/config_h.pm
==============================================================================
--- branches/parallel/config/gen/config_h.pm    (original)
+++ branches/parallel/config/gen/config_h.pm    Fri Jul 25 18:24:45 2008
@@ -29,19 +29,23 @@
     my %data;
     $data{description} = q{Generating C headers};
     $data{result}      = q{};
+    $data{templates}    = {
+        config_h    => 'config/gen/config_h/config_h.in',
+        feature_h   => 'config/gen/config_h/feature_h.in',
+    };
     return \%data;
 }
 
 sub runstep {
     my ( $self, $conf ) = @_;
 
-    $conf->genfile('config/gen/config_h/config_h.in', 
'include/parrot/config.h',
+    $conf->genfile($self->{templates}->{config_h}, 'include/parrot/config.h',
         comment_type      => '/*',
         ignore_pattern    => 'PARROT_CONFIG_DATE',
         conditioned_lines => 1
     );
 
-    $conf->genfile('config/gen/config_h/feature_h.in', 
'include/parrot/feature.h',
+    $conf->genfile($self->{templates}->{feature_h}, 'include/parrot/feature.h',
         comment_type   => '/*',
         ignore_pattern => 'PARROT_CONFIG_DATE',
         feature_file   => 1

Modified: branches/parallel/t/steps/gen_config_h-01.t
==============================================================================
--- branches/parallel/t/steps/gen_config_h-01.t (original)
+++ branches/parallel/t/steps/gen_config_h-01.t Fri Jul 25 18:24:45 2008
@@ -28,10 +28,8 @@
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 my $step = test_step_constructor_and_description($conf);
-ok(-f 'config/gen/config_h/config_h.in',
-    "Prequisite file config_h.in located");
-ok(-f 'config/gen/config_h/feature_h.in',
-    "Prequisite file feature_h.in located");
+ok(-f $step->{templates}->{config_h}, "Template for config_h located");
+ok(-f $step->{templates}->{feature_h}, "Template for feature_h located");
 
 pass("Completed all tests in $0");
 

Reply via email to