summaryrefslogtreecommitdiff
path: root/meta/lib
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:03:57 +0000
commit11dd49cb9faaf6588f045083ab5bd6679e2eafc1 (patch)
tree47387fec224a76e55cbe3f7a03cbdbacaaa1507a /meta/lib
parent8d64ac4208e8dcb8a6fde6ea2959c9b3edfe2172 (diff)
downloadopenembedded-core-11dd49cb9faaf6588f045083ab5bd6679e2eafc1.tar.gz
openembedded-core-11dd49cb9faaf6588f045083ab5bd6679e2eafc1.tar.bz2
openembedded-core-11dd49cb9faaf6588f045083ab5bd6679e2eafc1.zip
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Diffstat (limited to 'meta/lib')
-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 @@
# Released under the MIT license (see COPYING.MIT)
import os
+import inspect
import unittest
def getSuiteCases(suite):
@@ -46,6 +47,12 @@ def getSuiteCasesIDs(suite):
"""
return getSuiteCasesInfo(suite, getCaseID)
+def getSuiteCasesFiles(suite):
+ """
+ Returns test case files paths from suite.
+ """
+ return getSuiteCasesInfo(suite, getCaseFile)
+
def getCaseModule(test_case):
"""
Returns test case module name.
@@ -64,6 +71,12 @@ def getCaseID(test_case):
"""
return test_case.id()
+def getCaseFile(test_case):
+ """
+ Returns test case file path.
+ """
+ return inspect.getsourcefile(test_case.__class__)
+
def getCaseMethod(test_case):
"""
Returns test case method name.