Skip to content

Commit

Permalink
[buildtests] t/tools/ops2pm/05-renum_op_map_file.t was failing since r.
Browse files Browse the repository at this point in the history
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.


git-svn-id: https://svn.parrot.org/parrot/trunk@45048 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
jkeenan committed Mar 18, 2010
1 parent fdfaf1a commit ffe52b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/Parrot/Ops2pm/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package Parrot::Ops2pm::Base;
use strict;
use warnings;
use Cwd;
use File::Spec;
use lib qw ( lib );
use Parrot::OpsFile;

Expand Down Expand Up @@ -94,6 +96,9 @@ sub new {
$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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Parrot/OpsRenumber.pm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ sub renum_op_map_file {
# 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
Expand Down
2 changes: 2 additions & 0 deletions t/tools/ops2pm/05-renum_op_map_file.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ ok(-d $samplesdir, "Able to locate samples directory");
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 #####

Expand Down

0 comments on commit ffe52b5

Please sign in to comment.