diff options
| -rw-r--r-- | meta/lib/oeqa/core/context.py | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/core/loader.py | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py index 2abe353d27..9313271f58 100644 --- a/meta/lib/oeqa/core/context.py +++ b/meta/lib/oeqa/core/context.py | |||
| @@ -81,7 +81,7 @@ class OETestContext(object): | |||
| 81 | def runTests(self, processes=None, skips=[]): | 81 | def runTests(self, processes=None, skips=[]): |
| 82 | self.runner = self.runnerClass(self, descriptions=False, verbosity=2) | 82 | self.runner = self.runnerClass(self, descriptions=False, verbosity=2) |
| 83 | 83 | ||
| 84 | # Dinamically skip those tests specified though arguments | 84 | # Dynamically skip those tests specified though arguments |
| 85 | self.skipTests(skips) | 85 | self.skipTests(skips) |
| 86 | 86 | ||
| 87 | self._run_start_time = time.time() | 87 | self._run_start_time = time.time() |
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py index 11978213b8..f25b5970e9 100644 --- a/meta/lib/oeqa/core/loader.py +++ b/meta/lib/oeqa/core/loader.py | |||
| @@ -37,7 +37,7 @@ def _find_duplicated_modules(suite, directory): | |||
| 37 | if path: | 37 | if path: |
| 38 | raise ImportError("Duplicated %s module found in %s" % (module, path)) | 38 | raise ImportError("Duplicated %s module found in %s" % (module, path)) |
| 39 | 39 | ||
| 40 | def _built_modules_dict(modules): | 40 | def _built_modules_dict(modules, logger): |
| 41 | modules_dict = {} | 41 | modules_dict = {} |
| 42 | 42 | ||
| 43 | if modules == None: | 43 | if modules == None: |
| @@ -48,6 +48,9 @@ def _built_modules_dict(modules): | |||
| 48 | # characters, whereas class names do | 48 | # characters, whereas class names do |
| 49 | m = re.match(r'^([0-9a-z_.]+)(?:\.(\w[^.]*)(?:\.([^.]+))?)?$', module, flags=re.ASCII) | 49 | m = re.match(r'^([0-9a-z_.]+)(?:\.(\w[^.]*)(?:\.([^.]+))?)?$', module, flags=re.ASCII) |
| 50 | if not m: | 50 | if not m: |
| 51 | logger.warn("module '%s' was skipped from selected modules, "\ | ||
| 52 | "because it doesn't match with module name assumptions: "\ | ||
| 53 | "package and module names do not contain upper case characters, whereas class names do" % module) | ||
| 51 | continue | 54 | continue |
| 52 | 55 | ||
| 53 | module_name, class_name, test_name = m.groups() | 56 | module_name, class_name, test_name = m.groups() |
| @@ -58,6 +61,8 @@ def _built_modules_dict(modules): | |||
| 58 | modules_dict[module_name][class_name] = [] | 61 | modules_dict[module_name][class_name] = [] |
| 59 | if test_name and test_name not in modules_dict[module_name][class_name]: | 62 | if test_name and test_name not in modules_dict[module_name][class_name]: |
| 60 | modules_dict[module_name][class_name].append(test_name) | 63 | modules_dict[module_name][class_name].append(test_name) |
| 64 | if modules and not modules_dict: | ||
| 65 | raise OEQATestNotFound("All selected modules were skipped, this would trigger selftest with all tests and -r ignored.") | ||
| 61 | 66 | ||
| 62 | return modules_dict | 67 | return modules_dict |
| 63 | 68 | ||
| @@ -71,7 +76,7 @@ class OETestLoader(unittest.TestLoader): | |||
| 71 | *args, **kwargs): | 76 | *args, **kwargs): |
| 72 | self.tc = tc | 77 | self.tc = tc |
| 73 | 78 | ||
| 74 | self.modules = _built_modules_dict(modules) | 79 | self.modules = _built_modules_dict(modules, tc.logger) |
| 75 | 80 | ||
| 76 | self.tests = tests | 81 | self.tests = tests |
| 77 | self.modules_required = modules_required | 82 | self.modules_required = modules_required |
