Skip to content

Commit aebcbe0

Browse files
committed
run-make-support: handle unavailable in-tree cargo under run-make test suite
1 parent f220710 commit aebcbe0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
use crate::command::Command;
2-
use crate::env_var;
32
use crate::util::set_host_compiler_dylib_path;
43

5-
/// Returns a command that can be used to invoke cargo. The cargo is provided by compiletest
6-
/// through the `CARGO` env var.
4+
/// Returns a command that can be used to invoke in-tree cargo. The cargo is provided by compiletest
5+
/// through the `CARGO` env var, and is **only** available for the `run-make-cargo` test suite.
76
pub fn cargo() -> Command {
8-
let mut cmd = Command::new(env_var("CARGO"));
7+
let cargo_path = std::env::var("CARGO").unwrap_or_else(|e| {
8+
panic!(
9+
"in-tree `cargo` should be available for `run-make-cargo` test suite, but not \
10+
`run-make` test suite: {e}"
11+
)
12+
});
13+
14+
let mut cmd = Command::new(cargo_path);
915
set_host_compiler_dylib_path(&mut cmd);
1016
cmd
1117
}

src/tools/run-make-support/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//! `run-make-support` is a support library for run-make tests. It provides command wrappers and
22
//! convenience utility functions to help test writers reduce duplication. The support library
3-
//! notably is built via cargo: this means that if your test wants some non-trivial utility, such
4-
//! as `object` or `wasmparser`, they can be re-exported and be made available through this library.
3+
//! notably is built via bootstrap cargo: this means that if your test wants some non-trivial
4+
//! utility, such as `object` or `wasmparser`, they can be re-exported and be made available through
5+
//! this library.
56
67
#![warn(unreachable_pub)]
78

0 commit comments

Comments
 (0)