rust/tests/run-make/exit-code/rmake.rs
Folkert de Vries efaf3eb8a0
ignore run-make tests that need std on no_std targets
In particular, anything that includes `none` in the target tripple, and `nvptx64-nvidia-cuda`
2025-06-12 15:10:12 +02:00

28 lines
791 B
Rust

//@ needs-target-std
//
// Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations
use run_make_support::{rustc, rustdoc};
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").out_dir("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);
}