[svn:parrot] r45799 - in trunk: runtime/parrot/library/TAP tools/dev
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Mon Apr 19 10:25:43 UTC 2010
Author: fperrad
Date: Mon Apr 19 10:25:43 2010
New Revision: 45799
URL: https://trac.parrot.org/parrot/changeset/45799
Log:
[TAP] add options --merge & --ignore-exit
Modified:
trunk/runtime/parrot/library/TAP/Harness.pir
trunk/runtime/parrot/library/TAP/Parser.pir
trunk/tools/dev/tapir.pir
Modified: trunk/runtime/parrot/library/TAP/Harness.pir
==============================================================================
--- trunk/runtime/parrot/library/TAP/Harness.pir Mon Apr 19 10:04:23 2010 (r45798)
+++ trunk/runtime/parrot/library/TAP/Harness.pir Mon Apr 19 10:25:43 2010 (r45799)
@@ -23,6 +23,8 @@
$P0 = subclass ['TAP';'Base'], ['TAP';'Harness']
$P0.'add_attribute'('formatter')
$P0.'add_attribute'('exec')
+ $P0.'add_attribute'('ignore_exit')
+ $P0.'add_attribute'('merge')
$P0.'add_attribute'('opts')
$P0 = new 'Hash'
@@ -50,6 +52,20 @@
$P0 = box $S0
setattribute self, 'exec', $P0
L1:
+ $I0 = exists opts['ignore-exit']
+ unless $I0 goto L2
+ $S0 = opts['ignore-exit']
+ $P0 = new 'Boolean'
+ set $P0, 1
+ setattribute self, 'ignore_exit', $P0
+ L2:
+ $I0 = exists opts['merge']
+ unless $I0 goto L3
+ $S0 = opts['merge']
+ $P0 = new 'Boolean'
+ set $P0, 1
+ setattribute self, 'merge', $P0
+ L3:
.end
.sub 'formatter' :method
@@ -147,6 +163,14 @@
.param string desc
.local pmc parser, session
parser = new ['TAP';'Parser']
+ $P0 = getattribute self, 'merge'
+ if null $P0 goto L1
+ parser.'merge'($P0)
+ L1:
+ $P0 = getattribute self, 'ignore_exit'
+ if null $P0 goto L2
+ parser.'ignore_exit'($P0)
+ L2:
self.'_open_spool'(parser, desc)
self.'_make_callback'('made_parser', parser)
$P0 = getattribute self, 'formatter'
Modified: trunk/runtime/parrot/library/TAP/Parser.pir
==============================================================================
--- trunk/runtime/parrot/library/TAP/Parser.pir Mon Apr 19 10:04:23 2010 (r45798)
+++ trunk/runtime/parrot/library/TAP/Parser.pir Mon Apr 19 10:25:43 2010 (r45799)
@@ -506,6 +506,7 @@
$P0.'add_attribute'('version')
$P0.'add_attribute'('exit')
$P0.'add_attribute'('ignore_exit')
+ $P0.'add_attribute'('merge')
$P0.'add_attribute'('spool')
$P0.'add_attribute'('start_time')
$P0.'add_attribute'('end_time')
@@ -599,10 +600,17 @@
.return ($P0)
.end
+.sub 'merge' :method :nsentry
+ .param int val
+ $P0 = new 'Boolean'
+ set $P0, val
+ setattribute self, 'merge', $P0
+.end
+
.sub 'ignore_exit' :method :nsentry
- .param int ign
+ .param int val
$P0 = new 'Boolean'
- set $P0, ign
+ set $P0, val
setattribute self, 'ignore_exit', $P0
.end
@@ -727,6 +735,11 @@
.param pmc cmds :slurpy
.local string cmd
cmd = join ' ', cmds
+ $P0 = getattribute self, 'merge'
+ if null $P0 goto L1
+ unless $P0 goto L1
+ cmd .= ' 2>&1'
+ L1:
$P0 = new 'FileHandle'
push_eh _handler
$P0.'open'(cmd, 'pr')
Modified: trunk/tools/dev/tapir.pir
==============================================================================
--- trunk/tools/dev/tapir.pir Mon Apr 19 10:04:23 2010 (r45798)
+++ trunk/tools/dev/tapir.pir Mon Apr 19 10:25:43 2010 (r45799)
@@ -41,6 +41,7 @@
-f, --failures Show failed tests.
-o, --comments Show comments.
--ignore-exit Ignore exit status from test scripts.
+ -m, --merge Merge test scripts' STDERR with their STDOUT.
--reverse Run the tests in reverse order.
-q, --quiet Suppress some test output while running tests.
-Q, --QUIET Only print summary results.
@@ -74,6 +75,7 @@
push getopts, 'directives'
push getopts, 'ignore-exit'
push getopts, 'reverse'
+ push getopts, 'merge|m'
push getopts, 'shuffle|s'
push getopts, 'version|V'
push getopts, 'help|h'
More information about the parrot-commits
mailing list