Skip to content
Snippets Groups Projects

zephyr-kernel-test-twister: build all buildable kernel tests

Merged Chase Qi requested to merge chaseqi/meta-zephyr:kernel-tests into oniro/kirkstone
1 file
+ 24
2
Compare changes
  • Side-by-side
  • Inline
@@ -24,13 +24,34 @@ DEPENDS += "\
@@ -24,13 +24,34 @@ DEPENDS += "\
python3-ply-native \
python3-ply-native \
"
"
 
# Base directory for twister to recursively search for test cases.
 
# Build all available kernel tests by default.
 
ZEPHYRTESTS = "kernel"
 
# Specify tags of tests that does not build.
 
ZEPHYRTESTS_EXCLUDE_TAGS = ""
 
ZEPHYRTESTS_EXCLUDE_TAGS:96b-nitrogen = "fpu"
 
# Specify tests that should be deleted before image building using twister.
 
# This can be used when test tags not well defined to exclude specific tests.
 
# Relative path of 'tests/' at the base of zephyr tree should be used.
 
ZEPHYRTESTS_DELETE = ""
 
ZEPHYRTESTS_DELETE:96b-nitrogen = "\
 
kernel/profiling \
 
kernel/fatal \
 
"
 
do_compile() {
do_compile() {
if test -n "${ZEPHYRTESTS}"; then
if test -n "${ZEPHYRTESTS}"; then
tc_root_options="${@' '.join(['-T tests/kernel/' + i + ' ' for i in d.getVar('ZEPHYRTESTS').split()])}"
tc_root_options="${@' '.join(['-T tests/' + i + ' ' for i in d.getVar('ZEPHYRTESTS').split()])}"
bbnote "Test case root options: ${tc_root_options}"
bbnote "Test case root options: ${tc_root_options}"
bbnote "Generating twister-out ..."
bbnote "Excluded test tags: ${ZEPHYRTESTS_EXCLUDE_TAGS}"
 
exclude_tags="${@' '.join(['--exclude-tag ' + i + ' ' for i in d.getVar('ZEPHYRTESTS_EXCLUDE_TAGS').split()])}"
cd ${S}
cd ${S}
 
for test in ${ZEPHYRTESTS_DELETE}; do
 
rm -rf tests/${test}
 
bbnote "Deleted ${test} defined in ZEPHYRTESTS_DELETE ..."
 
done
rm -rf twister-out
rm -rf twister-out
 
bbnote "Generating twister-out ..."
# Twister runs both 'cmake' and 'cmake --build' itself to configure and
# Twister runs both 'cmake' and 'cmake --build' itself to configure and
# compile test images respectively. All the flags using in cmake.bbclass
# compile test images respectively. All the flags using in cmake.bbclass
# should be passed to twister so that tests are configured properly.
# should be passed to twister so that tests are configured properly.
@@ -70,6 +91,7 @@ do_compile() {
@@ -70,6 +91,7 @@ do_compile() {
-p ${@d.getVar('MACHINE').replace("-", "_")} \
-p ${@d.getVar('MACHINE').replace("-", "_")} \
--build-only \
--build-only \
${tc_root_options} \
${tc_root_options} \
 
${exclude_tags} \
-vvv
-vvv
else
else
bbnote "Do nothing as ZEPHYRTESTS is empty."
bbnote "Do nothing as ZEPHYRTESTS is empty."
Loading