From 451b08bc99441ac9846e71a244583e7a506e6e03 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 20 Dec 2023 10:57:50 -0800 Subject: [PATCH] fix: Check for release builds in test utils. --- crates/pdk-test-utils/src/lib.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/pdk-test-utils/src/lib.rs b/crates/pdk-test-utils/src/lib.rs index 067b14a0b..6738f06e0 100644 --- a/crates/pdk-test-utils/src/lib.rs +++ b/crates/pdk-test-utils/src/lib.rs @@ -19,18 +19,21 @@ static mut LOGGING: bool = false; fn find_target_dir(search_dir: PathBuf) -> Option { let mut dir = search_dir; + let profiles = ["debug", "release"]; loop { - let next_target = dir.join("target/wasm32-wasi/debug"); + for profile in &profiles { + let next_target = dir.join("target/wasm32-wasi").join(profile); - if next_target.exists() { - return Some(next_target); - } + if next_target.exists() { + return Some(next_target); + } - let next_target = dir.join("wasm32-wasi/debug"); + let next_target = dir.join("wasm32-wasi").join(profile); - if next_target.exists() { - return Some(next_target); + if next_target.exists() { + return Some(next_target); + } } match dir.parent() {