diff options
Diffstat (limited to 'meta/classes/testsdk.bbclass')
-rw-r--r-- | meta/classes/testsdk.bbclass | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass index 42c49134c8..8fe6d0f404 100644 --- a/meta/classes/testsdk.bbclass +++ b/meta/classes/testsdk.bbclass | |||
@@ -98,3 +98,48 @@ python do_testsdk() { | |||
98 | addtask testsdk | 98 | addtask testsdk |
99 | do_testsdk[nostamp] = "1" | 99 | do_testsdk[nostamp] = "1" |
100 | do_testsdk[lockfiles] += "${TESTSDKLOCK}" | 100 | do_testsdk[lockfiles] += "${TESTSDKLOCK}" |
101 | |||
102 | TEST_LOG_SDKEXT_DIR ?= "${WORKDIR}/testsdkext" | ||
103 | TESTSDKEXTLOCK = "${TMPDIR}/testsdkext.lock" | ||
104 | |||
105 | def testsdkext_main(d): | ||
106 | import unittest | ||
107 | import os | ||
108 | import glob | ||
109 | import oeqa.sdkext | ||
110 | import time | ||
111 | import subprocess | ||
112 | from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list | ||
113 | |||
114 | pn = d.getVar("PN", True) | ||
115 | bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True)) | ||
116 | |||
117 | # tests in TEST_SUITES become required tests | ||
118 | # they won't be skipped even if they aren't suitable. | ||
119 | # testslist is what we'll actually pass to the unittest loader | ||
120 | testslist = get_tests_list(get_test_suites(d, "sdkext"), | ||
121 | d.getVar("BBPATH", True).split(':'), "sdkext") | ||
122 | testsrequired = [t for t in (d.getVar("TEST_SUITES_SDKEXT", True) or \ | ||
123 | "auto").split() if t != "auto"] | ||
124 | |||
125 | tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh") | ||
126 | if not os.path.exists(tcname): | ||
127 | bb.fatal("The toolchain ext is not built. Build it before running the" \ | ||
128 | " tests: 'bitbake <image> -c populate_sdk_ext' .") | ||
129 | |||
130 | testdir = d.expand("${WORKDIR}/testsdkext/") | ||
131 | bb.utils.remove(testdir, True) | ||
132 | bb.utils.mkdirhier(testdir) | ||
133 | try: | ||
134 | subprocess.check_output("%s -y -d %s" % (tcname, testdir), shell=True) | ||
135 | except subprocess.CalledProcessError as e: | ||
136 | bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output) | ||
137 | |||
138 | testsdkext_main[vardepsexclude] =+ "BB_ORIGENV" | ||
139 | |||
140 | python do_testsdkext() { | ||
141 | testsdkext_main(d) | ||
142 | } | ||
143 | addtask testsdkext | ||
144 | do_testsdkext[nostamp] = "1" | ||
145 | do_testsdkext[lockfiles] += "${TESTSDKEXTLOCK}" | ||