-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #121884 - 5225225:rmake-exit-code, r=jieyouxu
Port exit-code run-make test to use rust As part of #121876 ~~As draft because formatting will fail because `x fmt` isn't working for me for some reason, I'll debug that later, just opening this now for review, will mark as ready when formatting is fixed~~ (misleading message from x fmt) cc `@jieyouxu`
- Loading branch information
Showing
5 changed files
with
70 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations | ||
|
||
extern crate run_make_support; | ||
|
||
use run_make_support::{rustc, rustdoc, tmp_dir}; | ||
|
||
fn main() { | ||
rustc() | ||
.arg("success.rs") | ||
.run(); | ||
|
||
rustc() | ||
.arg("--invalid-arg-foo") | ||
.run_fail_assert_exit_code(1); | ||
|
||
rustc() | ||
.arg("compile-error.rs") | ||
.run_fail_assert_exit_code(1); | ||
|
||
rustc() | ||
.env("RUSTC_ICE", "0") | ||
.arg("-Ztreat-err-as-bug") | ||
.arg("compile-error.rs") | ||
.run_fail_assert_exit_code(101); | ||
|
||
rustdoc() | ||
.arg("success.rs") | ||
.arg("-o") | ||
.arg(tmp_dir().join("exit-code")) | ||
.run(); | ||
|
||
rustdoc() | ||
.arg("--invalid-arg-foo") | ||
.run_fail_assert_exit_code(1); | ||
|
||
rustdoc() | ||
.arg("compile-error.rs") | ||
.run_fail_assert_exit_code(1); | ||
|
||
rustdoc() | ||
.arg("lint-failure.rs") | ||
.run_fail_assert_exit_code(1); | ||
} |