cargo/tests/test_cargo_version.rs
Alex Crichton ef28cd2d97 Robustly run binaries and tests after compilation
These were previously just run by executing the raw binary, but this didn't
ensure that any of the necessary paths were in the dylib search path for the
host platform.

This commit enhances the return type of `compile_targets` to have information
about the result of compilation, along with the ability to spawn correctly
configured processes.

This primarily fixes `cargo test` and `cargo run` whenever dynamic dependencies
are involved, but it also fixes the two commands whenever there's a native
dynamic dependency involved as well.
2014-08-06 18:46:23 -07:00

13 lines
289 B
Rust

use support::{project, execs};
use hamcrest::assert_that;
use cargo;
fn setup() {}
test!(simple {
let p = project("foo");
assert_that(p.cargo_process("cargo-version"),
execs().with_status(0).with_stdout(format!("{}\n",
cargo::version()).as_slice()));
})