mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Make CARGO_BIN_PATH optional for tests
This allows easier use of running tests by hand.
This commit is contained in:
parent
3433a01eba
commit
fbfa8bdeca
2
Makefile
2
Makefile
@ -61,7 +61,7 @@ test-unit: target/tests/test-unit
|
||||
target/tests/test-unit $(only)
|
||||
|
||||
test-integration: target/tests/test-integration
|
||||
RUST_TEST_TASKS=1 CARGO_BIN_PATH=$(PWD)/target/ $< $(only)
|
||||
RUST_TEST_TASKS=1 $< $(only)
|
||||
|
||||
test: test-unit test-integration
|
||||
|
||||
|
@ -163,9 +163,11 @@ impl<T, E: Show> ErrMsg<T> for Result<T, E> {
|
||||
|
||||
// Path to cargo executables
|
||||
pub fn cargo_dir() -> Path {
|
||||
os::getenv("CARGO_BIN_PATH")
|
||||
.map(|s| Path::new(s))
|
||||
.unwrap_or_else(|| fail!("CARGO_BIN_PATH wasn't set. Cannot continue running test"))
|
||||
os::getenv("CARGO_BIN_PATH").map(Path::new)
|
||||
.or_else(|| os::self_exe_path().map(|p| p.dir_path()))
|
||||
.unwrap_or_else(|| {
|
||||
fail!("CARGO_BIN_PATH wasn't set. Cannot continue running test")
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns an absolute path in the filesystem that `path` points to. The
|
||||
|
Loading…
x
Reference in New Issue
Block a user