diff options
Diffstat (limited to 'meta/lib/oeqa/core/loader.py')
-rw-r--r-- | meta/lib/oeqa/core/loader.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py index 11978213b8..d12d5a055c 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 |
@@ -311,6 +316,9 @@ class OETestLoader(unittest.TestLoader): | |||
311 | module_name_small in self.modules) \ | 316 | module_name_small in self.modules) \ |
312 | else False | 317 | else False |
313 | 318 | ||
319 | if any(c.isupper() for c in module.__name__): | ||
320 | raise SystemExit("Module '%s' contains uppercase characters and this isn't supported. Please fix the module name." % module.__name__) | ||
321 | |||
314 | return (load_module, load_underscore) | 322 | return (load_module, load_underscore) |
315 | 323 | ||
316 | 324 | ||