-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Twister: Sharing built applications across multiple tests #75291
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
07a1e8e
twister: scripts: implement sharing build mechanism
gchwier ca1b6bc
twister: unittests: align tests with changes for shared apps
gchwier 9ddfa62
samples: added sample to demonstrate new Twister feature.
gchwier dab9a22
doc: twister: Added required_images key description.
gchwier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| cmake_minimum_required(VERSION 3.20.0) | ||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(shared_app_with_own_image) | ||
|
|
||
| FILE(GLOB app_sources src/*.c) | ||
| target_sources(app PRIVATE ${app_sources}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| CONFIG_PRINTK=y | ||
| CONFIG_SHELL=y | ||
| CONFIG_LOG=y | ||
| CONFIG_SHELL_BACKEND_SERIAL=y | ||
| CONFIG_KERNEL_SHELL=y |
23 changes: 23 additions & 0 deletions
23
samples/subsys/testsuite/shared_app/pytest/test_shared_app.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright (c) 2024 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| from __future__ import annotations | ||
|
|
||
| import logging | ||
| from pathlib import Path | ||
|
|
||
| from twister_harness import DeviceAdapter, Shell | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def test_shell_is_ready(shell: Shell): | ||
| # wait_for_prompt is called from shell fixture, so if passed, shell is ready to use | ||
| assert True | ||
|
|
||
|
|
||
| def test_second_app_is_found(dut: DeviceAdapter, shell: Shell, required_images): | ||
| logger.info(f"Required images: {required_images}") | ||
| assert required_images | ||
| assert Path(required_images[0]).is_dir() | ||
| assert Path(Path(required_images[0]) / 'build.log').exists() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * Copyright (c) 2024 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| int main(void) | ||
| { | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| common: | ||
| filter: CONFIG_SERIAL and dt_chosen_enabled("zephyr,shell-uart") | ||
| min_ram: 40 | ||
| extra_configs: | ||
| - arch:posix:CONFIG_NATIVE_UART_0_ON_STDINOUT=y | ||
| integration_platforms: | ||
| - native_sim | ||
| tests: | ||
| sample.shared.build_only: | ||
| build_only: true | ||
| sample.shared.with_own_image.pytest: | ||
| required_images: | ||
| - sample.shared.build_only | ||
| harness: pytest | ||
| harness_config: | ||
| pytest_dut_scope: module | ||
| tags: pytest shared | ||
| sample.shared.no_own_image.pytest: | ||
| no_own_image: true | ||
| required_images: | ||
| - sample.shared.with_own_image.pytest | ||
| - sample.shared.build_only | ||
| harness: pytest | ||
| harness_config: | ||
| pytest_dut_scope: module | ||
| tags: pytest shared | ||
| sample.shared.no_own_image.helloworld: | ||
| no_own_image: true | ||
| required_images: | ||
| - sample.basic.helloworld | ||
| harness: console | ||
| harness_config: | ||
| type: one_line | ||
| regex: | ||
| - "Hello World! (.*)" | ||
| tags: shared |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.