6 def __init__(self, name, isFailure):
8 self.isFailure = isFailure
11 return '%s%r' % (self.__class__.__name__,
12 (self.name, self.isFailure))
14 PASS = TestResult('PASS', False)
15 XFAIL = TestResult('XFAIL', False)
16 FAIL = TestResult('FAIL', True)
17 XPASS = TestResult('XPASS', True)
18 UNRESOLVED = TestResult('UNRESOLVED', True)
19 UNSUPPORTED = TestResult('UNSUPPORTED', False)
24 """TestFormat - Test information provider."""
26 def __init__(self, name):
30 """TestSuite - Information on a group of tests.
32 A test suite groups together a set of logically related tests.
35 def __init__(self, name, source_root, exec_root, config):
37 self.source_root = source_root
38 self.exec_root = exec_root
39 # The test suite configuration.
42 def getSourcePath(self, components):
43 return os.path.join(self.source_root, *components)
45 def getExecPath(self, components):
46 return os.path.join(self.exec_root, *components)
49 """Test - Information on a single test instance."""
51 def __init__(self, suite, path_in_suite, config):
53 self.path_in_suite = path_in_suite
55 # The test result code, once complete.
57 # Any additional output from the test, once complete.
59 # The wall time to execute this test, if timing and once complete.
62 def setResult(self, result, output, elapsed):
63 assert self.result is None, "Test result already set!"
66 self.elapsed = elapsed
68 def getFullName(self):
69 return self.suite.config.name + ' :: ' + '/'.join(self.path_in_suite)
71 def getSourcePath(self):
72 return self.suite.getSourcePath(self.path_in_suite)
74 def getExecPath(self):
75 return self.suite.getExecPath(self.path_in_suite)