summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorAníbal Limón <limon.anibal@gmail.com>2016-01-30 11:55:39 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 16:06:22 +0000
commit8009418d55721171bb2632b7af72b0b0eaa1933d (patch)
tree2de2c8a898439fce818a9b18b296d1af9a61011f /meta/classes
parentb588b80d667052f2864d529793bf7db155b29f90 (diff)
downloadpoky-8009418d55721171bb2632b7af72b0b0eaa1933d.tar.gz
testimage/testsdk: Move get test suites routine inside TestContext.
In order to provide better abstraction move functions to get the test suite inside the TestContext. (From OE-Core rev: 552285688441330440bd1bc138aeaea87549024a) 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.bbclass11
-rw-r--r--meta/classes/testsdk.bbclass19
2 files changed, 4 insertions, 26 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index bdd6c9de6f..7f9c918273 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -195,8 +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, \ 198 from oeqa.oetest import loadTests, runTests, ImageTestContext
199 get_test_suites, get_tests_list, ImageTestContext
200 from oeqa.targetcontrol import get_target_controller 199 from oeqa.targetcontrol import get_target_controller
201 from oeqa.utils.dump import get_host_dumper 200 from oeqa.utils.dump import get_host_dumper
202 201
@@ -207,12 +206,6 @@ def testimage_main(d):
207 bb.utils.remove(d.getVar("TEST_EXPORT_DIR", True), recurse=True) 206 bb.utils.remove(d.getVar("TEST_EXPORT_DIR", True), recurse=True)
208 bb.utils.mkdirhier(d.getVar("TEST_EXPORT_DIR", True)) 207 bb.utils.mkdirhier(d.getVar("TEST_EXPORT_DIR", True))
209 208
210 # tests in TEST_SUITES become required tests
211 # they won't be skipped even if they aren't suitable for a image (like xorg for minimal)
212 # testslist is what we'll actually pass to the unittest loader
213 testslist = get_tests_list(get_test_suites(d), d.getVar("BBPATH", True).split(':'))
214 testsrequired = [t for t in d.getVar("TEST_SUITES", True).split() if t != "auto"]
215
216 # we need the host dumper in test context 209 # we need the host dumper in test context
217 host_dumper = get_host_dumper(d) 210 host_dumper = get_host_dumper(d)
218 211
@@ -220,7 +213,7 @@ def testimage_main(d):
220 target = get_target_controller(d) 213 target = get_target_controller(d)
221 214
222 # test context 215 # test context
223 tc = ImageTestContext(d, testslist, testsrequired, target, host_dumper) 216 tc = ImageTestContext(d, target, host_dumper)
224 217
225 # this is a dummy load of tests 218 # this is a dummy load of tests
226 # 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
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 06e7a77398..47bad29096 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -13,18 +13,11 @@ 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, \ 16 from oeqa.oetest import loadTests, runTests, SDKTestContext
17 get_test_suites, get_tests_list, SDKTestContext
18 17
19 pn = d.getVar("PN", True) 18 pn = d.getVar("PN", True)
20 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True)) 19 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
21 20
22 # tests in TEST_SUITES become required tests
23 # they won't be skipped even if they aren't suitable.
24 # testslist is what we'll actually pass to the unittest loader
25 testslist = get_tests_list(get_test_suites(d, "sdk"), d.getVar("BBPATH", True).split(':'), "sdk")
26 testsrequired = [t for t in (d.getVar("TEST_SUITES_SDK", True) or "auto").split() if t != "auto"]
27
28 tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh") 21 tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
29 if not os.path.exists(tcname): 22 if not os.path.exists(tcname):
30 bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .") 23 bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .")
@@ -41,7 +34,7 @@ def testsdk_main(d):
41 targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*")) 34 targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*"))
42 for sdkenv in targets: 35 for sdkenv in targets:
43 bb.plain("Testing %s" % sdkenv) 36 bb.plain("Testing %s" % sdkenv)
44 tc = SDKTestContext(d, testslist, testsrequired, sdktestdir, sdkenv) 37 tc = SDKTestContext(d, sdktestdir, sdkenv)
45 38
46 # this is a dummy load of tests 39 # this is a dummy load of tests
47 # 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
@@ -94,14 +87,6 @@ def testsdkext_main(d):
94 pn = d.getVar("PN", True) 87 pn = d.getVar("PN", True)
95 bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True)) 88 bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
96 89
97 # tests in TEST_SUITES become required tests
98 # they won't be skipped even if they aren't suitable.
99 # testslist is what we'll actually pass to the unittest loader
100 testslist = get_tests_list(get_test_suites(d, "sdkext"),
101 d.getVar("BBPATH", True).split(':'), "sdkext")
102 testsrequired = [t for t in (d.getVar("TEST_SUITES_SDKEXT", True) or \
103 "auto").split() if t != "auto"]
104
105 tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh") 90 tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh")
106 if not os.path.exists(tcname): 91 if not os.path.exists(tcname):
107 bb.fatal("The toolchain ext is not built. Build it before running the" \ 92 bb.fatal("The toolchain ext is not built. Build it before running the" \