summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-01-09 14:42:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:20 +0000
commit8970ed4b1fd5673fd3472934a000d10bcce297c2 (patch)
tree2c6834e47d3ef5dd3fbbc79ff24103503691ab4e
parent41e4db0eeaaa19f9f4d425960011b02c29f01c1c (diff)
downloadpoky-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>
-rw-r--r--meta/lib/oeqa/core/utils/test.py13
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
4import os 4import os
5import inspect
5import unittest 6import unittest
6 7
7def getSuiteCases(suite): 8def getSuiteCases(suite):
@@ -46,6 +47,12 @@ def getSuiteCasesIDs(suite):
46 """ 47 """
47 return getSuiteCasesInfo(suite, getCaseID) 48 return getSuiteCasesInfo(suite, getCaseID)
48 49
50def getSuiteCasesFiles(suite):
51 """
52 Returns test case files paths from suite.
53 """
54 return getSuiteCasesInfo(suite, getCaseFile)
55
49def getCaseModule(test_case): 56def 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
74def getCaseFile(test_case):
75 """
76 Returns test case file path.
77 """
78 return inspect.getsourcefile(test_case.__class__)
79
67def getCaseMethod(test_case): 80def getCaseMethod(test_case):
68 """ 81 """
69 Returns test case method name. 82 Returns test case method name.