Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,3 @@ fn substitute_macros(input: &str) -> String {
}
return result;
}

pub static ADDING: &'static str = " Adding";
pub static REMOVING: &'static str = " Removing";
pub static DOCTEST: &'static str = " Doc-tests";
pub static PACKAGING: &'static str = " Packaging";
pub static DOWNLOADING: &'static str = " Downloading";
pub static UPLOADING: &'static str = " Uploading";
pub static VERIFYING: &'static str = " Verifying";
pub static ARCHIVING: &'static str = " Archiving";
pub static INSTALLING: &'static str = " Installing";
pub static REPLACING: &'static str = " Replacing";
4 changes: 2 additions & 2 deletions tests/test_bad_manifest_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fn assert_not_a_cargo_toml(command: &str, manifest_path_argument: &str) {
.arg("--manifest-path").arg(manifest_path_argument)
.cwd(p.root().parent().unwrap()),
execs().with_status(101)
.with_stderr(&format!("[ERROR] the manifest-path must be a path \
to a Cargo.toml file")));
.with_stderr("[ERROR] the manifest-path must be a path \
to a Cargo.toml file"));
}

#[allow(deprecated)] // connect => join in 1.3
Expand Down
8 changes: 4 additions & 4 deletions tests/test_cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ test!(find_closest_biuld_to_build {

assert_that(pr,
execs().with_status(101)
.with_stderr(&format!("[ERROR] no such subcommand
.with_stderr("[ERROR] no such subcommand

<tab>Did you mean `build`?

")));
"));
});

// if a subcommand is more than 3 edit distance away, we don't make a suggestion
Expand All @@ -117,8 +117,8 @@ test!(find_closest_dont_correct_nonsense {

assert_that(pr,
execs().with_status(101)
.with_stderr(&format!("[ERROR] no such subcommand
")));
.with_stderr("[ERROR] no such subcommand
"));
});

test!(override_cargo_home {
Expand Down
24 changes: 12 additions & 12 deletions tests/test_cargo_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,15 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured

assert_that(p.cargo("bench").arg("foo"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stdout("\
[RUNNING] target[..]release[..]foo-[..]

running 1 test
test foo ... bench: [..] 0 ns/iter (+/- 0)

test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured

")));
"));
});

// Regression test for running cargo-bench twice with
Expand Down Expand Up @@ -776,15 +776,15 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured

assert_that(p.cargo("bench"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stdout("\
[RUNNING] target[..]release[..]foo-[..]

running 1 test
test foo ... bench: [..] 0 ns/iter (+/- 0)

test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured

")));
"));
});

test!(bench_with_examples {
Expand Down Expand Up @@ -893,7 +893,7 @@ test!(test_a_bench {

assert_that(p.cargo_process("test"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stdout("\
[COMPILING] foo v0.1.0 ([..])
[RUNNING] target[..]debug[..]b-[..]

Expand All @@ -902,7 +902,7 @@ test foo ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

")));
"));
});

test!(test_bench_no_run {
Expand All @@ -929,9 +929,9 @@ test!(test_bench_no_run {

assert_that(p.cargo_process("bench").arg("--no-run"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stdout("\
[COMPILING] foo v0.1.0 ([..])
")));
"));
});

test!(test_bench_multiple_packages {
Expand Down Expand Up @@ -1001,20 +1001,20 @@ test!(test_bench_multiple_packages {

assert_that(p.cargo_process("bench").arg("-p").arg("bar").arg("-p").arg("baz"),
execs().with_status(0)
.with_stdout_contains(&format!("\
.with_stdout_contains("\
[RUNNING] target[..]release[..]bbaz-[..]

running 1 test
test bench_baz ... bench: 0 ns/iter (+/- 0)

test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
"))
.with_stdout_contains(&format!("\
")
.with_stdout_contains("\
[RUNNING] target[..]release[..]bbar-[..]

running 1 test
test bench_bar ... bench: 0 ns/iter (+/- 0)

test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
")));
"));
});
2 changes: 1 addition & 1 deletion tests/test_cargo_build_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test!(build_with_no_lib {

assert_that(p.cargo_process("build").arg("--lib"),
execs().with_status(101)
.with_stderr(&format!("[ERROR] no library targets found")));
.with_stderr("[ERROR] no library targets found"));
});

test!(build_with_relative_cargo_home_path {
Expand Down
22 changes: 11 additions & 11 deletions tests/test_cargo_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fmt;
use cargo::util::{Cfg, CfgExpr};
use hamcrest::assert_that;

use support::{project, execs, DOWNLOADING};
use support::{project, execs};
use support::registry::Package;

macro_rules! c {
Expand Down Expand Up @@ -184,9 +184,9 @@ test!(dont_include {
"#)
.file("b/src/lib.rs", "");
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stdout("\
[COMPILING] a v0.0.1 ([..])
")));
"));
});

test!(works_through_the_registry {
Expand All @@ -211,14 +211,14 @@ test!(works_through_the_registry {
.file("src/lib.rs", "extern crate bar;");

assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stdout("\
[UPDATING] registry [..]
{downloading} [..]
{downloading} [..]
[DOWNLOADING] [..]
[DOWNLOADING] [..]
[COMPILING] foo v0.1.0 ([..])
[COMPILING] bar v0.1.0 ([..])
[COMPILING] a v0.0.1 ([..])
", downloading = DOWNLOADING)));
"));
});

test!(bad_target_spec {
Expand All @@ -235,15 +235,15 @@ test!(bad_target_spec {
.file("src/lib.rs", "");

assert_that(p.cargo_process("build"),
execs().with_status(101).with_stderr(&format!("\
execs().with_status(101).with_stderr("\
[ERROR] failed to parse manifest at `[..]`

Caused by:
failed to parse `4` as a cfg expression

Caused by:
unexpected character in cfg `4`, [..]
")));
"));
});

test!(bad_target_spec2 {
Expand All @@ -260,15 +260,15 @@ test!(bad_target_spec2 {
.file("src/lib.rs", "");

assert_that(p.cargo_process("build"),
execs().with_status(101).with_stderr(&format!("\
execs().with_status(101).with_stderr("\
[ERROR] failed to parse manifest at `[..]`

Caused by:
failed to parse `foo =` as a cfg expression

Caused by:
expected a string, found nothing
")));
"));
});

test!(multiple_match_ok {
Expand Down
8 changes: 4 additions & 4 deletions tests/test_cargo_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ test!(clean_release {
assert_that(p.cargo("clean").arg("-p").arg("foo").arg("--release"),
execs().with_status(0));
assert_that(p.cargo("build").arg("--release"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stdout("\
[COMPILING] foo v0.0.1 ([..])
")));
"));
});

test!(build_script {
Expand Down Expand Up @@ -163,12 +163,12 @@ test!(build_script {
assert_that(p.cargo("clean").arg("-p").arg("foo"),
execs().with_status(0));
assert_that(p.cargo("build").arg("-v"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stdout("\
[COMPILING] foo v0.0.1 ([..])
[RUNNING] `rustc build.rs [..]`
[RUNNING] `[..]build-script-build[..]`
[RUNNING] `rustc src[..]main.rs [..]`
")));
"));
});

test!(clean_git {
Expand Down
Loading