Lines Matching full:test
7 and results of a single test run.
24 Enforce a singleton pattern to allow introspection of test progress.
27 to enable each test instance to track its failure/error status. It
28 is used in the LLDB test framework to emit detailed trace messages
29 to a log file for easier human inspection of test failures/errors.
76 def _config_string(self, test): argument
77 compiler = getattr(test, "getCompiler", None)
78 arch = getattr(test, "getArchitecture", None)
82 def _exc_info_to_string(self, err, test): argument
84 our test config info string to the exception info string."""
85 if hasattr(test, "getArchitecture") and hasattr(test, "getCompiler"):
88 test),
89 test.getArchitecture(),
90 test.getCompiler())
92 return super(LLDBTestResult, self)._exc_info_to_string(err, test)
94 def getDescription(self, test): argument
95 doc_first_line = test.shortDescription()
97 return '\n'.join((str(test), self.indentation + doc_first_line))
99 return str(test)
101 def _getTestPath(self, test): argument
102 # Use test.test_filename if the test was created with
104 if test is None:
106 elif hasattr(test, "test_filename"):
107 return test.test_filename
110 return inspect.getsourcefile(test.__class__)
112 def _getFileBasedCategories(self, test): argument
114 Returns the list of categories to which this test case belongs by
115 collecting values of "categories" files. We start at the folder the test is in
116 and traverse the hierarchy upwards until the test-suite root directory.
118 start_path = self._getTestPath(test)
125 raise Exception("The test file %s is outside the test root directory" % start_path)
139 def getCategoriesForTest(self, test): argument
141 Gets all the categories for the currently running test method in test case
144 test_method = getattr(test, test._testMethodName)
148 test_categories.extend(self._getFileBasedCategories(test))
152 def hardMarkAsSkipped(self, test): argument
153 getattr(test, test._testMethodName).__func__.__unittest_skip__ = True
155 test,
156 …test._testMethodName).__func__.__unittest_skip_why__ = "test case does not fall in any category of…
166 def checkCategoryExclusion(self, exclusion_list, test): argument
168 self.getCategoriesForTest(test))
170 def startTest(self, test): argument
172 self.getCategoriesForTest(test)):
173 self.hardMarkAsSkipped(test)
175 configuration.skip_tests, test.id()):
176 self.hardMarkAsSkipped(test)
179 test.test_number = self.counter
182 super(LLDBTestResult, self).startTest(test)
184 def addSuccess(self, test): argument
186 configuration.xfail_tests, test.id()) or
188 configuration.xfail_categories, test)):
189 self.addUnexpectedSuccess(test, None)
192 super(LLDBTestResult, self).addSuccess(test)
195 (self._config_string(test), str(test)))
201 def _saveBuildErrorTuple(self, test, err): argument
207 os.path.dirname(self._getTestPath(test)))
208 self.errors.append((test, error_description))
211 def addError(self, test, err): argument
214 self._saveBuildErrorTuple(test, err)
216 super(LLDBTestResult, self).addError(test, err)
218 method = getattr(test, "markError", None)
223 (self._config_string(test), str(test)))
225 def addCleanupError(self, test, err): argument
227 super(LLDBTestResult, self).addCleanupError(test, err)
228 method = getattr(test, "markCleanupError", None)
233 (self._config_string(test), str(test), traceback.format_exc()))
235 def addFailure(self, test, err): argument
237 configuration.xfail_tests, test.id()) or
239 configuration.xfail_categories, test)):
240 self.addExpectedFailure(test, err, None)
244 super(LLDBTestResult, self).addFailure(test, err)
245 method = getattr(test, "markFailure", None)
250 (self._config_string(test), str(test)))
252 test_categories = self.getCategoriesForTest(test)
260 def addExpectedFailure(self, test, err, bugnumber): argument
262 super(LLDBTestResult, self).addExpectedFailure(test, err, bugnumber)
263 method = getattr(test, "markExpectedFailure", None)
268 (self._config_string(test), str(test)))
270 def addSkip(self, test, reason): argument
272 super(LLDBTestResult, self).addSkip(test, reason)
273 method = getattr(test, "markSkippedTest", None)
278 (self._config_string(test), str(test), reason))
280 def addUnexpectedSuccess(self, test, bugnumber): argument
282 super(LLDBTestResult, self).addUnexpectedSuccess(test, bugnumber)
283 method = getattr(test, "markUnexpectedSuccess", None)
288 (self._config_string(test), str(test)))