diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2017-01-09 14:42:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:05:20 +0000 |
commit | 8970ed4b1fd5673fd3472934a000d10bcce297c2 (patch) | |
tree | 2c6834e47d3ef5dd3fbbc79ff24103503691ab4e /meta | |
parent | 41e4db0eeaaa19f9f4d425960011b02c29f01c1c (diff) | |
download | poky-8970ed4b1fd5673fd3472934a000d10bcce297c2.tar.gz |
oeqa/core/utils/test.py: Add functions to get module path
This will add functions to get module file path from a test
case or a complete suite.
[YOCTO #10234]
(From OE-Core rev: 11dd49cb9faaf6588f045083ab5bd6679e2eafc1)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/core/utils/test.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/utils/test.py b/meta/lib/oeqa/core/utils/test.py index 820b9976ab..88d176552e 100644 --- a/meta/lib/oeqa/core/utils/test.py +++ b/meta/lib/oeqa/core/utils/test.py | |||
@@ -2,6 +2,7 @@ | |||
2 | # Released under the MIT license (see COPYING.MIT) | 2 | # Released under the MIT license (see COPYING.MIT) |
3 | 3 | ||
4 | import os | 4 | import os |
5 | import inspect | ||
5 | import unittest | 6 | import unittest |
6 | 7 | ||
7 | def getSuiteCases(suite): | 8 | def getSuiteCases(suite): |
@@ -46,6 +47,12 @@ def getSuiteCasesIDs(suite): | |||
46 | """ | 47 | """ |
47 | return getSuiteCasesInfo(suite, getCaseID) | 48 | return getSuiteCasesInfo(suite, getCaseID) |
48 | 49 | ||
50 | def getSuiteCasesFiles(suite): | ||
51 | """ | ||
52 | Returns test case files paths from suite. | ||
53 | """ | ||
54 | return getSuiteCasesInfo(suite, getCaseFile) | ||
55 | |||
49 | def getCaseModule(test_case): | 56 | def getCaseModule(test_case): |
50 | """ | 57 | """ |
51 | Returns test case module name. | 58 | Returns test case module name. |
@@ -64,6 +71,12 @@ def getCaseID(test_case): | |||
64 | """ | 71 | """ |
65 | return test_case.id() | 72 | return test_case.id() |
66 | 73 | ||
74 | def getCaseFile(test_case): | ||
75 | """ | ||
76 | Returns test case file path. | ||
77 | """ | ||
78 | return inspect.getsourcefile(test_case.__class__) | ||
79 | |||
67 | def getCaseMethod(test_case): | 80 | def getCaseMethod(test_case): |
68 | """ | 81 | """ |
69 | Returns test case method name. | 82 | Returns test case method name. |