Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #42135] [PATCH] Fix overzealous flag removal in t/examples/shootout.t

3 views
Skip to first unread message

Andy Dougherty

unread,
Mar 27, 2007, 10:19:24 AM3/27/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Andy Dougherty
# Please include the string: [perl #42135]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42135 >


Many of the examples in examples/shootout specify preferred flags. For
example, ack.pir starts with

#!./parrot -Oc -Cj

I don't know what -Oc does. docs/running.pod doesn't say. It refers to
the non-existent F<imcc/docs/operation.pod> for more details. I found
what I presume is that file in F<docs/imcc/operation.pod>, but that
doesn't say anything about -Oc either. Oh well.

Ignoring that for the moment, the second set of flags is the problem.
On a system with neither -C nor -j, t/examples/shootout.t would leave
the second argument there as a plain '-'. Parrot would then sit waiting
forever for stdin, and the test suite would hang.

This patch fixes that.

--- parrot-current/t/examples/shootout.t Tue Feb 20 19:15:45 2007
+++ parrot-andy/t/examples/shootout.t Tue Mar 27 08:23:38 2007
@@ -84,10 +84,11 @@
}
unless ( $PConfig{cg_flag} =~ /HAVE/ ) {
$args =~ s/-Cj/-j/;
- $args =~ s/C//;
+ # Remove any plain -C option.
+ $args =~ s/(^|\s)-C(\s|$)/$1$2/;
+ # Remove any extra Cs still floating around
+ $args =~ s/C//;
}
-
- $args eq '-' and $args = '';

# look for input files
my $input = "$file$INPUT_EXT";

--
Andy Dougherty doug...@lafayette.edu


Chromatic

unread,
Mar 27, 2007, 2:36:06 PM3/27/07
to perl6-i...@perl.org, Andy Dougherty, bugs-bi...@rt.perl.org
On Tuesday 27 March 2007 07:19, Andy Dougherty wrote:

> Ignoring that for the moment, the second set of flags is the problem.
> On a system with neither -C nor -j, t/examples/shootout.t would leave
> the second argument there as a plain '-'. Parrot would then sit waiting
> forever for stdin, and the test suite would hang.

Thanks, applied as r17792.

-- c

Joshua Isom

unread,
Mar 27, 2007, 2:41:19 PM3/27/07
to perl6-i...@perl.org, bugs-bi...@rt.perl.org
Perhaps this is too complicated a method. The shootouts should
probably be ran with the testing core. If you want to test the CGP
core, use 'make testC', and so on. Otherwise, how will we know if
ack.pir starts failing with a different runcore? I'd feel it'd be
preferable to ignore the first line, perhaps just comment out the code
for parsing the first line.

Leopold Toetsch

unread,
Mar 27, 2007, 6:27:37 PM3/27/07
to perl6-i...@perl.org, Andy Dougherty, bugs-bi...@rt.perl.org
Am Dienstag, 27. März 2007 16:19 schrieb Andy Dougherty:
> Many of the examples in examples/shootout specify preferred flags.  For
> example, ack.pir starts with
>
>     #!./parrot -Oc -Cj
>
> I don't know what -Oc does.  docs/running.pod doesn't say.  It refers to
> the non-existent F<imcc/docs/operation.pod> for more details.  

Sorry for the underdocumentation, -Oc turns on the optional/experimental tail
call optimizations, which is visible at:
$ find . -type f -name '*.c' | xargs grep OPT_SUB
./compilers/imcc/pcc.c: if (tail_call && IMCC_INFO(interp)->optimizer_level
& OPT_SUB) {
...

(the OPT_SUB bit is following directly out of -Oc parsing
in /compilers/imcc/main.c)

Sorry^2: docs/imcc/operation.pod # moved long time ago ;)

> I found
> what I presume is that file in F<docs/imcc/operation.pod>, but that
> doesn't say anything about -Oc either.  Oh well.  
>
> Ignoring that for the moment, the second set of flags is the problem.
> On a system with neither -C nor -j, t/examples/shootout.t would leave
> the second argument there as a plain '-'.  Parrot would then sit waiting
> forever for stdin, and the test suite would hang.

Yep. And some of the tests might be boringly slow, if $platform doesn't have
these runtime options, so that skipping these tests should be preferable in
that case.

Thanks,
leo

0 new messages