From 2d97bdd85d3c1b7c3c029822ec62cc37bec5261f Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 18 Apr 2022 22:31:18 -0400 Subject: [PATCH] samples: add module requirement into samples Do not build those samples if the needed modules are not available in the workspace. Signed-off-by: Anas Nashif --- samples/modules/canopennode/sample.yaml | 2 ++ samples/modules/chre/sample.yaml | 2 ++ samples/modules/nanopb/sample.yaml | 2 ++ samples/modules/tflite-micro/hello_world/sample.yaml | 2 ++ samples/modules/tflite-micro/magic_wand/sample.yaml | 2 ++ samples/net/civetweb/http_server/sample.yaml | 2 ++ samples/net/civetweb/websocket_server/sample.yaml | 2 ++ samples/subsys/audio/sof/sample.yaml | 4 +++- samples/subsys/fs/fat_fs/sample.yaml | 2 ++ samples/subsys/logging/syst/sample.yaml | 10 ++++------ samples/subsys/usb/mass/sample.yaml | 6 ++++++ tests/posix/fs/testcase.yaml | 2 ++ tests/subsys/fs/fat_fs_api/testcase.yaml | 6 ++++-- tests/subsys/fs/littlefs/testcase.yaml | 7 ++++--- tests/subsys/fs/multi-fs/testcase.yaml | 7 +++++-- tests/subsys/logging/log_backend_fs/testcase.yaml | 8 ++++---- 16 files changed, 48 insertions(+), 18 deletions(-) diff --git a/samples/modules/canopennode/sample.yaml b/samples/modules/canopennode/sample.yaml index 909d638f310..76c4c862483 100644 --- a/samples/modules/canopennode/sample.yaml +++ b/samples/modules/canopennode/sample.yaml @@ -2,6 +2,8 @@ sample: name: CANopenNode sample common: tags: can canopen + modules: + - canopennode depends_on: can filter: dt_chosen_enabled("zephyr,canbus") harness: console diff --git a/samples/modules/chre/sample.yaml b/samples/modules/chre/sample.yaml index 932630ab334..56b5d4547cc 100644 --- a/samples/modules/chre/sample.yaml +++ b/samples/modules/chre/sample.yaml @@ -5,6 +5,8 @@ sample: tests: sample.modules.chre: tags: introduction + modules: + - chre harness: console harness_config: type: multi_line diff --git a/samples/modules/nanopb/sample.yaml b/samples/modules/nanopb/sample.yaml index 553cdafb178..1fe76402b5c 100644 --- a/samples/modules/nanopb/sample.yaml +++ b/samples/modules/nanopb/sample.yaml @@ -3,6 +3,8 @@ sample: buffer name: Simple nanopb common: + modules: + - nanopb harness: console harness_config: type: one_line diff --git a/samples/modules/tflite-micro/hello_world/sample.yaml b/samples/modules/tflite-micro/hello_world/sample.yaml index 20e037e8ccf..28cdce82751 100644 --- a/samples/modules/tflite-micro/hello_world/sample.yaml +++ b/samples/modules/tflite-micro/hello_world/sample.yaml @@ -3,6 +3,8 @@ sample: name: hello world tensorflow common: tags: tensorflow + modules: + - tflite-micro harness: console harness_config: type: multi_line diff --git a/samples/modules/tflite-micro/magic_wand/sample.yaml b/samples/modules/tflite-micro/magic_wand/sample.yaml index a8373a2920c..d65a61ee2f7 100644 --- a/samples/modules/tflite-micro/magic_wand/sample.yaml +++ b/samples/modules/tflite-micro/magic_wand/sample.yaml @@ -6,3 +6,5 @@ tests: platform_allow: litex_vexriscv build_only: true tags: tensorflow + modules: + - tflite-micro diff --git a/samples/net/civetweb/http_server/sample.yaml b/samples/net/civetweb/http_server/sample.yaml index c3d7b6e633f..79ba0eaf8e6 100644 --- a/samples/net/civetweb/http_server/sample.yaml +++ b/samples/net/civetweb/http_server/sample.yaml @@ -3,6 +3,8 @@ sample: name: http_server tests: sample.net.civetweb.http_server: + modules: + - civetweb harness: net arch_exclude: posix depends_on: netif diff --git a/samples/net/civetweb/websocket_server/sample.yaml b/samples/net/civetweb/websocket_server/sample.yaml index 4aecc5998f8..18af3024b91 100644 --- a/samples/net/civetweb/websocket_server/sample.yaml +++ b/samples/net/civetweb/websocket_server/sample.yaml @@ -3,4 +3,6 @@ sample: name: websocket_server tests: sample.net.civetweb.websocket_server: + modules: + - civetweb platform_allow: nucleo_h745zi_q_m7 diff --git a/samples/subsys/audio/sof/sample.yaml b/samples/subsys/audio/sof/sample.yaml index 5cdae4f8c3f..8bacb67f779 100644 --- a/samples/subsys/audio/sof/sample.yaml +++ b/samples/subsys/audio/sof/sample.yaml @@ -2,7 +2,9 @@ sample: description: Audio with SOF name: sof common: - tags: audio + tags: audio + modules: + - sof tests: sample.audio.sof: tags: sof diff --git a/samples/subsys/fs/fat_fs/sample.yaml b/samples/subsys/fs/fat_fs/sample.yaml index eb13de57347..88b70b5db17 100644 --- a/samples/subsys/fs/fat_fs/sample.yaml +++ b/samples/subsys/fs/fat_fs/sample.yaml @@ -2,6 +2,8 @@ sample: name: Fat filesystem sample common: tags: filesystem + modules: + - fatfs tests: sample.filesystem.fat_fs: depends_on: sdhc diff --git a/samples/subsys/logging/syst/sample.yaml b/samples/subsys/logging/syst/sample.yaml index c6c69304cd7..b5ab126db49 100644 --- a/samples/subsys/logging/syst/sample.yaml +++ b/samples/subsys/logging/syst/sample.yaml @@ -1,10 +1,13 @@ sample: name: syst sample +common: + tags: logging mipi-sys-t + modules: + - mipi-sys-t tests: sample.logger.syst.v1.deferred: extra_args: OVERLAY_CONFIG=overlay_deferred.conf platform_allow: mps2_an385 qemu_x86 qemu_x86_64 sam_e70_xplained qemu_cortex_a53 - tags: logging harness: console harness_config: type: one_line @@ -14,7 +17,6 @@ tests: - CONFIG_LOG1=y sample.logger.syst.v1.immediate: platform_allow: mps2_an385 qemu_x86 qemu_x86_64 sam_e70_xplained qemu_cortex_a53 - tags: logging harness: console harness_config: type: one_line @@ -25,7 +27,6 @@ tests: sample.logger.syst.v2.deferred: extra_args: OVERLAY_CONFIG=overlay_deferred.conf platform_allow: mps2_an385 qemu_x86 qemu_x86_64 sam_e70_xplained qemu_cortex_a53 - tags: logging harness: console harness_config: type: one_line @@ -33,7 +34,6 @@ tests: - "SYS-T RAW DATA: " sample.logger.syst.v2.immediate: platform_allow: mps2_an385 qemu_x86 qemu_x86_64 sam_e70_xplained qemu_cortex_a53 - tags: logging harness: console harness_config: type: one_line @@ -42,7 +42,6 @@ tests: sample.logger.syst.catalog.v2.deferred: extra_args: OVERLAY_CONFIG=overlay_deferred.conf platform_allow: mps2_an385 qemu_x86 - tags: logging harness: console harness_config: type: one_line @@ -52,7 +51,6 @@ tests: - CONFIG_LOG_MIPI_SYST_USE_CATALOG=y sample.logger.syst.catalog.v2.immediate: platform_allow: mps2_an385 qemu_x86 - tags: logging harness: console harness_config: type: one_line diff --git a/samples/subsys/usb/mass/sample.yaml b/samples/subsys/usb/mass/sample.yaml index 3dd34971225..5078fdc0dba 100644 --- a/samples/subsys/usb/mass/sample.yaml +++ b/samples/subsys/usb/mass/sample.yaml @@ -28,6 +28,8 @@ tests: - "The device is put in USB mass storage mode." sample.usb.mass_flash_fatfs: min_ram: 32 + modules: + - fatfs depends_on: usb_device filter: dt_compat_enabled("nordic,qspi-nor") extra_configs: @@ -41,6 +43,8 @@ tests: - "The device is put in USB mass storage mode." sample.usb.mass_sdhc_fatfs: min_ram: 32 + modules: + - fatfs depends_on: usb_device sdhc extra_configs: - CONFIG_LOG_DEFAULT_LEVEL=3 @@ -53,6 +57,8 @@ tests: regex: - "The device is put in USB mass storage mode." sample.usb.mass_flash_littlefs: + modules: + - littlefs min_ram: 32 depends_on: usb_device filter: dt_compat_enabled("nordic,qspi-nor") diff --git a/tests/posix/fs/testcase.yaml b/tests/posix/fs/testcase.yaml index 3e40ba26f54..5ac307cdbb3 100644 --- a/tests/posix/fs/testcase.yaml +++ b/tests/posix/fs/testcase.yaml @@ -2,6 +2,8 @@ common: arch_exclude: nios2 posix min_ram: 128 tags: posix filesystem + modules: + - fatfs tests: portability.posix.fs: extra_configs: diff --git a/tests/subsys/fs/fat_fs_api/testcase.yaml b/tests/subsys/fs/fat_fs_api/testcase.yaml index 1bd54e9c3b9..9a0d3958a28 100644 --- a/tests/subsys/fs/fat_fs_api/testcase.yaml +++ b/tests/subsys/fs/fat_fs_api/testcase.yaml @@ -1,8 +1,10 @@ +common: + tags: filesystem + modules: + - fatfs tests: filesystem.fat.api: platform_allow: native_posix - tags: filesystem filesystem.fat.api.lfn: extra_args: CONF_FILE="prj_lfn.conf" platform_allow: native_posix - tags: filesystem diff --git a/tests/subsys/fs/littlefs/testcase.yaml b/tests/subsys/fs/littlefs/testcase.yaml index 58c54ea40cb..d1d6b8e2bfd 100644 --- a/tests/subsys/fs/littlefs/testcase.yaml +++ b/tests/subsys/fs/littlefs/testcase.yaml @@ -1,7 +1,8 @@ common: - tags: filesystem - platform_allow: nrf52840dk_nrf52840 native_posix native_posix_64 mimxrt1060_evk - + tags: filesystem + platform_allow: nrf52840dk_nrf52840 native_posix native_posix_64 mimxrt1060_evk + modules: + - littlefs tests: filesystem.littlefs.default: timeout: 60 diff --git a/tests/subsys/fs/multi-fs/testcase.yaml b/tests/subsys/fs/multi-fs/testcase.yaml index 01b7bfb1b0b..445966b2639 100644 --- a/tests/subsys/fs/multi-fs/testcase.yaml +++ b/tests/subsys/fs/multi-fs/testcase.yaml @@ -1,8 +1,11 @@ +common: + tags: littlefs fatfs filesystem + modules: + - fatfs + - littlefs tests: filesystem.multifs: platform_allow: native_posix qemu_x86 - tags: littlefs fatfs filesystem qemu_x86 filesystem.fs_shell: extra_args: CONF_FILE="prj_fs_shell.conf" platform_allow: native_posix qemu_x86 - tags: littlefs fatfs filesystem diff --git a/tests/subsys/logging/log_backend_fs/testcase.yaml b/tests/subsys/logging/log_backend_fs/testcase.yaml index 2a56572b4bb..bdfa13097e2 100644 --- a/tests/subsys/logging/log_backend_fs/testcase.yaml +++ b/tests/subsys/logging/log_backend_fs/testcase.yaml @@ -1,16 +1,16 @@ +common: + modules: + - littlefs + tags: logging backend filesystem fs tests: logging.log_backend_fs.automounted: platform_allow: native_posix native_posix_64 nrf52840dk_nrf52840 - tags: logging backend filesystem fs logging.log_backend_fs.manualmounted.native_posix: platform_allow: native_posix - tags: logging backend filesystem fs extra_args: DTC_OVERLAY_FILE="./boards/native_posix.overlay;./boards/automount.overlay" logging.log_backend_fs.manualmounted.native_posix_64: platform_allow: native_posix_64 - tags: logging backend filesystem fs extra_args: DTC_OVERLAY_FILE="./boards/native_posix_64.overlay;./boards/automount.overlay" logging.log_backend_fs.manualmounted.nrf5840dk: platform_allow: nrf52840dk_nrf52840 - tags: logging backend filesystem fs extra_args: DTC_OVERLAY_FILE="./boards/nrf52840dk_nrf52840.overlay;./boards/automount.overlay"