Skip to content

Commit ad06c33

Browse files
committed
Reuse target dir for example smoke tests
1 parent cfa3416 commit ad06c33

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tests/example_smoke.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ fn run_script_smoke_from_empty_cwd(example: &str) -> Output {
1414
}
1515
fs::create_dir_all(&cwd).expect("smoke cwd should be created");
1616

17-
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml");
17+
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
18+
let manifest = manifest_dir.join("Cargo.toml");
19+
let target_dir = manifest_dir.join("target").join("script-smoke");
1820
let output = Command::new(std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()))
1921
.args([
2022
"run",
2123
"--quiet",
2224
"--manifest-path",
2325
manifest.to_str().expect("manifest path should be UTF-8"),
26+
"--target-dir",
27+
target_dir
28+
.to_str()
29+
.expect("target dir path should be UTF-8"),
2430
"--example",
2531
example,
2632
"--",

0 commit comments

Comments
 (0)