From bfee3742d30c06e8b499a8b1353e892609ae2eb1 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 25 Jun 2024 16:51:03 +1000 Subject: [PATCH] skip the storage test if there's no sd card --- src/drivers/test/test_storage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/drivers/test/test_storage.cpp b/src/drivers/test/test_storage.cpp index 5af40052..7ca62408 100644 --- a/src/drivers/test/test_storage.cpp +++ b/src/drivers/test/test_storage.cpp @@ -31,6 +31,12 @@ TEST_CASE("sd card storage", "[integration]") { SpiFixture spi; std::unique_ptr gpios{Gpios::Create(false)}; + if (gpios->Get(IGpios::Pin::kSdCardDetect)) { + // Skip if nothing is inserted. + INFO("no sd card detected; skipping storage tests"); + return; + } + { std::unique_ptr result(SdStorage::Create(*gpios).value());