diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/utils/decorators.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py index 769b4fffdd..162a88fb78 100644 --- a/meta/lib/oeqa/utils/decorators.py +++ b/meta/lib/oeqa/utils/decorators.py | |||
@@ -116,13 +116,14 @@ def LogResults(original_class): | |||
116 | orig_method(self, result, *args, **kws) | 116 | orig_method(self, result, *args, **kws) |
117 | passed = True | 117 | passed = True |
118 | testMethod = getattr(self, self._testMethodName) | 118 | testMethod = getattr(self, self._testMethodName) |
119 | |||
120 | #if test case is decorated then use it's number, else use it's name | 119 | #if test case is decorated then use it's number, else use it's name |
121 | try: | 120 | try: |
122 | test_case = testMethod.test_case | 121 | test_case = testMethod.test_case |
123 | except AttributeError: | 122 | except AttributeError: |
124 | test_case = self._testMethodName | 123 | test_case = self._testMethodName |
125 | 124 | ||
125 | class_name = str(testMethod.im_class).split("'")[1] | ||
126 | |||
126 | #create custom logging level for filtering. | 127 | #create custom logging level for filtering. |
127 | custom_log_level = 100 | 128 | custom_log_level = 100 |
128 | logging.addLevelName(custom_log_level, 'RESULTS') | 129 | logging.addLevelName(custom_log_level, 'RESULTS') |
@@ -143,18 +144,19 @@ def LogResults(original_class): | |||
143 | local_log = logging.getLogger(caller) | 144 | local_log = logging.getLogger(caller) |
144 | 145 | ||
145 | #check status of tests and record it | 146 | #check status of tests and record it |
147 | |||
146 | for (name, msg) in result.errors: | 148 | for (name, msg) in result.errors: |
147 | if self._testMethodName == str(name).split(' ')[0]: | 149 | if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]): |
148 | local_log.results("Testcase "+str(test_case)+": ERROR") | 150 | local_log.results("Testcase "+str(test_case)+": ERROR") |
149 | local_log.results("Testcase "+str(test_case)+":\n"+msg) | 151 | local_log.results("Testcase "+str(test_case)+":\n"+msg) |
150 | passed = False | 152 | passed = False |
151 | for (name, msg) in result.failures: | 153 | for (name, msg) in result.failures: |
152 | if self._testMethodName == str(name).split(' ')[0]: | 154 | if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]): |
153 | local_log.results("Testcase "+str(test_case)+": FAILED") | 155 | local_log.results("Testcase "+str(test_case)+": FAILED") |
154 | local_log.results("Testcase "+str(test_case)+":\n"+msg) | 156 | local_log.results("Testcase "+str(test_case)+":\n"+msg) |
155 | passed = False | 157 | passed = False |
156 | for (name, msg) in result.skipped: | 158 | for (name, msg) in result.skipped: |
157 | if self._testMethodName == str(name).split(' ')[0]: | 159 | if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]): |
158 | local_log.results("Testcase "+str(test_case)+": SKIPPED") | 160 | local_log.results("Testcase "+str(test_case)+": SKIPPED") |
159 | passed = False | 161 | passed = False |
160 | if passed: | 162 | if passed: |