summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-rw-r--r--meta/lib/oeqa/oetest.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 95661506e3..70d12a225e 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -14,7 +14,7 @@ import bb
14from oeqa.utils.sshcontrol import SSHControl 14from oeqa.utils.sshcontrol import SSHControl
15 15
16 16
17def runTests(tc): 17def loadTests(tc):
18 18
19 # set the context object passed from the test class 19 # set the context object passed from the test class
20 setattr(oeTest, "tc", tc) 20 setattr(oeTest, "tc", tc)
@@ -24,12 +24,16 @@ def runTests(tc):
24 suite = unittest.TestSuite() 24 suite = unittest.TestSuite()
25 testloader = unittest.TestLoader() 25 testloader = unittest.TestLoader()
26 testloader.sortTestMethodsUsing = None 26 testloader.sortTestMethodsUsing = None
27 runner = unittest.TextTestRunner(verbosity=2) 27 suite = testloader.loadTestsFromNames(tc.testslist)
28
29 return suite
30
31def runTests(tc):
28 32
33 suite = loadTests(tc)
29 bb.note("Test modules %s" % tc.testslist) 34 bb.note("Test modules %s" % tc.testslist)
30 suite = testloader.loadTestsFromNames(tc.testslist)
31 bb.note("Found %s tests" % suite.countTestCases()) 35 bb.note("Found %s tests" % suite.countTestCases())
32 36 runner = unittest.TextTestRunner(verbosity=2)
33 result = runner.run(suite) 37 result = runner.run(suite)
34 38
35 return result 39 return result
@@ -81,11 +85,7 @@ class oeRuntimeTest(oeTest):
81 85
82 @classmethod 86 @classmethod
83 def restartTarget(self,params=None): 87 def restartTarget(self,params=None):
84 88 oeRuntimeTest.tc.target.restart(params)
85 if oeRuntimeTest.tc.qemu.restart(params):
86 oeRuntimeTest.tc.target.host = oeRuntimeTest.tc.qemu.ip
87 else:
88 raise Exception("Restarting target failed")
89 89
90 90
91def getmodule(pos=2): 91def getmodule(pos=2):
@@ -103,7 +103,7 @@ def skipModule(reason, pos=2):
103 else: 103 else:
104 raise Exception("\nTest %s wants to be skipped.\nReason is: %s" \ 104 raise Exception("\nTest %s wants to be skipped.\nReason is: %s" \
105 "\nTest was required in TEST_SUITES, so either the condition for skipping is wrong" \ 105 "\nTest was required in TEST_SUITES, so either the condition for skipping is wrong" \
106 "\nor the image really doesn't have the requred feature/package when it should." % (modname, reason)) 106 "\nor the image really doesn't have the required feature/package when it should." % (modname, reason))
107 107
108def skipModuleIf(cond, reason): 108def skipModuleIf(cond, reason):
109 109