diff options
| author | Nathan Rossi <nathan@nathanrossi.com> | 2019-09-07 12:55:06 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-07 21:56:43 +0100 |
| commit | 13f1a9231d51d33134c804fc9a262b6bef98c9f7 (patch) | |
| tree | 412bbb962bfe360a0d23c39a6a4a6aba445e880e /meta/lib | |
| parent | d4dd54fa502c10b57fe1b666ade2c33abafb31d2 (diff) | |
| download | poky-13f1a9231d51d33134c804fc9a262b6bef98c9f7.tar.gz | |
oeqa/core/runner.py: Fix OETestTag listing
Use the __oeqa_testtags attribute added by OETestTag and display no, one
or more tags separated by a comma. Also change the formatting of the
output so that the list of tests is formatted as "<test> (<tags>)" and
remove the table header for "id" (it is no longer available).
(From OE-Core rev: d62e577a4e1a5f6accbce9f7bff7317a1162d72d)
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/core/runner.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py index 3060a00fbf..f656e1a9c5 100644 --- a/meta/lib/oeqa/core/runner.py +++ b/meta/lib/oeqa/core/runner.py | |||
| @@ -238,23 +238,20 @@ class OETestRunner(_TestRunner): | |||
| 238 | self._walked_cases = self._walked_cases + 1 | 238 | self._walked_cases = self._walked_cases + 1 |
| 239 | 239 | ||
| 240 | def _list_tests_name(self, suite): | 240 | def _list_tests_name(self, suite): |
| 241 | from oeqa.core.decorator.oetag import OETestTag | ||
| 242 | |||
| 243 | self._walked_cases = 0 | 241 | self._walked_cases = 0 |
| 244 | 242 | ||
| 245 | def _list_cases(logger, case): | 243 | def _list_cases(logger, case): |
| 246 | oetag = None | 244 | oetags = [] |
| 247 | 245 | if hasattr(case, '__oeqa_testtags'): | |
| 248 | if hasattr(case, 'decorators'): | 246 | oetags = getattr(case, '__oeqa_testtags') |
| 249 | for d in case.decorators: | 247 | if oetags: |
| 250 | if isinstance(d, OETestTag): | 248 | logger.info("%s (%s)" % (case.id(), ",".join(oetags))) |
| 251 | oetag = d.oetag | 249 | else: |
| 252 | 250 | logger.info("%s" % (case.id())) | |
| 253 | logger.info("%s\t\t%s" % (oetag, case.id())) | ||
| 254 | 251 | ||
| 255 | self.tc.logger.info("Listing all available tests:") | 252 | self.tc.logger.info("Listing all available tests:") |
| 256 | self._walked_cases = 0 | 253 | self._walked_cases = 0 |
| 257 | self.tc.logger.info("id\ttag\t\ttest") | 254 | self.tc.logger.info("test (tags)") |
| 258 | self.tc.logger.info("-" * 80) | 255 | self.tc.logger.info("-" * 80) |
| 259 | self._walk_suite(suite, _list_cases) | 256 | self._walk_suite(suite, _list_cases) |
| 260 | self.tc.logger.info("-" * 80) | 257 | self.tc.logger.info("-" * 80) |
