Skip to content

Commit aee2d1a

Browse files
lyakhnashif
authored andcommitted
llext: provide an example of tristate Kconfig option
Add a tristate Kconfig option to the llext hello-world twister test. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent b53a792 commit aee2d1a

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

tests/subsys/llext/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2024 Intel Corporation.
3+
4+
mainmenu "LLEXT functionality test"
5+
6+
source "Kconfig.zephyr"
7+
8+
config LLEXT_TEST_HELLO
9+
tristate "llext hello test"
10+
default n
11+
help
12+
Set to "m" to test hello-world loading

tests/subsys/llext/hello_world/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.20.0)
55
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
66
project(hello_world)
77

8+
if(NOT CONFIG_MODULES OR CONFIG_LLEXT_TEST_HELLO STREQUAL "m")
9+
810
# TODO check which architecture is being used
911
if(CONFIG_ARM)
1012
set(CMAKE_C_FLAGS "-mlong-calls" "-mthumb")
@@ -34,3 +36,5 @@ endif()
3436
set(HELLO_WORLD_LLEXT ${PROJECT_BINARY_DIR}/hello_world.llext PARENT_SCOPE)
3537

3638
add_custom_target(hello_world DEPENDS ${PROJECT_BINARY_DIR}/hello_world.llext)
39+
40+
endif()

tests/subsys/llext/testcase.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ tests:
66
arch_allow: arm
77
extra_configs:
88
- CONFIG_ARM_MPU=n
9+
- CONFIG_MODULES=y
10+
- CONFIG_LLEXT_TEST_HELLO=m
911
# Broken platforms
1012
platform_exclude:
1113
- nuvoton_pfm_m487 # See #63167
1214
llext.simple.xtensa:
1315
arch_allow: xtensa
1416
extra_configs:
1517
- CONFIG_LLEXT_STORAGE_WRITABLE=y
18+
- CONFIG_MODULES=y
19+
- CONFIG_LLEXT_TEST_HELLO=m
1620
# Broken platforms
1721
platform_exclude:
1822
- qemu_xtensa_mmu # ELF sections are read-only, and without peek() .text copy isn't executable

0 commit comments

Comments
 (0)