Skip to content

Commit c636276

Browse files
committed
test: use canonical bin path to surpress warnings
1 parent adf40d0 commit c636276

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

tests/testsuite/build.rs

+5-17
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,12 @@ fn cargo_fail_with_no_stderr() {
103103
fn cargo_compile_incremental() {
104104
let p = project()
105105
.file("Cargo.toml", &basic_bin_manifest("foo"))
106-
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
106+
.file("src/main.rs", &main_file(r#""i am foo""#, &[]))
107107
.build();
108108

109109
p.cargo("build -v")
110110
.env("CARGO_INCREMENTAL", "1")
111111
.with_stderr_data(str![[r#"
112-
[WARNING] path `src/foo.rs` was erroneously implicitly accepted for binary `foo`,
113-
please set bin.path in Cargo.toml
114112
[COMPILING] foo v0.5.0 ([ROOT]/foo)
115113
[RUNNING] `rustc [..] -C incremental=[ROOT]/foo/target/debug/incremental[..]`
116114
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -121,8 +119,6 @@ please set bin.path in Cargo.toml
121119
p.cargo("test -v")
122120
.env("CARGO_INCREMENTAL", "1")
123121
.with_stderr_data(str![[r#"
124-
[WARNING] path `src/foo.rs` was erroneously implicitly accepted for binary `foo`,
125-
please set bin.path in Cargo.toml
126122
[COMPILING] foo v0.5.0 ([ROOT]/foo)
127123
[RUNNING] `rustc [..] -C incremental=[ROOT]/foo/target/debug/incremental[..]`
128124
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -819,14 +815,12 @@ fn cargo_compile_with_lowercase_cargo_toml() {
819815
fn cargo_compile_with_invalid_code() {
820816
let p = project()
821817
.file("Cargo.toml", &basic_bin_manifest("foo"))
822-
.file("src/foo.rs", "invalid rust code!")
818+
.file("src/main.rs", "invalid rust code!")
823819
.build();
824820

825821
p.cargo("build")
826822
.with_status(101)
827823
.with_stderr_data(str![[r#"
828-
[WARNING] path `src/foo.rs` was erroneously implicitly accepted for binary `foo`,
829-
please set bin.path in Cargo.toml
830824
[COMPILING] foo v0.5.0 ([ROOT]/foo)
831825
[ERROR] [..]
832826
...
@@ -879,13 +873,11 @@ fn cargo_compile_with_invalid_code_in_deps() {
879873
fn cargo_compile_with_warnings_in_the_root_package() {
880874
let p = project()
881875
.file("Cargo.toml", &basic_bin_manifest("foo"))
882-
.file("src/foo.rs", "fn main() {} fn dead() {}")
876+
.file("src/main.rs", "fn main() {} fn dead() {}")
883877
.build();
884878

885879
p.cargo("build")
886880
.with_stderr_data(str![[r#"
887-
[WARNING] path `src/foo.rs` was erroneously implicitly accepted for binary `foo`,
888-
please set bin.path in Cargo.toml
889881
[COMPILING] foo v0.5.0 ([ROOT]/foo)
890882
[WARNING] [..]dead[..]
891883
...
@@ -917,7 +909,7 @@ fn cargo_compile_with_warnings_in_a_dep_package() {
917909
name = "foo"
918910
"#,
919911
)
920-
.file("src/foo.rs", &main_file(r#""{}", bar::gimme()"#, &["bar"]))
912+
.file("src/main.rs", &main_file(r#""{}", bar::gimme()"#, &["bar"]))
921913
.file("bar/Cargo.toml", &basic_lib_manifest("bar"))
922914
.file(
923915
"bar/src/bar.rs",
@@ -933,8 +925,6 @@ fn cargo_compile_with_warnings_in_a_dep_package() {
933925

934926
p.cargo("build")
935927
.with_stderr_data(str![[r#"
936-
[WARNING] path `src/foo.rs` was erroneously implicitly accepted for binary `foo`,
937-
please set bin.path in Cargo.toml
938928
[LOCKING] 2 packages to latest compatible versions
939929
[COMPILING] bar v0.5.0 ([ROOT]/foo/bar)
940930
[WARNING] [..]dead[..]
@@ -2330,7 +2320,7 @@ fn ignore_broken_symlinks() {
23302320

23312321
let p = project()
23322322
.file("Cargo.toml", &basic_bin_manifest("foo"))
2333-
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
2323+
.file("src/main.rs", &main_file(r#""i am foo""#, &[]))
23342324
.symlink("Notafile", "bar")
23352325
// To hit the symlink directory, we need a build script
23362326
// to trigger a full scan of package files.
@@ -2340,8 +2330,6 @@ fn ignore_broken_symlinks() {
23402330

23412331
p.cargo("build")
23422332
.with_stderr_data(str![[r#"
2343-
[WARNING] path `src/foo.rs` was erroneously implicitly accepted for binary `foo`,
2344-
please set bin.path in Cargo.toml
23452333
[WARNING] File system loop found: [ROOT]/foo/a/b/c/d/foo points to an ancestor [ROOT]/foo/a/b
23462334
[COMPILING] foo v0.5.0 ([ROOT]/foo)
23472335
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s

0 commit comments

Comments
 (0)