test: migrate glob_targets to snapbox

This commit is contained in:
eth3lbert 2024-07-05 12:26:00 +08:00
parent abe43b7777
commit 874c05be73
No known key found for this signature in database

View file

@ -1,20 +1,18 @@
//! Tests for target filter flags with glob patterns.
#![allow(deprecated)]
use cargo_test_support::{project, Project};
use cargo_test_support::prelude::*;
use cargo_test_support::{project, str, Project};
#[cargo_test]
fn build_example() {
full_project()
.cargo("build -v --example 'ex*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name example1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -22,13 +20,12 @@ fn build_example() {
fn build_bin() {
full_project()
.cargo("build -v --bin 'bi*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -36,19 +33,17 @@ fn build_bin() {
fn build_bench() {
full_project()
.cargo("build -v --bench 'be*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name bench1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name bench1 [..]`
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]]
.unordered(),
)
.run();
}
@ -57,19 +52,17 @@ fn build_bench() {
fn build_test() {
full_project()
.cargo("build -v --test 'te*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name test1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name test1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]]
.unordered(),
)
.run();
}
@ -78,13 +71,12 @@ fn build_test() {
fn check_example() {
full_project()
.cargo("check -v --example 'ex*1'")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name example1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -92,13 +84,12 @@ fn check_example() {
fn check_bin() {
full_project()
.cargo("check -v --bin 'bi*1'")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -106,13 +97,12 @@ fn check_bin() {
fn check_bench() {
full_project()
.cargo("check -v --bench 'be*1'")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bench1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -120,13 +110,12 @@ fn check_bench() {
fn check_test() {
full_project()
.cargo("check -v --test 'te*1'")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name test1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -134,14 +123,13 @@ fn check_test() {
fn doc_bin() {
full_project()
.cargo("doc -v --bin 'bi*1'")
.with_stderr(
"\
[DOCUMENTING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustdoc --edition=2015 --crate-type bin --crate-name bin1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/bin1/index.html
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[GENERATED] [ROOT]/foo/target/doc/bin1/index.html
"#]])
.run();
}
@ -149,14 +137,13 @@ fn doc_bin() {
fn fix_example() {
full_project()
.cargo("fix -v --example 'ex*1' --allow-no-vcs")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `[..] rustc --crate-name example1 [..]`
[FIXING] examples/example1.rs
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -164,14 +151,13 @@ fn fix_example() {
fn fix_bin() {
full_project()
.cargo("fix -v --bin 'bi*1' --allow-no-vcs")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `[..] rustc --crate-name bin1 [..]`
[FIXING] src/bin/bin1.rs
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -179,14 +165,13 @@ fn fix_bin() {
fn fix_bench() {
full_project()
.cargo("fix -v --bench 'be*1' --allow-no-vcs")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `[..] rustc --crate-name bench1 [..]`
[FIXING] benches/bench1.rs
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -194,14 +179,13 @@ fn fix_bench() {
fn fix_test() {
full_project()
.cargo("fix -v --test 'te*1' --allow-no-vcs")
.with_stderr(
"\
[CHECKING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[CHECKING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `[..] rustc --crate-name test1 [..]`
[FIXING] tests/test1.rs
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -210,12 +194,18 @@ fn run_example_and_bin() {
let p = full_project();
p.cargo("run -v --bin 'bi*1'")
.with_status(101)
.with_stderr("[ERROR] `cargo run` does not support glob patterns on target selection")
.with_stderr_data(str![[r#"
[ERROR] `cargo run` does not support glob patterns on target selection
"#]])
.run();
p.cargo("run -v --example 'ex*1'")
.with_status(101)
.with_stderr("[ERROR] `cargo run` does not support glob patterns on target selection")
.with_stderr_data(str![[r#"
[ERROR] `cargo run` does not support glob patterns on target selection
"#]])
.run();
}
@ -223,14 +213,13 @@ fn run_example_and_bin() {
fn test_example() {
full_project()
.cargo("test -v --example 'ex*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name example1 [..]`
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[RUNNING] [..]example1[..]
",
)
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/debug/examples/example1-[HASH][EXE]`
"#]])
.run();
}
@ -238,14 +227,13 @@ fn test_example() {
fn test_bin() {
full_project()
.cargo("test -v --bin 'bi*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[RUNNING] [..]bin1[..]
",
)
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/debug/deps/bin1-[HASH][EXE]`
"#]])
.run();
}
@ -253,20 +241,18 @@ fn test_bin() {
fn test_bench() {
full_project()
.cargo("test -v --bench 'be*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name bench1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[RUNNING] [..]bench1[..]
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name bench1 [..]`
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/debug/deps/bench1-[HASH][EXE]`
"#]]
.unordered(),
)
.run();
}
@ -275,20 +261,18 @@ fn test_bench() {
fn test_test() {
full_project()
.cargo("test -v --test 'te*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name test1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [..]
[RUNNING] [..]test1[..]
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name test1 [..]`
[RUNNING] `rustc --crate-name bin1 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name bin2 [..]`
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/debug/deps/test1-[HASH][EXE]`
"#]]
.unordered(),
)
.run();
}
@ -297,14 +281,13 @@ fn test_test() {
fn bench_example() {
full_project()
.cargo("bench -v --example 'ex*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name example1 [..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[RUNNING] `[..]example1[..] --bench`
",
)
[FINISHED] `bench` profile [optimized] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/release/examples/example1-[HASH][EXE] --bench`
"#]])
.run();
}
@ -312,14 +295,13 @@ fn bench_example() {
fn bench_bin() {
full_project()
.cargo("bench -v --bin 'bi*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[RUNNING] `[..]bin1[..] --bench`
",
)
[FINISHED] `bench` profile [optimized] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/release/deps/bin1-[HASH][EXE] --bench`
"#]])
.run();
}
@ -327,20 +309,18 @@ fn bench_bin() {
fn bench_bench() {
full_project()
.cargo("bench -v --bench 'be*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name bench1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[RUNNING] `[..]bench1[..] --bench`
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name bench1 [..]`
[FINISHED] `bench` profile [optimized] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/release/deps/bench1-[HASH][EXE] --bench`
"#]]
.unordered(),
)
.run();
}
@ -349,20 +329,18 @@ fn bench_bench() {
fn bench_test() {
full_project()
.cargo("bench -v --test 'te*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name test1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `bench` profile [optimized] target(s) in [..]
[RUNNING] `[..]test1[..] --bench`
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name test1 [..]`
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `bench` profile [optimized] target(s) in [ELAPSED]s
[RUNNING] `[ROOT]/foo/target/release/deps/test1-[HASH][EXE] --bench`
"#]]
.unordered(),
)
.run();
}
@ -371,16 +349,15 @@ fn bench_test() {
fn install_example() {
full_project()
.cargo("install --path . --example 'ex*1'")
.with_stderr(
"\
[INSTALLING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `release` profile [optimized] target(s) in [..]
[INSTALLING] [..]/home/.cargo/bin/example1[EXE]
[INSTALLED] package `foo v0.0.1 ([CWD])` (executable `example1[EXE]`)
[WARNING] be sure to add [..]
",
)
.with_stderr_data(str![[r#"
[INSTALLING] foo v0.0.1 ([ROOT]/foo)
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [ROOT]/home/.cargo/bin/example1[EXE]
[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `example1[EXE]`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
"#]])
.run();
}
@ -388,16 +365,15 @@ fn install_example() {
fn install_bin() {
full_project()
.cargo("install --path . --bin 'bi*1'")
.with_stderr(
"\
[INSTALLING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] `release` profile [optimized] target(s) in [..]
[INSTALLING] [..]/home/.cargo/bin/bin1[EXE]
[INSTALLED] package `foo v0.0.1 ([CWD])` (executable `bin1[EXE]`)
[WARNING] be sure to add [..]
",
)
.with_stderr_data(str![[r#"
[INSTALLING] foo v0.0.1 ([ROOT]/foo)
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [ROOT]/home/.cargo/bin/bin1[EXE]
[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `bin1[EXE]`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
"#]])
.run();
}
@ -405,14 +381,13 @@ fn install_bin() {
fn rustdoc_example() {
full_project()
.cargo("rustdoc -v --example 'ex*1'")
.with_stderr(
"\
[DOCUMENTING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustdoc --edition=2015 --crate-type bin --crate-name example1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/example1/index.html
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[GENERATED] [ROOT]/foo/target/doc/example1/index.html
"#]])
.run();
}
@ -420,14 +395,13 @@ fn rustdoc_example() {
fn rustdoc_bin() {
full_project()
.cargo("rustdoc -v --bin 'bi*1'")
.with_stderr(
"\
[DOCUMENTING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustdoc --edition=2015 --crate-type bin --crate-name bin1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/bin1/index.html
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[GENERATED] [ROOT]/foo/target/doc/bin1/index.html
"#]])
.run();
}
@ -435,14 +409,13 @@ fn rustdoc_bin() {
fn rustdoc_bench() {
full_project()
.cargo("rustdoc -v --bench 'be*1'")
.with_stderr(
"\
[DOCUMENTING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustdoc --edition=2015 --crate-type bin --crate-name bench1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/bench1/index.html
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[GENERATED] [ROOT]/foo/target/doc/bench1/index.html
"#]])
.run();
}
@ -450,14 +423,13 @@ fn rustdoc_bench() {
fn rustdoc_test() {
full_project()
.cargo("rustdoc -v --test 'te*1'")
.with_stderr(
"\
[DOCUMENTING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustdoc --edition=2015 --crate-type bin --crate-name test1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[GENERATED] [CWD]/target/doc/test1/index.html
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[GENERATED] [ROOT]/foo/target/doc/test1/index.html
"#]])
.run();
}
@ -465,13 +437,12 @@ fn rustdoc_test() {
fn rustc_example() {
full_project()
.cargo("rustc -v --example 'ex*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name example1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -479,13 +450,12 @@ fn rustc_example() {
fn rustc_bin() {
full_project()
.cargo("rustc -v --bin 'bi*1'")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}
@ -493,19 +463,17 @@ fn rustc_bin() {
fn rustc_bench() {
full_project()
.cargo("rustc -v --bench 'be*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name bench1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[RUNNING] `rustc --crate-name bench1 [..]`
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]]
.unordered(),
)
.run();
}
@ -514,19 +482,17 @@ fn rustc_bench() {
fn rustc_test() {
full_project()
.cargo("rustc -v --test 'te*1'")
.with_stderr_contains("[RUNNING] `rustc --crate-name test1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin2 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name bin1 [..]`")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]`")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[RUNNING] `rustc --crate-name [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
.with_stderr_data(
str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[RUNNING] `rustc --crate-name bin1 [..]`
[RUNNING] `rustc --crate-name bin2 [..]`
[RUNNING] `rustc --crate-name foo [..]`
[RUNNING] `rustc --crate-name test1 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]]
.unordered(),
)
.run();
}