summaryrefslogtreecommitdiff
path: root/meta/classes/testsdk.bbclass
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-01-28 15:42:47 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 15:51:03 +0000
commitd5061e07c4fd6ea37a0ceacedb83c7878f5bfd6d (patch)
tree69de4ebf028211f98530044100636b16809f2d35 /meta/classes/testsdk.bbclass
parent01a420dc9c0c04c793bbf5824db7c2b9d7c9de9b (diff)
downloadopenembedded-core-d5061e07c4fd6ea37a0ceacedb83c7878f5bfd6d.tar.gz
openembedded-core-d5061e07c4fd6ea37a0ceacedb83c7878f5bfd6d.tar.bz2
openembedded-core-d5061e07c4fd6ea37a0ceacedb83c7878f5bfd6d.zip
classes/testsdk: Add testsdkext task only install.
Add task for test extensible sdk for now only install the SDK. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/testsdk.bbclass')
-rw-r--r--meta/classes/testsdk.bbclass45
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() {
addtask testsdk
do_testsdk[nostamp] = "1"
do_testsdk[lockfiles] += "${TESTSDKLOCK}"
+
+TEST_LOG_SDKEXT_DIR ?= "${WORKDIR}/testsdkext"
+TESTSDKEXTLOCK = "${TMPDIR}/testsdkext.lock"
+
+def testsdkext_main(d):
+ import unittest
+ import os
+ import glob
+ import oeqa.sdkext
+ import time
+ import subprocess
+ from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list
+
+ pn = d.getVar("PN", True)
+ bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
+
+ # tests in TEST_SUITES become required tests
+ # they won't be skipped even if they aren't suitable.
+ # testslist is what we'll actually pass to the unittest loader
+ testslist = get_tests_list(get_test_suites(d, "sdkext"),
+ d.getVar("BBPATH", True).split(':'), "sdkext")
+ testsrequired = [t for t in (d.getVar("TEST_SUITES_SDKEXT", True) or \
+ "auto").split() if t != "auto"]
+
+ tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh")
+ if not os.path.exists(tcname):
+ bb.fatal("The toolchain ext is not built. Build it before running the" \
+ " tests: 'bitbake <image> -c populate_sdk_ext' .")
+
+ testdir = d.expand("${WORKDIR}/testsdkext/")
+ bb.utils.remove(testdir, True)
+ bb.utils.mkdirhier(testdir)
+ try:
+ subprocess.check_output("%s -y -d %s" % (tcname, testdir), shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output)
+
+testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
+
+python do_testsdkext() {
+ testsdkext_main(d)
+}
+addtask testsdkext
+do_testsdkext[nostamp] = "1"
+do_testsdkext[lockfiles] += "${TESTSDKEXTLOCK}"