Handle duplicates in the brokens list
authorIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 13:55:40 +0000 (13:55 +0000)
committerIan Lynagh <ian@well-typed.com>
Mon, 11 Feb 2013 13:56:09 +0000 (13:56 +0000)
testsuite/driver/testlib.py

index 97a292d..b9104fc 100644 (file)
@@ -151,18 +151,22 @@ def expect_broken( bug ):
     return lambda name, opts, b=bug: _expect_broken (name, opts, b )
 
 def _expect_broken( name, opts, bug ):
-    global brokens
-    brokens.append((bug, name))
+    record_broken(name, bug)
     opts.expect = 'fail';
 
 def expect_broken_for( bug, ways ):
     return lambda name, opts, b=bug, w=ways: _expect_broken_for( name, opts, b, w )
 
 def _expect_broken_for( name, opts, bug, ways ):
-    global brokens
-    brokens.append((bug, name))
+    record_broken(name, bug)
     opts.expect_fail_for = ways
 
+def record_broken(name, bug):
+    global brokens
+    me = (bug, name)
+    if not me in brokens:
+        brokens.append(me)
+
 # -----
 
 def omit_ways( ways ):