diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2017-06-08 11:32:05 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 15:08:30 +0100 |
commit | 0b168b269b497383d01e71db585235948b71a3f8 (patch) | |
tree | 3241000fd819712855e921d0848460c551d67931 /meta/lib/oeqa/core/runner.py | |
parent | c3587b7d1005c8564e54263768d0088afbb5c946 (diff) | |
download | poky-0b168b269b497383d01e71db585235948b71a3f8.tar.gz |
oeqa/core/loader: Allow unittest.TestCase's to be executed
Currently there was a restriction to only execute tests that's
inherits from OETestCase but in some circunstancies the features
from the OEQA framework isn't needed so we need to support
basic unittests.
[YOCTO #10828]
(From OE-Core rev: baac26f1b36e89e07637b738dd31ec7356f05a02)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/runner.py')
-rw-r--r-- | meta/lib/oeqa/core/runner.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py index 7ce718e784..532b25b98a 100644 --- a/meta/lib/oeqa/core/runner.py +++ b/meta/lib/oeqa/core/runner.py | |||
@@ -121,9 +121,10 @@ class OETestResult(_TestResult): | |||
121 | break | 121 | break |
122 | 122 | ||
123 | oeid = -1 | 123 | oeid = -1 |
124 | for d in case.decorators: | 124 | if hasattr(case, 'decorators'): |
125 | if hasattr(d, 'oeid'): | 125 | for d in case.decorators: |
126 | oeid = d.oeid | 126 | if hasattr(d, 'oeid'): |
127 | oeid = d.oeid | ||
127 | 128 | ||
128 | if fail: | 129 | if fail: |
129 | self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(), | 130 | self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(), |
@@ -188,9 +189,10 @@ class OETestRunner(_TestRunner): | |||
188 | def _list_cases_without_id(logger, case): | 189 | def _list_cases_without_id(logger, case): |
189 | 190 | ||
190 | found_id = False | 191 | found_id = False |
191 | for d in case.decorators: | 192 | if hasattr(case, 'decorators'): |
192 | if isinstance(d, OETestID): | 193 | for d in case.decorators: |
193 | found_id = True | 194 | if isinstance(d, OETestID): |
195 | found_id = True | ||
194 | 196 | ||
195 | if not found_id: | 197 | if not found_id: |
196 | logger.info('oeid missing for %s' % case.id()) | 198 | logger.info('oeid missing for %s' % case.id()) |
@@ -199,11 +201,12 @@ class OETestRunner(_TestRunner): | |||
199 | oeid = None | 201 | oeid = None |
200 | oetag = None | 202 | oetag = None |
201 | 203 | ||
202 | for d in case.decorators: | 204 | if hasattr(case, 'decorators'): |
203 | if isinstance(d, OETestID): | 205 | for d in case.decorators: |
204 | oeid = d.oeid | 206 | if isinstance(d, OETestID): |
205 | elif isinstance(d, OETestTag): | 207 | oeid = d.oeid |
206 | oetag = d.oetag | 208 | elif isinstance(d, OETestTag): |
209 | oetag = d.oetag | ||
207 | 210 | ||
208 | logger.info("%s\t%s\t\t%s" % (oeid, oetag, case.id())) | 211 | logger.info("%s\t%s\t\t%s" % (oeid, oetag, case.id())) |
209 | 212 | ||