From: Jakub Matraszek Date: Sat, 28 Jan 2017 23:56:30 +0000 (+0100) Subject: Add test X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~9^2~182^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8c40d891e2d770fac47b440d95ac31cb5d83f120;p=cargo.git Add test --- diff --git a/tests/build.rs b/tests/build.rs index ced65b219..6ca86b6d2 100644 --- a/tests/build.rs +++ b/tests/build.rs @@ -2769,3 +2769,30 @@ fn build_all_member_dependency_same_name() { [..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n")); } +#[test] +fn run_proper_binary() { + let p = project("foo") + .file("Cargo.toml", r#" + [package] + name = "foo" + authors = [] + version = "0.0.0" + [[bin]] + name = "main" + [[bin]] + name = "other" + "#) + .file("src/lib.rs", "") + .file("src/bin/main.rs", r#" + fn main() { + panic!("This should never be run."); + } + "#) + .file("src/bin/other.rs", r#" + fn main() { + } + "#); + + assert_that(p.cargo_process("run").arg("--bin").arg("other"), + execs().with_status(0)); +}