Skip to content

Commit 135ef53

Browse files
committed
Auto merge of #5852 - dwijnand:exit-code-0, r=alexcrichton
Default test support's Execs to exit code 0 Refs #5742
2 parents 67c4796 + b1d6a7e commit 135ef53

72 files changed

Lines changed: 1295 additions & 1536 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ARCHITECTURE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ call to `execs()`:
9393
// Before
9494
assert_that(
9595
p.cargo("run"),
96-
execs().with_status(0)
96+
execs()
9797
);
9898

9999
// After
100100
assert_that(
101101
p.cargo("run"),
102-
execs().stream().with_status(0)
102+
execs().stream()
103103
);
104104
```
105105

tests/testsuite/alt_registry.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn depend_on_alt_registry() {
5959

6060
assert_that(
6161
p.cargo("build").masquerade_as_nightly_cargo(),
62-
execs().with_status(0).with_stderr(&format!(
62+
execs().with_stderr(&format!(
6363
"\
6464
[UPDATING] registry `{reg}`
6565
[DOWNLOADING] bar v0.0.1 (registry `file://[..]`)
@@ -74,13 +74,13 @@ fn depend_on_alt_registry() {
7474

7575
assert_that(
7676
p.cargo("clean").masquerade_as_nightly_cargo(),
77-
execs().with_status(0),
77+
execs(),
7878
);
7979

8080
// Don't download a second time
8181
assert_that(
8282
p.cargo("build").masquerade_as_nightly_cargo(),
83-
execs().with_status(0).with_stderr(&format!(
83+
execs().with_stderr(&format!(
8484
"\
8585
[COMPILING] bar v0.0.1 (registry `file://[..]`)
8686
[COMPILING] foo v0.0.1 ({dir})
@@ -120,7 +120,7 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() {
120120

121121
assert_that(
122122
p.cargo("build").masquerade_as_nightly_cargo(),
123-
execs().with_status(0).with_stderr(&format!(
123+
execs().with_stderr(&format!(
124124
"\
125125
[UPDATING] registry `{reg}`
126126
[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
@@ -165,7 +165,7 @@ fn depend_on_alt_registry_depends_on_same_registry() {
165165

166166
assert_that(
167167
p.cargo("build").masquerade_as_nightly_cargo(),
168-
execs().with_status(0).with_stderr(&format!(
168+
execs().with_stderr(&format!(
169169
"\
170170
[UPDATING] registry `{reg}`
171171
[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
@@ -210,7 +210,7 @@ fn depend_on_alt_registry_depends_on_crates_io() {
210210

211211
assert_that(
212212
p.cargo("build").masquerade_as_nightly_cargo(),
213-
execs().with_status(0).with_stderr(&format!(
213+
execs().with_stderr(&format!(
214214
"\
215215
[UPDATING] registry `{alt_reg}`
216216
[UPDATING] registry `{reg}`
@@ -255,7 +255,7 @@ fn registry_and_path_dep_works() {
255255

256256
assert_that(
257257
p.cargo("build").masquerade_as_nightly_cargo(),
258-
execs().with_status(0).with_stderr(&format!(
258+
execs().with_stderr(&format!(
259259
"\
260260
[COMPILING] bar v0.0.1 ({dir}/bar)
261261
[COMPILING] foo v0.0.1 ({dir})
@@ -355,7 +355,7 @@ fn publish_with_registry_dependency() {
355355
.arg("alternative")
356356
.arg("TOKEN")
357357
.arg("-Zunstable-options"),
358-
execs().with_status(0),
358+
execs(),
359359
);
360360

361361
assert_that(
@@ -364,7 +364,7 @@ fn publish_with_registry_dependency() {
364364
.arg("--registry")
365365
.arg("alternative")
366366
.arg("-Zunstable-options"),
367-
execs().with_status(0),
367+
execs(),
368368
);
369369
}
370370

@@ -400,7 +400,6 @@ fn alt_registry_and_crates_io_deps() {
400400
assert_that(
401401
p.cargo("build").masquerade_as_nightly_cargo(),
402402
execs()
403-
.with_status(0)
404403
.with_stderr_contains(format!(
405404
"[UPDATING] registry `{}`",
406405
registry::alt_registry()
@@ -467,7 +466,7 @@ fn publish_to_alt_registry() {
467466
.arg("alternative")
468467
.arg("TOKEN")
469468
.arg("-Zunstable-options"),
470-
execs().with_status(0),
469+
execs(),
471470
);
472471

473472
// Now perform the actual publish
@@ -477,7 +476,7 @@ fn publish_to_alt_registry() {
477476
.arg("--registry")
478477
.arg("alternative")
479478
.arg("-Zunstable-options"),
480-
execs().with_status(0),
479+
execs(),
481480
);
482481

483482
// Ensure that the crate is uploaded
@@ -516,7 +515,7 @@ fn publish_with_crates_io_dep() {
516515
.arg("alternative")
517516
.arg("TOKEN")
518517
.arg("-Zunstable-options"),
519-
execs().with_status(0),
518+
execs(),
520519
);
521520

522521
assert_that(
@@ -525,7 +524,7 @@ fn publish_with_crates_io_dep() {
525524
.arg("--registry")
526525
.arg("alternative")
527526
.arg("-Zunstable-options"),
528-
execs().with_status(0),
527+
execs(),
529528
);
530529
}
531530

tests/testsuite/bad_config.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn default_cargo_config_jobs() {
175175
"#,
176176
)
177177
.build();
178-
assert_that(p.cargo("build").arg("-v"), execs().with_status(0));
178+
assert_that(p.cargo("build").arg("-v"), execs());
179179
}
180180

181181
#[test]
@@ -190,7 +190,7 @@ fn good_cargo_config_jobs() {
190190
"#,
191191
)
192192
.build();
193-
assert_that(p.cargo("build").arg("-v"), execs().with_status(0));
193+
assert_that(p.cargo("build").arg("-v"), execs());
194194
}
195195

196196
#[test]
@@ -371,7 +371,7 @@ fn bad_dependency_in_lockfile() {
371371
)
372372
.build();
373373

374-
assert_that(p.cargo("build"), execs().with_status(0));
374+
assert_that(p.cargo("build"), execs());
375375
}
376376

377377
#[test]
@@ -683,7 +683,7 @@ fn unused_keys() {
683683

684684
assert_that(
685685
p.cargo("build"),
686-
execs().with_status(0).with_stderr(
686+
execs().with_stderr(
687687
"\
688688
warning: unused manifest key: target.foo.bar
689689
[COMPILING] foo v0.1.0 (file:///[..])
@@ -710,7 +710,7 @@ warning: unused manifest key: target.foo.bar
710710

711711
assert_that(
712712
p.cargo("build"),
713-
execs().with_status(0).with_stderr(
713+
execs().with_stderr(
714714
"\
715715
warning: unused manifest key: profile.debug
716716
warning: use `[profile.dev]` to configure debug builds
@@ -735,7 +735,7 @@ warning: use `[profile.dev]` to configure debug builds
735735
.build();
736736
assert_that(
737737
p.cargo("build"),
738-
execs().with_status(0).with_stderr(
738+
execs().with_stderr(
739739
"\
740740
warning: unused manifest key: project.bulid
741741
[COMPILING] foo [..]
@@ -763,7 +763,7 @@ warning: unused manifest key: project.bulid
763763
.build();
764764
assert_that(
765765
p.cargo("build"),
766-
execs().with_status(0).with_stderr(
766+
execs().with_stderr(
767767
"\
768768
warning: unused manifest key: lib.build
769769
[COMPILING] foo [..]
@@ -789,7 +789,7 @@ fn unused_keys_in_virtual_manifest() {
789789
.build();
790790
assert_that(
791791
p.cargo("build --all"),
792-
execs().with_status(0).with_stderr(
792+
execs().with_stderr(
793793
"\
794794
warning: unused manifest key: workspace.bulid
795795
[COMPILING] bar [..]
@@ -821,7 +821,7 @@ fn empty_dependencies() {
821821

822822
assert_that(
823823
p.cargo("build"),
824-
execs().with_status(0).with_stderr_contains(
824+
execs().with_stderr_contains(
825825
"\
826826
warning: dependency (bar) specified without providing a local path, Git repository, or version \
827827
to use. This will be considered an error in future versions
@@ -839,7 +839,7 @@ fn invalid_toml_historically_allowed_is_warned() {
839839

840840
assert_that(
841841
p.cargo("build"),
842-
execs().with_status(0).with_stderr(
842+
execs().with_stderr(
843843
"\
844844
warning: TOML file found which contains invalid syntax and will soon not parse
845845
at `[..]config`.
@@ -877,7 +877,7 @@ fn ambiguous_git_reference() {
877877

878878
assert_that(
879879
p.cargo("build").arg("-v"),
880-
execs().with_stderr_contains(
880+
execs().with_status(101).with_stderr_contains(
881881
"\
882882
[WARNING] dependency (bar) specification is ambiguous. \
883883
Only one of `branch`, `tag` or `rev` is allowed. \
@@ -1097,7 +1097,7 @@ fn both_git_and_path_specified() {
10971097

10981098
assert_that(
10991099
foo.cargo("build").arg("-v"),
1100-
execs().with_stderr_contains(
1100+
execs().with_status(101).with_stderr_contains(
11011101
"\
11021102
[WARNING] dependency (bar) specification is ambiguous. \
11031103
Only one of `git` or `path` is allowed. \
@@ -1162,7 +1162,7 @@ fn ignored_git_revision() {
11621162

11631163
assert_that(
11641164
foo.cargo("build").arg("-v"),
1165-
execs().with_stderr_contains(
1165+
execs().with_status(101).with_stderr_contains(
11661166
"\
11671167
[WARNING] key `branch` is ignored for dependency (bar). \
11681168
This will be considered an error in future versions",

0 commit comments

Comments
 (0)