summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorAníbal Limón <limon.anibal@gmail.com>2016-01-30 19:16:10 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 16:06:23 +0000
commit3577c35f6e09112b795b0cbc12c21911815568a6 (patch)
tree8d239a0ca7ead09e7f2f468ade74d9016f494b61 /meta/classes
parent8009418d55721171bb2632b7af72b0b0eaa1933d (diff)
downloadpoky-3577c35f6e09112b795b0cbc12c21911815568a6.tar.gz
oetest.py/TestContext: Move loadTests and runTests inside it.
Method's for loadTests and runTests make sense to define inside TestContext because it can be different around Image, SDK, SDKExt. (From OE-Core rev: 03af7b99e3ce36ce3e29dc31e33d2cc74eb14849) Signed-off-by: Aníbal Limón <limon.anibal@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/testimage.bbclass6
-rw-r--r--meta/classes/testsdk.bbclass6
2 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 7f9c918273..53c6174ac5 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -195,7 +195,7 @@ def testimage_main(d):
195 import oeqa.runtime 195 import oeqa.runtime
196 import time 196 import time
197 import signal 197 import signal
198 from oeqa.oetest import loadTests, runTests, ImageTestContext 198 from oeqa.oetest import ImageTestContext
199 from oeqa.targetcontrol import get_target_controller 199 from oeqa.targetcontrol import get_target_controller
200 from oeqa.utils.dump import get_host_dumper 200 from oeqa.utils.dump import get_host_dumper
201 201
@@ -219,7 +219,7 @@ def testimage_main(d):
219 # we are doing that to find compile errors in the tests themselves 219 # we are doing that to find compile errors in the tests themselves
220 # before booting the image 220 # before booting the image
221 try: 221 try:
222 loadTests(tc) 222 tc.loadTests()
223 except Exception as e: 223 except Exception as e:
224 import traceback 224 import traceback
225 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) 225 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
@@ -233,7 +233,7 @@ def testimage_main(d):
233 try: 233 try:
234 target.start() 234 target.start()
235 starttime = time.time() 235 starttime = time.time()
236 result = runTests(tc) 236 result = tc.runTests()
237 stoptime = time.time() 237 stoptime = time.time()
238 if result.wasSuccessful(): 238 if result.wasSuccessful():
239 bb.plain("%s - Ran %d test%s in %.3fs" % (pn, result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime)) 239 bb.plain("%s - Ran %d test%s in %.3fs" % (pn, result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 47bad29096..ba8897e5ea 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -13,7 +13,7 @@ def testsdk_main(d):
13 import oeqa.sdk 13 import oeqa.sdk
14 import time 14 import time
15 import subprocess 15 import subprocess
16 from oeqa.oetest import loadTests, runTests, SDKTestContext 16 from oeqa.oetest import SDKTestContext
17 17
18 pn = d.getVar("PN", True) 18 pn = d.getVar("PN", True)
19 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True)) 19 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
@@ -40,13 +40,13 @@ def testsdk_main(d):
40 # we are doing that to find compile errors in the tests themselves 40 # we are doing that to find compile errors in the tests themselves
41 # before booting the image 41 # before booting the image
42 try: 42 try:
43 loadTests(tc, "sdk") 43 tc.loadTests()
44 except Exception as e: 44 except Exception as e:
45 import traceback 45 import traceback
46 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) 46 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
47 47
48 starttime = time.time() 48 starttime = time.time()
49 result = runTests(tc, "sdk") 49 result = tc.runTests()
50 stoptime = time.time() 50 stoptime = time.time()
51 if result.wasSuccessful(): 51 if result.wasSuccessful():
52 bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime)) 52 bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))