Skip to content

Commit 6eb5adc

Browse files
committed
bad_config: replace cargo build with cargo check
1 parent e2987af commit 6eb5adc

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

tests/testsuite/bad_config.rs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -418,16 +418,13 @@ fn bad_crate_type() {
418418
.file("src/lib.rs", "")
419419
.build();
420420

421-
p.cargo("build -v")
421+
p.cargo("check")
422422
.with_status(101)
423423
.with_stderr_data(str![[r#"
424-
[ERROR] failed to run `rustc` to learn about crate-type bad_type information
425-
426-
Caused by:
427-
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --crate-type bad_type` ([EXIT_STATUS]: 1)
428-
--- stderr
429-
[ERROR] unknown crate type: `bad_type`[..]
424+
[CHECKING] foo v0.0.0 ([ROOT]/foo)
425+
[ERROR] unknown crate type: `bad_type`, expected one of: `lib`, `rlib`, `staticlib`, `dylib`, `cdylib`, `bin`, `proc-macro`
430426
427+
[ERROR] could not compile `foo` (lib) due to 1 previous error
431428
432429
"#]])
433430
.run();
@@ -3153,7 +3150,7 @@ fn non_existing_test() {
31533150
.file("src/lib.rs", "")
31543151
.build();
31553152

3156-
p.cargo("build --tests -v")
3153+
p.cargo("check --tests -v")
31573154
.with_status(101)
31583155
.with_stderr_data(str![[r#"
31593156
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3187,7 +3184,7 @@ fn non_existing_example() {
31873184
.file("src/lib.rs", "")
31883185
.build();
31893186

3190-
p.cargo("build --examples -v")
3187+
p.cargo("check --examples -v")
31913188
.with_status(101)
31923189
.with_stderr_data(str![[r#"
31933190
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3221,7 +3218,7 @@ fn non_existing_benchmark() {
32213218
.file("src/lib.rs", "")
32223219
.build();
32233220

3224-
p.cargo("build --benches -v")
3221+
p.cargo("check --benches -v")
32253222
.with_status(101)
32263223
.with_stderr_data(str![[r#"
32273224
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3241,7 +3238,7 @@ fn non_existing_binary() {
32413238
.file("src/bin/ehlo.rs", "")
32423239
.build();
32433240

3244-
p.cargo("build -v")
3241+
p.cargo("check -v")
32453242
.with_status(101)
32463243
.with_stderr_data(str![[r#"
32473244
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3278,7 +3275,7 @@ fn commonly_wrong_path_of_test() {
32783275
.file("test/foo.rs", "")
32793276
.build();
32803277

3281-
p.cargo("build --tests -v")
3278+
p.cargo("check --tests -v")
32823279
.with_status(101)
32833280
.with_stderr_data(str![[r#"
32843281
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3314,7 +3311,7 @@ fn commonly_wrong_path_of_example() {
33143311
.file("example/foo.rs", "")
33153312
.build();
33163313

3317-
p.cargo("build --examples -v")
3314+
p.cargo("check --examples -v")
33183315
.with_status(101)
33193316
.with_stderr_data(str![[r#"
33203317
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3350,7 +3347,7 @@ fn commonly_wrong_path_of_benchmark() {
33503347
.file("bench/foo.rs", "")
33513348
.build();
33523349

3353-
p.cargo("build --benches -v")
3350+
p.cargo("check --benches -v")
33543351
.with_status(101)
33553352
.with_stderr_data(str![[r#"
33563353
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3371,7 +3368,7 @@ fn commonly_wrong_path_binary() {
33713368
.file("src/bins/foo.rs", "")
33723369
.build();
33733370

3374-
p.cargo("build -v")
3371+
p.cargo("check -v")
33753372
.with_status(101)
33763373
.with_stderr_data(str![[r#"
33773374
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3392,7 +3389,7 @@ fn commonly_wrong_path_subdir_binary() {
33923389
.file("src/bins/foo/main.rs", "")
33933390
.build();
33943391

3395-
p.cargo("build -v")
3392+
p.cargo("check -v")
33963393
.with_status(101)
33973394
.with_stderr_data(str![[r#"
33983395
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
@@ -3414,7 +3411,7 @@ fn found_multiple_target_files() {
34143411
.file("src/bin/foo/main.rs", "")
34153412
.build();
34163413

3417-
p.cargo("build -v")
3414+
p.cargo("check -v")
34183415
.with_status(101)
34193416
// Don't assert the inferred paths since the order is non-deterministic.
34203417
.with_stderr_data(str![[r#"
@@ -3448,7 +3445,7 @@ fn legacy_binary_paths_warnings() {
34483445
.file("src/main.rs", "fn main() {}")
34493446
.build();
34503447

3451-
p.cargo("build -v")
3448+
p.cargo("check -v")
34523449
.with_stderr_data(str![[r#"
34533450
[WARNING] An explicit [[bin]] section is specified in Cargo.toml which currently
34543451
disables Cargo from automatically inferring other binary targets.
@@ -3467,7 +3464,7 @@ For more information on this warning you can consult
34673464
https://github.com/rust-lang/cargo/issues/5330
34683465
[WARNING] path `src/main.rs` was erroneously implicitly accepted for binary `bar`,
34693466
please set bin.path in Cargo.toml
3470-
[COMPILING] foo v1.0.0 ([ROOT]/foo)
3467+
[CHECKING] foo v1.0.0 ([ROOT]/foo)
34713468
[RUNNING] `rustc [..]`
34723469
[RUNNING] `rustc [..]`
34733470
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -3493,7 +3490,7 @@ please set bin.path in Cargo.toml
34933490
.file("src/bin/main.rs", "fn main() {}")
34943491
.build();
34953492

3496-
p.cargo("build -v")
3493+
p.cargo("check -v")
34973494
.with_stderr_data(str![[r#"
34983495
[WARNING] An explicit [[bin]] section is specified in Cargo.toml which currently
34993496
disables Cargo from automatically inferring other binary targets.
@@ -3512,7 +3509,7 @@ For more information on this warning you can consult
35123509
https://github.com/rust-lang/cargo/issues/5330
35133510
[WARNING] path `src/bin/main.rs` was erroneously implicitly accepted for binary `bar`,
35143511
please set bin.path in Cargo.toml
3515-
[COMPILING] foo v1.0.0 ([ROOT]/foo)
3512+
[CHECKING] foo v1.0.0 ([ROOT]/foo)
35163513
[RUNNING] `rustc [..]`
35173514
[RUNNING] `rustc [..]`
35183515
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -3537,11 +3534,11 @@ please set bin.path in Cargo.toml
35373534
.file("src/bar.rs", "fn main() {}")
35383535
.build();
35393536

3540-
p.cargo("build -v")
3537+
p.cargo("check -v")
35413538
.with_stderr_data(str![[r#"
35423539
[WARNING] path `src/bar.rs` was erroneously implicitly accepted for binary `bar`,
35433540
please set bin.path in Cargo.toml
3544-
[COMPILING] foo v1.0.0 ([ROOT]/foo)
3541+
[CHECKING] foo v1.0.0 ([ROOT]/foo)
35453542
[RUNNING] `rustc [..]`
35463543
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
35473544

0 commit comments

Comments
 (0)