Skip to content

Commit 5ba130a

Browse files
tests
1 parent 835b3ed commit 5ba130a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/main.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,17 @@ mod tests {
6868
path.push("target");
6969
path.push("debug");
7070
path.push("cloudcheck");
71-
path.to_string_lossy().to_string()
71+
let bin_path = path.to_string_lossy().to_string();
72+
73+
if !std::path::Path::new(&bin_path).exists() {
74+
let status = Command::new("cargo")
75+
.args(["build", "--bin", "cloudcheck"])
76+
.status()
77+
.expect("Failed to run cargo build");
78+
assert!(status.success(), "Failed to build cloudcheck binary");
79+
}
80+
81+
bin_path
7282
});
7383
let mut cmd = Command::new(bin_path);
7484
cmd.args(["lookup", "8.8.8.8"]);

0 commit comments

Comments
 (0)