Skip to content

Commit dde3178

Browse files
committed
compiletest: crashes: turn off backtraces for faster tests
1 parent 7048ce7 commit dde3178

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/tools/compiletest/src/header.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,16 @@ impl TestProps {
581581
self.incremental = true;
582582
}
583583

584+
if config.mode == Mode::Crashes {
585+
// we don't want to pollute anything with backtrace-files
586+
// also turn off backtraces in order to save some execution
587+
// time on the tests; we only need to know IF it crashes
588+
self.rustc_env = vec![
589+
("RUST_BACKTRACE".to_string(), "0".to_string()),
590+
("RUSTC_ICE".to_string(), "0".to_string()),
591+
];
592+
}
593+
584594
for key in &["RUST_TEST_NOCAPTURE", "RUST_TEST_THREADS"] {
585595
if let Ok(val) = env::var(key) {
586596
if self.exec_env.iter().find(|&&(ref x, _)| x == key).is_none() {
@@ -596,7 +606,8 @@ impl TestProps {
596606

597607
fn update_fail_mode(&mut self, ln: &str, config: &Config) {
598608
let check_ui = |mode: &str| {
599-
if config.mode != Mode::Ui {
609+
// Mode::Crashes may need build-fail in order to trigger llvm errors or stack overflows
610+
if config.mode != Mode::Ui && config.mode != Mode::Crashes {
600611
panic!("`{}-fail` header is only supported in UI tests", mode);
601612
}
602613
};
@@ -625,7 +636,7 @@ impl TestProps {
625636
fn update_pass_mode(&mut self, ln: &str, revision: Option<&str>, config: &Config) {
626637
let check_no_run = |s| match (config.mode, s) {
627638
(Mode::Ui, _) => (),
628-
(Mode::Crashes, "should-ice") => (),
639+
(Mode::Crashes, _) => (),
629640
(Mode::Codegen, "build-pass") => (),
630641
(Mode::Incremental, _) => {
631642
if revision.is_some() && !self.revisions.iter().all(|r| r.starts_with("cfail")) {

0 commit comments

Comments
 (0)