Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llext: actual test rework #67906

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions samples/subsys/llext/shell_loader/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
common:
tags: llext
arch_allow:
- arm
- xtensa
filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE_R52
platform_exclude:
- nuvoton_pfm_m487 # See #63167
sample:
description: Loadable extensions with shell sample
name: Extension loader shell
tests:
sample.llext.shell:
tags: shell llext
harness: keyboard
filter: not CONFIG_CPU_HAS_MMU and not CONFIG_SOC_SERIES_S32ZE_R52
arch_allow: arm
extra_configs:
- CONFIG_ARM_MPU=n
# Broken platforms
platform_exclude:
- nuvoton_pfm_m487 # See #63167
- arch:arm:CONFIG_ARM_MPU=n
26 changes: 0 additions & 26 deletions tests/subsys/llext/CMakeLists.txt

This file was deleted.

28 changes: 18 additions & 10 deletions tests/subsys/llext/hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)
project(llext_hello_world_test)

if(NOT CONFIG_MODULES OR CONFIG_LLEXT_TEST_HELLO STREQUAL "m")
target_sources(app PRIVATE
src/test/test_llext_simple.c
)

set(llext_src_file ${PROJECT_SOURCE_DIR}/hello_world.c)
set(llext_bin_file ${PROJECT_BINARY_DIR}/hello_world.llext)
target_include_directories(app PRIVATE
${ZEPHYR_BASE}/include
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/${ARCH}/include
)

add_llext_target(hello_world
OUTPUT ${llext_bin_file}
SOURCES ${llext_src_file}
)
# Compile a simple hello world llext to an include file
set(llext_src_file ${PROJECT_SOURCE_DIR}/src/llext/hello_world.c)
set(llext_bin_file ${ZEPHYR_BINARY_DIR}/hello_world.llext)
set(llext_inc_file ${ZEPHYR_BINARY_DIR}/include/generated/hello_world.inc)

set(HELLO_WORLD_LLEXT ${llext_bin_file} PARENT_SCOPE)
add_llext_target(hello_world
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is quite nice not having to write a custom cmake file now for this

OUTPUT ${llext_bin_file}
SOURCES ${llext_src_file}
)

endif()
generate_inc_file_for_target(app ${llext_bin_file} ${llext_inc_file})
Original file line number Diff line number Diff line change
Expand Up @@ -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.
File renamed without changes.
27 changes: 27 additions & 0 deletions tests/subsys/llext/hello_world/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
common:
tags: llext
arch_allow:
- arm
- xtensa
filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE_R52
platform_exclude:
- nuvoton_pfm_m487 # See #63167
tests:
llext.simple.readonly:
arch_exclude: xtensa # for now
extra_configs:
- arch:arm:CONFIG_ARM_MPU=n
- CONFIG_LLEXT_STORAGE_WRITABLE=n
llext.simple.writable:
extra_configs:
- arch:arm:CONFIG_ARM_MPU=n
- CONFIG_LLEXT_STORAGE_WRITABLE=y
llext.simple.modules_enabled:
platform_key:
- simulation
platform_exclude:
- qemu_cortex_a9 # MMU
extra_configs:
- arch:arm:CONFIG_ARM_MPU=n
- CONFIG_MODULES=y
- CONFIG_LLEXT_TEST_HELLO=m
22 changes: 0 additions & 22 deletions tests/subsys/llext/testcase.yaml

This file was deleted.

Loading