[svn:parrot] r45048 - in trunk: lib/Parrot lib/Parrot/Ops2pm t/tools/ops2pm

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Thu Mar 18 23:31:43 UTC 2010


Author: jkeenan
Date: Thu Mar 18 23:31:42 2010
New Revision: 45048
URL: https://trac.parrot.org/parrot/changeset/45048

Log:
[buildtests] t/tools/ops2pm/05-renum_op_map_file.t was failing since r.
Hard-coded relative path for include/parrot/opsenum.h inside
lib/Parrot/OpsRenumber was problem.  Moving this assignment to
lib/Parrot/Ops2pm/Base.pm (a) improves flexibility, (b) places assignment in
same location as similar values, (c) enables test to pass once again.

Modified:
   trunk/lib/Parrot/Ops2pm/Base.pm
   trunk/lib/Parrot/OpsRenumber.pm
   trunk/t/tools/ops2pm/05-renum_op_map_file.t

Modified: trunk/lib/Parrot/Ops2pm/Base.pm
==============================================================================
--- trunk/lib/Parrot/Ops2pm/Base.pm	Thu Mar 18 23:17:33 2010	(r45047)
+++ trunk/lib/Parrot/Ops2pm/Base.pm	Thu Mar 18 23:31:42 2010	(r45048)
@@ -3,6 +3,8 @@
 package Parrot::Ops2pm::Base;
 use strict;
 use warnings;
+use Cwd;
+use File::Spec;
 use lib qw ( lib );
 use Parrot::OpsFile;
 
@@ -94,6 +96,9 @@
     $argsref->{argv} = \@argv;
     $argsref->{num_file}    = "src/ops/ops.num";
     $argsref->{skip_file}   = "src/ops/ops.skip";
+    $argsref->{opsenum_file} = File::Spec->catfile(
+        cwd(), qw(  include parrot opsenum.h )
+    );
     return bless $argsref, $class;
 }
 

Modified: trunk/lib/Parrot/OpsRenumber.pm
==============================================================================
--- trunk/lib/Parrot/OpsRenumber.pm	Thu Mar 18 23:17:33 2010	(r45047)
+++ trunk/lib/Parrot/OpsRenumber.pm	Thu Mar 18 23:31:42 2010	(r45048)
@@ -134,7 +134,7 @@
     # above the DYNAMIC line.  For the purpose of renumbering, we create
     # an index $n.
 
-    my $opsenumfn = "include/parrot/opsenum.h";
+    my $opsenumfn = $self->{opsenum_file};
     open my $OPSENUM, '>', $opsenumfn or die "Can't open $opsenumfn, error $!";
     print $OPSENUM $OPSENUM_PREAMBLE;
     open $OP, '>', $file

Modified: trunk/t/tools/ops2pm/05-renum_op_map_file.t
==============================================================================
--- trunk/t/tools/ops2pm/05-renum_op_map_file.t	Thu Mar 18 23:17:33 2010	(r45047)
+++ trunk/t/tools/ops2pm/05-renum_op_map_file.t	Thu Mar 18 23:31:42 2010	(r45048)
@@ -33,6 +33,8 @@
     chdir $tdir or croak "Unable to change to testing directory: $!";
     my $opsdir = File::Spec->catdir ( $tdir, 'src', 'ops' );
     mkpath( [ $opsdir ], 0, 0755 ) or croak "Unable to make testing directory";
+    my $incpardir = File::Spec->catdir ( $tdir, 'include', 'parrot' );
+    mkpath( [ $incpardir ], 0, 0755 ) or croak "Unable to make testing directory";
 
     ##### Stage 1:  Generate ops.num de novo #####
 


More information about the parrot-commits mailing list