From 3a6ea3a31c90179fb3cbd30c18e3a310e2ee647c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 19:01:56 +0200 Subject: Load all crates in the graph, honor the "publish" flag to prevent publishing examples/tests. --- tests/mspm0/Cargo.toml | 6 ++++++ tests/nrf/Cargo.toml | 11 +++++++++++ tests/perf-client/Cargo.toml | 1 + tests/perf-server/Cargo.toml | 1 + tests/riscv32/Cargo.toml | 6 ++++++ tests/rp/Cargo.toml | 7 +++++++ tests/stm32/Cargo.toml | 34 ++++++++++++++++++++++++++++++++++ tests/utils/Cargo.toml | 1 + tests/utils/src/bin/saturate_serial.rs | 7 ++++--- 9 files changed, 71 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/mspm0/Cargo.toml b/tests/mspm0/Cargo.toml index e4033b8b7..5cf1b0ed1 100644 --- a/tests/mspm0/Cargo.toml +++ b/tests/mspm0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-tests" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [features] mspm0g3507 = [ "embassy-mspm0/mspm0g3507pm" ] @@ -60,3 +61,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["mspm0g3507"], artifact-dir = "out/tests/mspm0g3507" } +] diff --git a/tests/nrf/Cargo.toml b/tests/nrf/Cargo.toml index ef7dc96ec..b94b54f4e 100644 --- a/tests/nrf/Cargo.toml +++ b/tests/nrf/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] teleprobe-meta = "1" @@ -112,3 +113,13 @@ path = "src/bin/wifi_esp_hosted_perf.rs" required-features = [ "nrf52840",] # END TESTS + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["nrf51422"], artifact-dir = "out/tests/nrf51422-dk" }, + { target = "thumbv7em-none-eabi", features = ["nrf52832"], artifact-dir = "out/tests/nrf52832-dk" }, + { target = "thumbv7em-none-eabi", features = ["nrf52833"], artifact-dir = "out/tests/nrf52833-dk" }, + { target = "thumbv7em-none-eabi", features = ["nrf52840"], artifact-dir = "out/tests/nrf52840-dk" }, + { target = "thumbv8m.main-none-eabihf", features = ["nrf5340"], artifact-dir = "out/tests/nrf5340-dk" }, + { target = "thumbv8m.main-none-eabihf", features = ["nrf9160"], artifact-dir = "out/tests/nrf9160-dk" } +] diff --git a/tests/perf-client/Cargo.toml b/tests/perf-client/Cargo.toml index e31d6361b..ea0663b6f 100644 --- a/tests/perf-client/Cargo.toml +++ b/tests/perf-client/Cargo.toml @@ -2,6 +2,7 @@ name = "perf-client" version = "0.1.0" edition = "2021" +publish = false [dependencies] embassy-net = { version = "0.7.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4"] } diff --git a/tests/perf-server/Cargo.toml b/tests/perf-server/Cargo.toml index 532039050..22614a33a 100644 --- a/tests/perf-server/Cargo.toml +++ b/tests/perf-server/Cargo.toml @@ -2,6 +2,7 @@ name = "perf-server" version = "0.1.0" edition = "2021" +publish = false [dependencies] log = "0.4.17" diff --git a/tests/riscv32/Cargo.toml b/tests/riscv32/Cargo.toml index 283ea5033..781fec62f 100644 --- a/tests/riscv32/Cargo.toml +++ b/tests/riscv32/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-riscv-tests" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] critical-section = { version = "1.1.1", features = ["restore-state-bool"] } @@ -44,3 +45,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "riscv32imac-unknown-none-elf" } +] diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml index eef6c47ae..088195a75 100644 --- a/tests/rp/Cargo.toml +++ b/tests/rp/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-rp-tests" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [features] rp2040 = ["embassy-rp/rp2040"] @@ -92,3 +93,9 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["rp2040"], artifact-dir = "out/tests/rpi-pico" }, + { target = "thumbv8m.main-none-eabihf", features = ["rp235xb"], artifact-dir = "out/tests/pimoroni-pico-plus-2" } +] diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index c011a6d7d..37d5161f8 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml @@ -4,6 +4,7 @@ name = "embassy-stm32-tests" version = "0.1.0" license = "MIT OR Apache-2.0" autobins = false +publish = false [features] stm32c031c6 = ["embassy-stm32/stm32c031c6", "cm0", "not-gpdma"] @@ -243,3 +244,36 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7m-none-eabi", features = ["stm32f103c8"], artifact-dir = "out/tests/stm32f103c8" }, + { target = "thumbv7em-none-eabi", features = ["stm32f429zi"], artifact-dir = "out/tests/stm32f429zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32f446re"], artifact-dir = "out/tests/stm32f446re" }, + { target = "thumbv7em-none-eabi", features = ["stm32g491re"], artifact-dir = "out/tests/stm32g491re" }, + { target = "thumbv6m-none-eabi", features = ["stm32g071rb"], artifact-dir = "out/tests/stm32g071rb" }, + { target = "thumbv6m-none-eabi", features = ["stm32c031c6"], artifact-dir = "out/tests/stm32c031c6" }, + { target = "thumbv6m-none-eabi", features = ["stm32c071rb"], artifact-dir = "out/tests/stm32c071rb" }, + { target = "thumbv7em-none-eabi", features = ["stm32h755zi"], artifact-dir = "out/tests/stm32h755zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32h753zi"], artifact-dir = "out/tests/stm32h753zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32h7a3zi"], artifact-dir = "out/tests/stm32h7a3zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32wb55rg"], artifact-dir = "out/tests/stm32wb55rg" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32h563zi"], artifact-dir = "out/tests/stm32h563zi" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32u585ai"], artifact-dir = "out/tests/stm32u585ai" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32u5a5zj"], artifact-dir = "out/tests/stm32u5a5zj" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32wba52cg"], artifact-dir = "out/tests/stm32wba52cg" }, + { target = "thumbv6m-none-eabi", features = ["stm32l073rz"], artifact-dir = "out/tests/stm32l073rz" }, + { target = "thumbv7m-none-eabi", features = ["stm32l152re"], artifact-dir = "out/tests/stm32l152re" }, + { target = "thumbv7em-none-eabi", features = ["stm32l4a6zg"], artifact-dir = "out/tests/stm32l4a6zg" }, + { target = "thumbv7em-none-eabi", features = ["stm32l4r5zi"], artifact-dir = "out/tests/stm32l4r5zi" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32l552ze"], artifact-dir = "out/tests/stm32l552ze" }, + { target = "thumbv7em-none-eabi", features = ["stm32f767zi"], artifact-dir = "out/tests/stm32f767zi" }, + { target = "thumbv7m-none-eabi", features = ["stm32f207zg"], artifact-dir = "out/tests/stm32f207zg" }, + { target = "thumbv7em-none-eabi", features = ["stm32f303ze"], artifact-dir = "out/tests/stm32f303ze" }, + { target = "thumbv7em-none-eabi", features = ["stm32l496zg"], artifact-dir = "out/tests/stm32l496zg" }, + { target = "thumbv7em-none-eabi", features = ["stm32wl55jc"], artifact-dir = "out/tests/stm32wl55jc" }, + { target = "thumbv7em-none-eabi", features = ["stm32h7s3l8"], artifact-dir = "out/tests/stm32h7s3l8" }, + { target = "thumbv6m-none-eabi", features = ["stm32f091rc"], artifact-dir = "out/tests/stm32f091rc" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32h503rb"], artifact-dir = "out/tests/stm32h503rb" }, + { target = "thumbv6m-none-eabi", features = ["stm32u083rc"], artifact-dir = "out/tests/stm32u083rc" } +] diff --git a/tests/utils/Cargo.toml b/tests/utils/Cargo.toml index bda55ad32..f76feaa20 100644 --- a/tests/utils/Cargo.toml +++ b/tests/utils/Cargo.toml @@ -2,6 +2,7 @@ name = "test-utils" version = "0.1.0" edition = "2021" +publish = false [dependencies] rand = "0.9" diff --git a/tests/utils/src/bin/saturate_serial.rs b/tests/utils/src/bin/saturate_serial.rs index 18ca12fb7..85676b106 100644 --- a/tests/utils/src/bin/saturate_serial.rs +++ b/tests/utils/src/bin/saturate_serial.rs @@ -2,7 +2,7 @@ use std::path::Path; use std::time::Duration; use std::{env, io, process, thread}; -use rand::random; +use rand::{rng, Rng}; use serial::SerialPort; pub fn main() { @@ -34,14 +34,15 @@ fn saturate(port: &mut T, idles: bool) -> io::Result<()> { })?; let mut written = 0; + let mut rng = rng(); loop { - let len = random::() % 0x1000; + let len = rng.random_range(1..=0x1000); let buf: Vec = (written..written + len).map(|x| x as u8).collect(); port.write_all(&buf)?; if idles { - let micros = (random::() % 1000) as u64; + let micros = rng.random_range(1..=1000) as u64; println!("Sleeping {}us", micros); port.flush().unwrap(); thread::sleep(Duration::from_micros(micros)); -- cgit