On Thu May 17 01:49:39 2007, bernhard wrote:
>
>
> For the code coverage I suggest that you add an op like
> 'non_existent_op_used_for_testing' hardcoded in your test script. In
> this way you wouldn't depend on src/ops/*.ops.
>
bernhard++! I was able to implement your suggestion in less than an hour.
Fixed in r18591.
Index: t/tools/ops2pmutils/08-sort_ops.t
===================================================================
--- t/tools/ops2pmutils/08-sort_ops.t (revision 18590)
+++ t/tools/ops2pmutils/08-sort_ops.t (working copy)
@@ -206,6 +206,21 @@
ok( copy( qq{$cwd/$num}, qq{$tdir/$num} ), "copied ops.num
file" );
ok( copy( qq{$cwd/$skip}, qq{$tdir/$skip} ), "copied
ops.skip file" );
ok( copy( qq{$cwd/DEVELOPING}, qq{$tdir/DEVELOPING} ), "copied
DEVELOPING file" );
+ my $dummyops = "./src/ops/dummy.ops";
+ open my $FH, ">", $dummyops or
+ croak "Unable to open handle to create dummy ops file: $!";
+ print $FH <<DUMMYOPS;
+/*
+** dummy.ops
+*/
+
+VERSION = PARROT_VERSION;
+
+inline op zzzzzz(inout INT, in INT) :base_core {
+ goto NEXT();
+}
+DUMMYOPS
+ close $FH or croak "Unable to close handle after writing: $!";
my @opsfiles = glob("./src/ops/*.ops");
my $self = Parrot::Ops2pm::Utils->new(
@@ -232,15 +247,12 @@
ok( $self->sort_ops(), "sort_ops returned successfully" );
$msg = $tie->READLINE;
untie *STDERR;
- TODO: {
- local $TODO = "All ops currently being passed as arguments are found
either in ops.num or in ops.skip";
like(
$msg,
qr|not in ops\.num nor ops\.skip|,
"Got expected warning about ops in neither ops.num or ops.skip"
);
- };
# To do: Test that the sorting was correct.