[yocto] [meta-zephyr][morty][PATCH 5/7] zephyrtest.bbclass: refactor
Juro Bystricky
juro.bystricky at intel.com
Sat Feb 4 10:36:48 PST 2017
Only keep code/variables related to individual test/package names.
Moved ZEPHYR_TEST_SRCDIR into zephyr-kernel.inc as it is
zephyr kernel version specific.
Moved ZEPHYR_MAKE_OUTPUT into zephyr-kernel-common.inc as it is
as it is not zephyr test specific but applicable to all
zephyr images.
Additional minor cleanup.
Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
---
classes/zephyrtest.bbclass | 10 ++++------
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 1 +
recipes-kernel/zephyr-kernel/zephyr-kernel.inc | 3 +++
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/classes/zephyrtest.bbclass b/classes/zephyrtest.bbclass
index e396bf7..aa9ee3c 100644
--- a/classes/zephyrtest.bbclass
+++ b/classes/zephyrtest.bbclass
@@ -1,6 +1,5 @@
python zephyrtest_virtclass_handler () {
- cls = e.data.getVar("BBEXTENDCURR", True)
variant = e.data.getVar("BBEXTENDVARIANT", True)
# ipk doesn't like underscores in pacakges names. So just use dashes
@@ -11,13 +10,12 @@ python zephyrtest_virtclass_handler () {
pn_underscores = e.data.getVar("PN", True) + "-" + variant
e.data.setVar("PN", pn)
- e.data.setVar("ZEPHYR_IMAGENAME", variant_dashes + ".elf")
+ e.data.setVar("ZEPHYR_IMAGENAME", pn + ".elf")
- # Most tests for Zephyr 1.6 are in the "legacy" folder
- e.data.setVar("ZEPHYR_IMAGE_SRCDIR", "tests/legacy/kernel/" + variant)
- e.data.setVar("ZEPHYR_MAKE_OUTPUT", "zephyr.elf")
+ testsrc = e.data.getVar("ZEPHYR_TEST_SRCDIR", True)
+ e.data.setVar("ZEPHYR_IMAGE_SRCDIR", testsrc + variant)
- # Allow to build using both foo-some_test form as well ass foo-some-test
+ # Allow to build using both foo-some_test form as well as foo-some-test
e.data.setVar("PROVIDES", e.data.getVar("PROVIDES", True) + pn_underscores)
}
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
index 078ea72..f5106c1 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
@@ -10,6 +10,7 @@ IMAGE_NO_MANIFEST = "1"
ZEPHYR_GCC_VARIANT="yocto"
ZEPHYR_SYSROOT="${STAGING_DIR_TARGET}"
+ZEPHYR_MAKE_OUTPUT = "zephyr.elf"
ZEPHYR_MAKE_ARGS = " V=1 BOARD=${BOARD} CROSS_COMPILE=${CROSS_COMPILE} ZEPHYR_GCC_VARIANT=${ZEPHYR_GCC_VARIANT} ZEPHYR_BASE=${ZEPHYR_BASE} ZEPHYR_SYSROOT=${ZEPHYR_SYSROOT}"
# We always need a toolchain to cross-compile.
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel.inc
index 71c7a29..59b0713 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel.inc
@@ -8,6 +8,9 @@ SRC_URI += "file://Makefile.toolchain.yocto"
PV = "1.6.0"
+# Most tests for Zephyr 1.6 are in the "legacy" folder
+ZEPHYR_TEST_SRCDIR = "tests/legacy/kernel/"
+
S = "${WORKDIR}/git"
do_compile_prepend() {
--
2.7.4
More information about the yocto
mailing list