From a73f9474a0dc4af1ebfb22d7960e6c4b3aca81bd Mon Sep 17 00:00:00 2001 From: sander Date: Thu, 20 Apr 2023 10:56:59 +0200 Subject: [PATCH] embassy-boot: ensure tests can run on the stable compiler --- .github/workflows/rust.yml | 2 +- embassy-boot/boot/src/firmware_updater.rs | 1 + embassy-boot/boot/src/lib.rs | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b8af7fcc9..79354fe70 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -71,7 +71,7 @@ jobs: - name: Test boot working-directory: ./embassy-boot/boot - run: cargo test --features nightly && cargo test --features "ed25519-dalek,nightly" && cargo test --features "ed25519-salty,nightly" + run: cargo test && cargo test --features nightly && cargo test --features "ed25519-dalek,nightly" && cargo test --features "ed25519-salty,nightly" - name: Test sync working-directory: ./embassy-sync diff --git a/embassy-boot/boot/src/firmware_updater.rs b/embassy-boot/boot/src/firmware_updater.rs index 1f2a6d24e..92987825f 100644 --- a/embassy-boot/boot/src/firmware_updater.rs +++ b/embassy-boot/boot/src/firmware_updater.rs @@ -520,6 +520,7 @@ mod tests { use crate::mem_flash::MemFlash; #[test] + #[cfg(feature = "nightly")] fn can_verify_sha1() { const STATE: Partition = Partition::new(0, 4096); const DFU: Partition = Partition::new(65536, 131072); diff --git a/embassy-boot/boot/src/lib.rs b/embassy-boot/boot/src/lib.rs index e268d8883..8eb3ba96d 100644 --- a/embassy-boot/boot/src/lib.rs +++ b/embassy-boot/boot/src/lib.rs @@ -83,7 +83,7 @@ mod tests { } #[test] - #[cfg(not(feature = "_verify"))] + #[cfg(all(feature = "nightly", not(feature = "_verify")))] fn test_swap_state() { const STATE: Partition = Partition::new(0, 4096); const ACTIVE: Partition = Partition::new(4096, 61440); @@ -136,7 +136,7 @@ mod tests { } #[test] - #[cfg(not(feature = "_verify"))] + #[cfg(all(feature = "nightly", not(feature = "_verify")))] fn test_separate_flash_active_page_biggest() { const STATE: Partition = Partition::new(2048, 4096); const ACTIVE: Partition = Partition::new(4096, 16384); @@ -173,7 +173,7 @@ mod tests { } #[test] - #[cfg(not(feature = "_verify"))] + #[cfg(all(feature = "nightly", not(feature = "_verify")))] fn test_separate_flash_dfu_page_biggest() { const STATE: Partition = Partition::new(2048, 4096); const ACTIVE: Partition = Partition::new(4096, 16384); @@ -212,7 +212,7 @@ mod tests { } #[test] - #[cfg(feature = "_verify")] + #[cfg(all(feature = "nightly", feature = "_verify"))] fn test_verify() { // The following key setup is based on: // https://docs.rs/ed25519-dalek/latest/ed25519_dalek/#example