[svn:parrot] r47136 - trunk/runtime/parrot/library

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sun May 30 08:40:07 UTC 2010


Author: fperrad
Date: Sun May 30 08:40:07 2010
New Revision: 47136
URL: https://trac.parrot.org/parrot/changeset/47136

Log:
[distutils] add a helper runtests()

Modified:
   trunk/runtime/parrot/library/distutils.pir

Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir	Sun May 30 08:27:41 2010	(r47135)
+++ trunk/runtime/parrot/library/distutils.pir	Sun May 30 08:40:07 2010	(r47136)
@@ -4523,6 +4523,36 @@
     .return ($I0)
 .end
 
+=item runtests
+
+=cut
+
+.sub 'runtests' :multi()
+    .param pmc files :slurpy
+    .param pmc opts :slurpy :named
+    load_bytecode 'TAP/Harness.pbc'
+    .local pmc harness
+    harness = new ['TAP';'Harness']
+    harness.'process_args'(opts)
+    .local pmc aggregate
+    aggregate = harness.'runtests'(files)
+    $I0 = aggregate.'has_errors'()
+    unless $I0 goto L1
+    $I0 = exists opts['ignore_error']
+    unless $I0 goto L2
+    $I0 = opts['ignore_error']
+    if $I0 goto L1
+  L2:
+    die "test fails"
+  L1:
+.end
+
+.sub 'runtests' :multi(ResizableStringArray,Hash)
+    .param pmc array
+    .param pmc hash
+    .tailcall runtests(array :flat, hash :flat :named)
+.end
+
 =back
 
 =head1 AUTHOR


More information about the parrot-commits mailing list