llext: fix test Kconfig module conditions

Make it so LLEXT_TEST_HELLO is enabled by default, and it is actually
compiled only when the config is enabled.

The check for MODULES==y and LLEXT_TEST_HELLO!=m is redundant, as the
Twister machinery already causes an error when Kconfig flags specified
in the YAML file are coerced to different values.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit is contained in:
Luca Burelli 2024-01-12 10:55:56 +01:00 committed by Carles Cufí
parent 297faf71d0
commit 5697d25901
2 changed files with 5 additions and 3 deletions

View file

@ -7,6 +7,6 @@ source "Kconfig.zephyr"
config LLEXT_TEST_HELLO
tristate "llext hello test"
default n
default y
help
Set to "m" to test hello-world loading
This enables building the hello_world test case.

View file

@ -5,7 +5,9 @@ cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)
if(NOT CONFIG_MODULES OR CONFIG_LLEXT_TEST_HELLO STREQUAL "m")
if(NOT CONFIG_LLEXT_TEST_HELLO)
# test disabled, nothing to do
else()
set(llext_src_file ${PROJECT_SOURCE_DIR}/hello_world.c)
set(llext_bin_file ${PROJECT_BINARY_DIR}/hello_world.llext)