This allows easier use of running tests by hand.
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
// 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