[perl #46473] Patch to correctly verify whether the malloc, format, and nonnull attributes are supported

2007-10-17 Thread Rob West
# New Ticket Created by  "Rob West" 
# Please include the string:  [perl #46473]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46473 >


This patch should make it so that the NOTNULL macro will work as
expected for a compiler that supports __attribute__((__nonnull__))
like gcc. Same for PARROT_MALLOC and __attribute__((__malloc__)).

It also surrounds the attribute names with double underscores (as
allowed by gcc). "This allows you to use them in header files without
being concerned about a possible macro of the same name."

 Patch  level 1
Source: [No source]
Target: d31e2699-5ff4-0310-a27c-f18f2fbe73fe:/trunk:22138 [mirrored]
(https://svn.perl.org/parrot/trunk)
Log:
Fix configure to correctly verify whether the malloc, format, and
nonnull attributes are supported
=== config/auto/attributes/test_c.in
==
--- config/auto/attributes/test_c.in(revision 22138)
+++ config/auto/attributes/test_c.in(patch attributes_fix level 1)
@@ -12,9 +12,9 @@
 __attribute__noreturn__
 __attribute__warn_unused_result__
 __attribute__deprecated__
-int
-dummyfunc(int x)
-__attribute__format__(1,2,3)
+void *
+dummyfunc(const char *my_format, ...)
+__attribute__format__(printf,1,2)
 __attribute__nonnull__(1)
 ;

=== include/parrot/compiler.h
==
--- include/parrot/compiler.h   (revision 22138)
+++ include/parrot/compiler.h   (patch attributes_fix level 1)
@@ -23,36 +23,36 @@
 #  ifdef _MSC_VER
 #define __attribute__deprecated__ __declspec(deprecated)
 #  else
-#define __attribute__deprecated__   __attribute__((deprecated))
+#define __attribute__deprecated__   __attribute__((__deprecated__))
 #  endif
 #endif
 #ifdef HASATTRIBUTE_FORMAT
-#  define __attribute__format__(x,y,z)  __attribute__((format(x,y,z)))
+#  define __attribute__format__(x,y,z)  __attribute__((__format__(x,y,z)))
 #endif
 #ifdef HASATTRIBUTE_MALLOC
 #  define __attribute__malloc__ __attribute__((__malloc__))
 #endif
 #ifdef HASATTRIBUTE_NONNULL
-#  define __attribute__nonnull__(a) __attribute__((nonnull(a)))
+#  define __attribute__nonnull__(a) __attribute__((__nonnull__(a)))
 #endif
 #ifdef HASATTRIBUTE_NORETURN
 #  ifdef _MSC_VER
 #define __attribute__noreturn__ __declspec(noreturn)
 #  else
-#define __attribute__noreturn__   __attribute__((noreturn))
+#define __attribute__noreturn__   __attribute__((__noreturn__))
 #  endif
 #endif
 #ifdef HASATTRIBUTE_PURE
-#  define __attribute__pure__   __attribute__((pure))
+#  define __attribute__pure__   __attribute__((__pure__))
 #endif
 #ifdef HASATTRIBUTE_CONST
-#  define __attribute__const__  __attribute__((const))
+#  define __attribute__const__  __attribute__((__const__))
 #endif
 #ifdef HASATTRIBUTE_UNUSED
-#  define __attribute__unused__ __attribute__((unused))
+#  define __attribute__unused__ __attribute__((__unused__))
 #endif
 #ifdef HASATTRIBUTE_WARN_UNUSED_RESULT
-#  define __attribute__warn_unused_result__ __attribute__((warn_unused_result))
+#  define __attribute__warn_unused_result__
__attribute__((__warn_unused_result__))
 #endif

 /* If we haven't defined the attributes yet, define them to blank. */


[svn:parrot-pdd] r22164 - trunk/docs/pdds/draft

2007-10-17 Thread kjs
Author: kjs
Date: Wed Oct 17 02:41:08 2007
New Revision: 22164

Modified:
   trunk/docs/pdds/draft/pdd19_pir.pod

Log:
pdd19_pir.pod:
* fix typo
* remove .param " syntax description; is not implemented anyway.

Modified: trunk/docs/pdds/draft/pdd19_pir.pod
==
--- trunk/docs/pdds/draft/pdd19_pir.pod (original)
+++ trunk/docs/pdds/draft/pdd19_pir.pod Wed Oct 17 02:41:08 2007
@@ -364,7 +364,7 @@
 
 =item .param   [:]*
 
-At the top of a subroutine, declare a local variable, in the mannter
+At the top of a subroutine, declare a local variable, in the manner
 of B<.local>, into which parameter(s) of the current subroutine should
 be stored. Available flags:
 C<:slurpy>, C<:optional>, C<:opt_flag> and C<:unique_reg>.
@@ -375,14 +375,6 @@
 
  .param   :named("")
 
-=item .param  [:]*
-
-{{ Specifying a register for a parameter does not work. See. RT#46455. }}
-
-At the top of a subroutine, specify where parameter(s) of the current
-subroutine should be stored.  Available flags:
-C<:slurpy>, C<:optional>, C<:opt_flag> and C<:unique_reg>.
-
 =item .return  [: ...]
 
 Between B<.pcc_begin_return> and B<.pcc_end_return>, specify one or


Merging the pdd15oo branch back into trunk

2007-10-17 Thread Allison Randal
At Coke's suggestion, I'm merging the pdd15oo branch back into trunk, to 
give us the maximum possible time to shake it down before the 0.5.0 
release in November.


The branch still has 4 remaining failing core tests, all related to 
cloning the interpreter for a thread. I'll resolve these right after 
merging in the branch.


Cardinal is failing a lot of tests, but those are all failing in trunk 
too. (Seems it has fallen out of sync with the current interface of the 
compiler tools.) I'll dig into that after the merge too, unless someone 
beats me to it.


Allison


[svn:parrot-pdd] r22180 - in trunk: . apps/p3 compilers/imcc compilers/past-pm/PAST compilers/pct/src compilers/pge/PGE compilers/tge config/gen config/gen/makefiles docs docs/book docs/imcc docs/pdds

2007-10-17 Thread allison
Author: allison
Date: Wed Oct 17 12:33:17 2007
New Revision: 22180

Modified:
   trunk/docs/pdds/pdd15_objects.pod
   trunk/docs/pdds/pdd17_pmc.pod

Changes in other areas also in this revision:
Added:
   trunk/include/parrot/oo.h
  - copied unchanged from r22176, /branches/pdd15oo/include/parrot/oo.h
   trunk/include/parrot/oo_private.h
  - copied unchanged from r22176, 
/branches/pdd15oo/include/parrot/oo_private.h
   trunk/src/oo.c
  - copied unchanged from r22176, /branches/pdd15oo/src/oo.c
   trunk/t/oo/isa.t
  - copied unchanged from r22176, /branches/pdd15oo/t/oo/isa.t
   trunk/t/oo/methods.t
  - copied unchanged from r22176, /branches/pdd15oo/t/oo/methods.t
   trunk/t/oo/proxy.t
  - copied unchanged from r22176, /branches/pdd15oo/t/oo/proxy.t
   trunk/t/oo/subclass.t
  - copied unchanged from r22176, /branches/pdd15oo/t/oo/subclass.t
Removed:
   trunk/src/pmc/classobject.h
   trunk/t/pdd15oo/calling.t
   trunk/t/pdd15oo/gc.t
   trunk/t/pdd15oo/mmd.t
   trunk/t/pdd15oo/object-meths.t
   trunk/t/pdd15oo/object-mro.t
   trunk/t/pdd15oo/objects.t
   trunk/t/pdd15oo/spill.t
   trunk/t/pdd15oo/tail.t
Modified:
   trunk/MANIFEST
   trunk/apps/p3/p3p.html
   trunk/compilers/imcc/imcc.l
   trunk/compilers/imcc/imclexer.c
   trunk/compilers/imcc/imcparser.c
   trunk/compilers/imcc/imcparser.h
   trunk/compilers/past-pm/PAST/Node.pir
   trunk/compilers/pct/src/HLLCompiler.pir
   trunk/compilers/pge/PGE/Exp.pir
   trunk/compilers/pge/PGE/Match.pir
   trunk/compilers/pge/PGE/OPTable.pir
   trunk/compilers/pge/PGE/P5Regex.pir
   trunk/compilers/pge/PGE/P6Regex.pir
   trunk/compilers/pge/PGE/Perl6Regex.pir
   trunk/compilers/pge/PGE/Regex.pir
   trunk/compilers/tge/TGE.pir
   trunk/config/gen/core_pmcs.pm
   trunk/config/gen/makefiles/root.in
   trunk/docs/book/ch04_pir_subroutines.pod
   trunk/docs/compiler_faq.pod
   trunk/docs/imcc/calling_conventions.pod
   trunk/examples/benchmarks/oo1.pasm
   trunk/examples/benchmarks/oo2.pasm
   trunk/examples/benchmarks/oo3.pasm
   trunk/examples/benchmarks/oo4.pasm
   trunk/examples/benchmarks/oo5.pir
   trunk/examples/benchmarks/oo6.pir
   trunk/examples/benchmarks/oofib.pir
   trunk/examples/io/httpd2.pir
   trunk/examples/japh/japh4.pasm
   trunk/examples/japh/japh5.pasm
   trunk/examples/japh/japh6.pasm
   trunk/examples/pge/simple.pir
   trunk/examples/pir/sudoku.pir
   trunk/examples/sdl/anim_image.pir
   trunk/examples/sdl/anim_image_dblbuf.pir
   trunk/examples/sdl/blue_font.pir
   trunk/examples/sdl/blue_rect.pir
   trunk/examples/sdl/bounce_parrot_logo.pir
   trunk/examples/sdl/lcd/clock.pir
   trunk/examples/sdl/mandel.pir
   trunk/examples/sdl/minesweeper/eventhandler.pir
   trunk/examples/sdl/minesweeper/field.pir
   trunk/examples/sdl/minesweeper/mines.pir
   trunk/examples/sdl/move_parrot_logo.pir
   trunk/examples/sdl/raw_pixels.pir
   trunk/examples/sdl/tetris/app.pir
   trunk/examples/sdl/tetris/block.pir
   trunk/examples/sdl/tetris/blockdata.pir
   trunk/examples/sdl/tetris/blocks.pir
   trunk/examples/sdl/tetris/board.pir
   trunk/examples/sdl/tetris/boarddata.pir
   trunk/examples/sdl/tetris/eventhandler.pir
   trunk/examples/sdl/tetris/tetris.pir
   trunk/examples/streams/Bytes.pir
   trunk/examples/streams/Combiner.pir
   trunk/examples/streams/Coroutine.pir
   trunk/examples/streams/FileLines.pir
   trunk/examples/streams/Filter.pir
   trunk/examples/streams/Include.pir
   trunk/examples/streams/Lines.pir
   trunk/examples/streams/ParrotIO.pir
   trunk/examples/streams/Replay.pir
   trunk/examples/streams/SubCounter.pir
   trunk/examples/streams/SubHello.pir
   trunk/examples/streams/Writer.pir
   trunk/include/parrot/objects.h
   trunk/include/parrot/parrot.h
   trunk/include/parrot/pmc.h
   trunk/languages/WMLScript/t/pmc/boolean.t
   trunk/languages/WMLScript/t/pmc/float.t
   trunk/languages/WMLScript/t/pmc/integer.t
   trunk/languages/WMLScript/t/pmc/invalid.t
   trunk/languages/WMLScript/t/pmc/string.t
   trunk/languages/c99/src/CPP_PASTNodes.pir
   trunk/languages/c99/src/CPP_PGE2AST.pir
   trunk/languages/cardinal/cardinal.pir
   trunk/languages/cardinal/src/AST2OST.pir
   trunk/languages/cardinal/src/OST2PIR.pir
   trunk/languages/cardinal/src/PAST.pir
   trunk/languages/cardinal/src/PGE2AST.pir
   trunk/languages/dotnet/src/method.pir
   trunk/languages/dotnet/src/translator.pir
   trunk/languages/forth/forth.pir
   trunk/languages/lua/t/pmc/boolean.t
   trunk/languages/lua/t/pmc/closure.t
   trunk/languages/lua/t/pmc/function.t
   trunk/languages/lua/t/pmc/nil.t
   trunk/languages/lua/t/pmc/number.t
   trunk/languages/lua/t/pmc/string.t
   trunk/languages/lua/t/pmc/table.t
   trunk/languages/lua/t/pmc/thread.t
   trunk/languages/lua/t/pmc/userdata.t
   trunk/languages/perl5/t/sparse_perlarray.t
   trunk/languages/pheme/lib/PhemeSymbols.pir
   trunk/lib/Parrot/Pmc2c/PMC/Object.pm
   trunk/lib/Parrot/Pmc2c/PMC/delegate.pm
   trunk/lib/Parrot/Pmc2c/PMCEmitter.pm
   trunk/lib/Parrot/Test.pm
   trunk/runtime/parro

[perl #46503] [TODO] Remove individual runcore command line flags...

2007-10-17 Thread via RT
# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #46503]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46503 >


And replace them with a single switch, instead.

--runcore=bounds|cgp|fast|cg|jit|switched

which would eliminate the -b, -C, -f, -g, -j, and -S command line  
switches.

Feel free to update this ticket if I've missed a named core (or if  
the shortened names above are too cryptic)



--
Will "Coke" Coleda
[EMAIL PROTECTED]




[perl #46499] [RFE] Allow comment lines in PIR .param list

2007-10-17 Thread via RT
# New Ticket Created by  Bernhard Schmalhofer 
# Please include the string:  [perl #46499]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46499 >


Currently following PIR is failing because of the '#' in the '.param' list.

.sub main :main

  ( $S1 ) = my_sub( 'hello', 'world' )
  say $S1
.end

.sub my_sub
.param string  str1
#
.param string  str3

.local string hello
hello = concat str1, str3

.return( hello )
.end


This surprised me, as I expected that '#' lines would be ignored.
So I propose to tweak the PIR grammar such that comment lines are allowed

Regards,
  Bernhard



Re: [perl #46499] [RFE] Allow comment lines in PIR .param list

2007-10-17 Thread Will Coleda


On Oct 17, 2007, at 3:09 PM, Bernhard Schmalhofer (via RT) wrote:


This surprised me, as I expected that '#' lines would be ignored.
So I propose to tweak the PIR grammar such that comment lines are  
allowed


Yes please.

--
Will "Coke" Coleda
[EMAIL PROTECTED]




Re: [perl #46499] [RFE] Allow comment lines in PIR .param list

2007-10-17 Thread jerry gay
On 10/17/07, via RT Bernhard Schmalhofer
<[EMAIL PROTECTED]> wrote:
> # New Ticket Created by  Bernhard Schmalhofer
> # Please include the string:  [perl #46499]
> # in the subject line of all future correspondence about this issue.
> # http://rt.perl.org/rt3/Ticket/Display.html?id=46499 >
>
>
> Currently following PIR is failing because of the '#' in the '.param' list.
>
> .sub main :main
>
>   ( $S1 ) = my_sub( 'hello', 'world' )
>   say $S1
> .end
>
> .sub my_sub
> .param string  str1
> #
> .param string  str3
>
> .local string hello
> hello = concat str1, str3
>
> .return( hello )
> .end
>
>
> This surprised me, as I expected that '#' lines would be ignored.
> So I propose to tweak the PIR grammar such that comment lines are allowed
>
it's documented somewhere (perhaps in a very old ticket?) that
*nothing* can appear between a .sub line and the .param lines, so
comments are indeed invalid in the current implementation. i'd love to
see that change, so comments are allowed.
~jerry


[perl #46373] [PATCH] Revise construction of configuration step classes

2007-10-17 Thread James Keenan via RT
Patch applied to trunk in r22195.


[perl #46513] [BUG] t/pmc/exporter.t test failures

2007-10-17 Thread via RT
# New Ticket Created by  James Keenan 
# Please include the string:  [perl #46513]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46513 >


[li11-226:parrot] 550 $ prove -v t/pmc/exporter.t
t/pmc/exporter1..12
ok 1 - new
not ok 2 - source

# Failed test (t/pmc/exporter.t at line 43)
# Exited with error code: [SIGNAL 11]
# Received:
# ok 1 - source() returns PMCNULL upon Exporter init
# ok 2 - source() with args sets source namespace
#
# Expected:
# ok 1 - source() returns PMCNULL upon Exporter init
# ok 2 - source() with args sets source namespace
# ok 3 - source() with too many args fails
# ok 4 - source() with non-namespace arg throws exception
#
not ok 3 - destination

# Failed test (t/pmc/exporter.t at line 95)
# Exited with error code: [SIGNAL 11]
# Received:
# ok 1 - destination() with no args returns destination namespace
# ok 2 - ...which is current namespace at first
# ok 3 - destination() with args sets destination namespace
#
# Expected:
# ok 1 - destination() with no args returns destination namespace
# ok 2 - ...which is current namespace at first
# ok 3 - destination() with args sets destination namespace
# ok 4 - destination() with too many args fails
# ok 5 - destination() with non-namespace arg throws exception
#
ok 4 - globals
ok 5 - import - no args
ok 6 - import - same source and destination namespaces
ok 7 - import - globals as string
ok 8 - import - globals with source passed separately
ok 9 - import - globals as array
ok 10 - import - globals as hash - null + empty string
ok 11 - import - globals as hash - with dest names (latin)
ok 12 - import - globals with destination
# Looks like you failed 2 tests of 12.
dubious
 Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2-3
 Failed 2/12 tests, 83.33% okay
Failed Test  Stat Wstat Total Fail  List of Failed
 
---
t/pmc/exporter.t2   512122  2-3
Failed 1/1 test scripts. 2/12 subtests failed.
Files=1, Tests=12,  1 wallclock secs ( 0.27 cusr +  0.11 csys =  0.38  
CPU)
Failed 1/1 test programs. 2/12 subtests failed.



[perl #46515] [BUG] t/pmc/threads.t test failures

2007-10-17 Thread via RT
# New Ticket Created by  James Keenan 
# Please include the string:  [perl #46515]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46515 >


Linux. r22201.

[li11-226:parrot] 552 $ prove -v t/pmc/threads.t
t/pmc/threads1..20
ok 1 - interp identity
ok 2 - thread type 1
ok 3 - thread type 1 -- repeated
ok 4 - thread type 2
ok 5 - thread - kill
ok 6 - join, get retval
ok 7 - detach
ok 8 - share a PMC
ok 9 - multi-threaded
ok 10 - sub name lookup in new thread
ok 11 - CLONE_CODE only
ok 12 - CLONE_CODE | CLONE_GLOBALS
not ok 13 - CLONE_CODE | CLONE_CLASSES; superclass not built-in

# Failed test (t/pmc/threads.t at line 577)
# Exited with error code: [SIGNAL 11]
# Received:
# in thread:
#
# Expected:
# in thread:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 0
# Foo? 1
# Bar? 1
# in main:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 0
# Foo? 1
# Bar? 1
#
not ok 14 - CLONE_CODE | CLONE_CLASSES; superclass built-in

# Failed test (t/pmc/threads.t at line 661)
# Exited with error code: [SIGNAL 11]
# Received:
# in thread:
#
# Expected:
# in thread:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 1
# Foo? 1
# Bar? 1
# in main:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 1
# Foo? 1
# Bar? 1
#
ok 15 - CLONE_CODE | CLONE_GLOBALS| CLONE_HLL
ok 16 - globals + constant table subs issue
not ok 17 - CLONE_CODE|CLONE_GLOBALS|CLONE_HLL|CLONE_LIBRARIES # TODO  
RT#41373

# Failed (TODO) test (t/pmc/threads.t at line 943)
# Exited with error code: 1
# Received:
# Class 'PerlInt' not found
# current instr.: 'main' pc 85 (/home/jimk/work/parrot/t/pmc/ 
threads_17.pir:46)
#
# Expected:
# in thread:
# 0
# ok (equal)
# 42
# in main:
# 0
# ok (equal)
# 42
#
ok 18 - multi-threaded strings via SharedRef
ok 19 # skip no shared Strings yet
ok 20 # skip no shared Strings yet
# Looks like you failed 2 tests of 20.
dubious
 Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 13-14
 Failed 2/20 tests, 90.00% okay (less 2 skipped tests: 16  
okay, 80.00%)
Failed Test Stat Wstat Total Fail  List of Failed
 
---
t/pmc/threads.t2   512202  13-14
2 subtests skipped.
Failed 1/1 test scripts. 2/20 subtests failed.
Files=1, Tests=20,  8 wallclock secs ( 1.32 cusr +  0.13 csys =  1.45  
CPU)
Failed 1/1 test programs. 2/20 subtests failed.



[perl #46517] [BUG] t/stm/llqueue.t test failures

2007-10-17 Thread via RT
# New Ticket Created by  James Keenan 
# Please include the string:  [perl #46517]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46517 >


Linux. r22201.

[li11-226:parrot] 554 $ prove -v t/stm/llqueue.t
t/stm/llqueue1..2
not ok 1 - single-threaded case

# Failed test (t/stm/llqueue.t at line 38)
# Exited with error code: 1
# Received:
# share_ro() not implemented in class 'STMLLQueue::Node'
# current instr.: 'parrot;STM;_transaction' pc 104 (runtime/parrot/ 
library/STM.pir:88)
# called from Sub 'parrot;STM;transaction' pc 590 (runtime/parrot/ 
library/STM.pir:298)
# called from Sub 'parrot;STMLLQueue;add_head' pc 320 (/home/jimk/ 
work/parrot/./STMLLQueue.pir:119)
# called from Sub 'main' pc 11 (/home/jimk/work/parrot/t/stm/ 
llqueue_1.pir:6)
#
# Expected:
# 0123
#
ok 2 # skip known segfault; needs GC/STM hackery
# Looks like you failed 1 test of 2.
dubious
 Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
 Failed 1/2 tests, 50.00% okay (less 1 skipped test: 0 okay,  
0.00%)
Failed Test Stat Wstat Total Fail  List of Failed
 
---
t/stm/llqueue.t1   256 21  1
1 subtest skipped.
Failed 1/1 test scripts. 1/2 subtests failed.
Files=1, Tests=2,  0 wallclock secs ( 0.06 cusr +  0.02 csys =  0.08  
CPU)
Failed 1/1 test programs. 1/2 subtests failed.



[perl #46519] [BUG] t/stm/runtime.t test failures

2007-10-17 Thread via RT
# New Ticket Created by  James Keenan 
# Please include the string:  [perl #46519]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=46519 >


Linux:  r22201.

[li11-226:parrot] 555 $ prove -v t/stm/runtime.t
t/stm/runtime1..5
ok 1 - choice (one thread)
ok 2 - choice (multiple threads)
ok 3 - choice doesn't clobber
not ok 4 - queue adapted for the library

# Failed test (t/stm/runtime.t at line 509)
#  got: 'Unhandled exception in thread with tid 1  
(message=Null PMC access in invoke(), number=43)
# Unhandled exception in thread with tid 2 (message=Null PMC access  
in invoke(), number=43)
# interpreter 0x8411d38 had pending transaction on exit
# interpreter 0x8239470 had pending transaction on exit
# '
# expected: 'ok
# '
ok 5 - queue (non-blocking; nested)
# Looks like you failed 1 test of 5.
dubious
 Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 4
 Failed 1/5 tests, 80.00% okay
Failed Test Stat Wstat Total Fail  List of Failed
 
---
t/stm/runtime.t1   256 51  4
Failed 1/1 test scripts. 1/5 subtests failed.
Files=1, Tests=5,  2 wallclock secs ( 0.19 cusr +  0.08 csys =  0.27  
CPU)
Failed 1/1 test programs. 1/5 subtests failed.



[perl #45525] [TODO] Configure.pl: permit a --fatal-step option

2007-10-17 Thread James Keenan via RT
Please review patch attached, which provides --fatal and --fatal-step
options.
Index: MANIFEST
===
--- MANIFEST(revision 22201)
+++ MANIFEST(working copy)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Oct 18 00:43:31 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Oct 18 02:54:19 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -2953,6 +2953,15 @@
 t/configure/037-run_single_step.t   []
 t/configure/038-run_single_step.t   []
 t/configure/039-slurp_file.t[]
+t/configure/050-fatal.t []
+t/configure/051-fatal_step.t[]
+t/configure/052-fatal_step.t[]
+t/configure/053-fatal_step.t[]
+t/configure/054-fatal_step.t[]
+t/configure/055-fatal_step.t[]
+t/configure/056-fatal_step.t[]
+t/configure/057-fatal_step.t[]
+t/configure/058-fatal_step.t[]
 t/configure/101-init_manifest-01.t  []
 t/configure/101-init_manifest-02.t  []
 t/configure/102-init_defaults-01.t  []
Index: lib/Parrot/Configure/Options/Conf.pm
===
--- lib/Parrot/Configure/Options/Conf.pm(revision 22201)
+++ lib/Parrot/Configure/Options/Conf.pm(working copy)
@@ -29,6 +29,8 @@
 define
 exec-prefix
 execcapable
+fatal
+fatal-step
 floatval
 gc
 help
@@ -82,10 +84,10 @@
 our $parrot_version = Parrot::BuildUtil::parrot_version();
 our $svnid  = '$Id$',
 
-my %short_circuits = (
+my %short_circuits = (
 help=> \&print_help,
 version => \&print_version,
-);
+);
 
 our %options_components = (
 'valid_options'  => [EMAIL PROTECTED],
@@ -122,6 +124,10 @@
--verbose=2  Output every setting change
--verbose-step=N Set verbose for step N only
--verbose-step=regex Set verbose for step matching description
+   --fatal  Failure of any configuration step will cause
+Configure.pl to halt
+   --fatal-step Comma-delimited string of configuration steps
+which upon failure cause Configure.pl to halt
--nomanicheckDon't check the MANIFEST
--step=(gen::languages)
 Execute a single configure step
Index: lib/Parrot/Configure.pm
===
--- lib/Parrot/Configure.pm (revision 22201)
+++ lib/Parrot/Configure.pm (working copy)
@@ -221,9 +221,36 @@
 my $conf = shift;
 
 my $n = 0;# step number
-my ( $verbose, $verbose_step, $ask ) = $conf->options->get(qw( verbose 
verbose-step ask ));
+my ( $verbose, $verbose_step, $fatal, $fatal_step, $ask ) =
+$conf->options->get(qw( verbose verbose-step fatal fatal-step ask ));
 
+$conf->{log} = [];
+my %steps_to_die_for = ();
+# If the --fatal option is true, then all config steps are mapped into
+# %steps_to_die_for and there is no consideration of --fatal-step.
+if ($fatal) {
+%steps_to_die_for = map {$_, 1} @{ $conf->{list_of_steps} };
+}
+# We make certain that argument to --fatal-step is a comma-delimited
+# string of configuration steps, each of which is a string delimited by
+# two colons, the first half of which is one of init|inter|auto|gen
+# (This will be modified to take a step sequence number.)
+elsif ( defined ( $fatal_step ) ) {
+%steps_to_die_for = $conf->_handle_fatal_step_option( $fatal_step );
+}
+else {
+# No action needed; this is the default case where no step is fatal
+}
+
 foreach my $task ( $conf->steps ) {
+my $red_flag;
+my $step_name   = $task->step;
+if ( scalar ( keys ( %steps_to_die_for ) ) ) {
+if ( $steps_to_die_for{$step_name} ) {
+$red_flag++;
+}
+}
+
 $n++;
 my $rv = $conf->_run_this_step(
 {
@@ -234,10 +261,51 @@
 n=> $n,
 }
 );
+if ( ! defined $rv ) {
+if ( $red_flag ) {
+return;
+} else {
+$conf->{log}->[$n] = {
+step=> $step_name,
+};
+}
+}
 }
 return 1;
 }
 
+sub _handle_fatal_step_option {
+my $conf = shift;
+my ($fatal_step) = @_;
+my %steps_to_die_for = ();
+my $named_step_pattern =qr/(?:init|inter|auto|gen)::[a-z]+/;
+my $unit_step_pattern = q

Re: [perl #46513] [BUG] t/pmc/exporter.t test failures

2007-10-17 Thread chromatic
On Wednesday 17 October 2007 19:30:09 James Keenan wrote:

> [li11-226:parrot] 550 $ prove -v t/pmc/exporter.t
> t/pmc/exporter1..12
> ok 1 - new
> not ok 2 - source
>
> # Failed test (t/pmc/exporter.t at line 43)
> # Exited with error code: [SIGNAL 11]
> # Received:
> # ok 1 - source() returns PMCNULL upon Exporter init
> # ok 2 - source() with args sets source namespace
> #
> # Expected:
> # ok 1 - source() returns PMCNULL upon Exporter init
> # ok 2 - source() with args sets source namespace
> # ok 3 - source() with too many args fails
> # ok 4 - source() with non-namespace arg throws exception
> #
> not ok 3 - destination
>
> # Failed test (t/pmc/exporter.t at line 95)
> # Exited with error code: [SIGNAL 11]
> # Received:
> # ok 1 - destination() with no args returns destination namespace
> # ok 2 - ...which is current namespace at first
> # ok 3 - destination() with args sets destination namespace
> #
> # Expected:
> # ok 1 - destination() with no args returns destination namespace
> # ok 2 - ...which is current namespace at first
> # ok 3 - destination() with args sets destination namespace
> # ok 4 - destination() with too many args fails
> # ok 5 - destination() with non-namespace arg throws exception
> #
> ok 4 - globals
> ok 5 - import - no args
> ok 6 - import - same source and destination namespaces
> ok 7 - import - globals as string
> ok 8 - import - globals with source passed separately
> ok 9 - import - globals as array
> ok 10 - import - globals as hash - null + empty string
> ok 11 - import - globals as hash - with dest names (latin)
> ok 12 - import - globals with destination
> # Looks like you failed 2 tests of 12.
> dubious
>  Test returned status 2 (wstat 512, 0x200)
> DIED. FAILED tests 2-3
>  Failed 2/12 tests, 83.33% okay
> Failed Test  Stat Wstat Total Fail  List of Failed
> 
> ---
> t/pmc/exporter.t2   512122  2-3
> Failed 1/1 test scripts. 2/12 subtests failed.
> Files=1, Tests=12,  1 wallclock secs ( 0.27 cusr +  0.11 csys =  0.38
> CPU)
> Failed 1/1 test programs. 2/12 subtests failed.

Darwin, I presume?  Should be fixed in r22202.

(Amusingly, I found this one last night with the harsh GC runcore.)

-- c