[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz doc/pegboard/bug_test--tjl/peg.rst test/tes...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz doc/pegboard/bug_test--tjl/peg.rst test/tes... |
Date: |
Thu, 21 Nov 2002 06:06:39 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/11/21 06:06:39
Modified files:
doc/pegboard/bug_test--tjl: peg.rst
test : testutil.py
Log message:
Implement bug_test -- there was already some discussion and we need
this *NOW*.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/bug_test--tjl/peg.rst.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/testutil.py.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
Patches:
Index: gzz/doc/pegboard/bug_test--tjl/peg.rst
diff -u gzz/doc/pegboard/bug_test--tjl/peg.rst:1.3
gzz/doc/pegboard/bug_test--tjl/peg.rst:1.4
--- gzz/doc/pegboard/bug_test--tjl/peg.rst:1.3 Thu Nov 21 05:09:11 2002
+++ gzz/doc/pegboard/bug_test--tjl/peg.rst Thu Nov 21 06:06:39 2002
@@ -3,9 +3,9 @@
=============================================================
:Author: Tuomas Lukka
-:Last-Modified: $Date: 2002/11/21 10:09:11 $
-:Revision: $Revision: 1.3 $
-:Status: Incomplete
+:Last-Modified: $Date: 2002/11/21 11:06:39 $
+:Revision: $Revision: 1.4 $
+:Status: Implemented
Making failing tests for bugs is not currently handled very
well. This PEG proposes a relatively simple way to handle it.
Index: gzz/test/testutil.py
diff -u gzz/test/testutil.py:1.37 gzz/test/testutil.py:1.38
--- gzz/test/testutil.py:1.37 Thu Nov 21 05:09:11 2002
+++ gzz/test/testutil.py Thu Nov 21 06:06:39 2002
@@ -36,6 +36,7 @@
import java
from gzz.client import GraphicsAPI
import gzz.util.saveimage
+import re
true = 1
false = 0
@@ -165,7 +166,9 @@
raise t
'''
- testcodes = [testcode % (t, docstring(tests[t]), t) for t in testnames]
+ testcodes = [testcode % (t, docstring(tests[t]), t)
+ for t in testnames
+ if shouldRun(tests[t])]
code += '\n'.join(testcodes) + '\n'
@@ -185,6 +188,25 @@
return '"""%s"""' % (obj.__doc__,)
else: return ""
+runfail = [None]
+
+def shouldRun(obj):
+ print "shouldrun",obj
+ if getattr(obj,"__doc__", None) == None: return 1
+ doc = obj.__doc__
+ m = re.search("\n\s*fail:\s*(.*?)\s*\n", doc)
+ fail = None
+ print m, doc
+ if m != None:
+ fail = m.group(1)
+ print "TEST FAILS IN ", fail
+ if fail not in ["AWT", "GL", "*"]:
+ raise str(("Invalid docstring fail message ",obj.__doc__))
+ if fail in runfail:
+ return 1
+ print "NOT RUNNING DUE TO WRONG F: ",obj
+ return 0
+
def suite(files, omit=[]):
@@ -205,12 +227,15 @@
import getopt
import gzz.util.dbg
opts, args = getopt.getopt(sys.argv[1:],
- gzz.util.dbg.short,
- gzz.util.dbg.long)
+ gzz.util.dbg.short + "f:",
+ gzz.util.dbg.long + ["--allowfail="])
for o,a in opts:
print "Opt: ",o,a
if o in gzz.util.dbg.all:
gzz.util.dbg.option(o,a)
+ elif o in ("-f", "--allowfail"):
+ f = a.split(",")
+ runfail = f
test = args
try:
if test.index('jni') >=0:
- [Gzz-commits] gzz doc/pegboard/bug_test--tjl/peg.rst test/tes...,
Tuomas J. Lukka <=