Skip to content

Commit

Permalink
fix: Check for release builds in test utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Dec 20, 2023
1 parent d33eb8c commit 451b08b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions crates/pdk-test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ static mut LOGGING: bool = false;

fn find_target_dir(search_dir: PathBuf) -> Option<PathBuf> {
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() {
Expand Down

0 comments on commit 451b08b

Please sign in to comment.