Skip to content
Permalink
Browse files

Allow "only" option on individual tests.

  • Loading branch information
cyrusdaboo committed Feb 15, 2013
1 parent bcc56a3 commit ebe817d3aa64ab526fc514f22e901795d1e219c3
Showing with 10 additions and 5 deletions.
  1. +2 −1 scripts/tests/CalDAV/caldavtest.dtd
  2. +2 −1 scripts/tests/CardDAV/caldavtest.dtd
  3. +4 −3 src/caldavtest.py
  4. +2 −0 src/test.py
@@ -77,4 +77,5 @@
<!ATTLIST test name CDATA #REQUIRED
count CDATA "1"
stats (yes|no) "no"
ignore (yes|no) "no">
ignore (yes|no) "no"
only (yes|no) "no">
@@ -77,4 +77,5 @@
<!ATTLIST test name CDATA #REQUIRED
count CDATA "1"
stats (yes|no) "no"
ignore (yes|no) "no">
ignore (yes|no) "no"
only (yes|no) "no">
@@ -159,8 +159,9 @@ def run_test_suite(self, suite, label=""):
if self.manager.memUsage:
start_usage = self.manager.getMemusage()
etags = {}
only_tests = any([test.only for test in suite.tests])
for test in suite.tests:
result = self.run_test(test, etags, label="%s | %s" % (label, test.name))
result = self.run_test(test, etags, only_tests, label="%s | %s" % (label, test.name))
if result == "t":
ok += 1
elif result == "f":
@@ -177,11 +178,11 @@ def run_test_suite(self, suite, label=""):
return (ok, failed, ignored)


def run_test(self, test, etags, label=""):
def run_test(self, test, etags, only, label=""):
descriptor = " Test: %s" % test.name
descriptor += " " * max(1, STATUSTXT_WIDTH - len(descriptor))
self.manager.log(manager.LOG_HIGH, "%s" % (descriptor,), before=1, after=0)
if test.ignore:
if test.ignore or only and not test.only:
self.manager.log(manager.LOG_HIGH, "[IGNORED]")
return "i"
elif len(test.missingFeatures()) != 0:
@@ -36,6 +36,7 @@ def __init__(self, manager):
self.count = 1
self.stats = False
self.ignore = False
self.only = False
self.require_features = set()
self.exclude_features = set()
self.description = ""
@@ -56,6 +57,7 @@ def parseXML(self, node):
self.count = int(node.get(src.xmlDefs.ATTR_COUNT, 1))
self.stats = getYesNoAttributeValue(node, src.xmlDefs.ATTR_STATS)
self.ignore = getYesNoAttributeValue(node, src.xmlDefs.ATTR_IGNORE)
self.only = getYesNoAttributeValue(node, src.xmlDefs.ATTR_ONLY)

for child in node.getchildren():
if child.tag == src.xmlDefs.ELEMENT_REQUIRE_FEATURE:

0 comments on commit ebe817d

Please sign in to comment.
You can’t perform that action at this time.