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:04:09 +0100 |
commit | baac26f1b36e89e07637b738dd31ec7356f05a02 (patch) | |
tree | 4f46e51659badd144239d393955fe3b394cafdc1 /meta/lib/oeqa/core/runner.py | |
parent | 4d01610f36eaee8da3126bb5045856279371fd17 (diff) | |
download | openembedded-core-baac26f1b36e89e07637b738dd31ec7356f05a02.tar.gz openembedded-core-baac26f1b36e89e07637b738dd31ec7356f05a02.tar.bz2 openembedded-core-baac26f1b36e89e07637b738dd31ec7356f05a02.zip |
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]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
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): break oeid = -1 - for d in case.decorators: - if hasattr(d, 'oeid'): - oeid = d.oeid + if hasattr(case, 'decorators'): + for d in case.decorators: + if hasattr(d, 'oeid'): + oeid = d.oeid if fail: self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(), @@ -188,9 +189,10 @@ class OETestRunner(_TestRunner): def _list_cases_without_id(logger, case): found_id = False - for d in case.decorators: - if isinstance(d, OETestID): - found_id = True + if hasattr(case, 'decorators'): + for d in case.decorators: + if isinstance(d, OETestID): + found_id = True if not found_id: logger.info('oeid missing for %s' % case.id()) @@ -199,11 +201,12 @@ class OETestRunner(_TestRunner): oeid = None oetag = None - for d in case.decorators: - if isinstance(d, OETestID): - oeid = d.oeid - elif isinstance(d, OETestTag): - oetag = d.oetag + if hasattr(case, 'decorators'): + for d in case.decorators: + if isinstance(d, OETestID): + oeid = d.oeid + elif isinstance(d, OETestTag): + oetag = d.oetag logger.info("%s\t%s\t\t%s" % (oeid, oetag, case.id())) |