From a3891cdd26d1c5d35257c351c7c86fa7e72604bb Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Mon, 20 Apr 2020 13:35:29 +0100 Subject: [PATCH] Include compiler crashes in ICE defintion This matches the definition [used in glacier], which includes exit status 101 without an accompanying diagnostic (such as rust-lang/rust#21599), and when rustc is killed by a signal (rust-lang/rust#13368) This also means no processing modes are capturing stdio, but I didn't remove it as it may be desired for the regex features discussed in #53 [used in glacier]: https://github.com/rust-lang/glacier/blob/77029d8e7f755bd95913d3c741738674d5ccadc3/src/lib.rs#L51-L56 --- src/main.rs | 79 ++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9c20074..99e4f19 100644 --- a/src/main.rs +++ b/src/main.rs @@ -239,39 +239,33 @@ impl Config { status, stdout_utf8, stderr_utf8 ); - let saw_ice = || -> bool { stderr_utf8.contains("error: internal compiler error") }; + // for commit message: + // no text but 101 https://github.com/rust-lang/rust/issues/21599 + // no text, signal https://github.com/rust-lang/rust/issues/13368 - let input = (self.output_processing_mode(), status.success()); + const SUCCESS: Option = Some(0); + const ICE: Option = Some(101); + + let input = (self.output_processing_mode(), status.code()); let result = match input { - (OutputProcessingMode::RegressOnErrorStatus, true) => TestOutcome::Baseline, - (OutputProcessingMode::RegressOnErrorStatus, false) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnErrorStatus, SUCCESS) => TestOutcome::Baseline, + (OutputProcessingMode::RegressOnErrorStatus, _) => TestOutcome::Regressed, - (OutputProcessingMode::RegressOnSuccessStatus, true) => TestOutcome::Regressed, - (OutputProcessingMode::RegressOnSuccessStatus, false) => TestOutcome::Baseline, + (OutputProcessingMode::RegressOnSuccessStatus, SUCCESS) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnSuccessStatus, _) => TestOutcome::Baseline, - (OutputProcessingMode::RegressOnIceAlone, _) => { - if saw_ice() { - TestOutcome::Regressed - } else { - TestOutcome::Baseline - } - } - (OutputProcessingMode::RegressOnNotIce, _) => { - if saw_ice() { - TestOutcome::Baseline - } else { - TestOutcome::Regressed - } - } + (OutputProcessingMode::RegressOnIceAlone, ICE) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnIceAlone, None) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnIceAlone, _) => TestOutcome::Baseline, - (OutputProcessingMode::RegressOnNonCleanError, true) => TestOutcome::Regressed, - (OutputProcessingMode::RegressOnNonCleanError, false) => { - if saw_ice() { - TestOutcome::Regressed - } else { - TestOutcome::Baseline - } - } + (OutputProcessingMode::RegressOnNotIce, ICE) => TestOutcome::Baseline, + (OutputProcessingMode::RegressOnNotIce, None) => TestOutcome::Baseline, + (OutputProcessingMode::RegressOnNotIce, _) => TestOutcome::Regressed, + + (OutputProcessingMode::RegressOnNonCleanError, SUCCESS) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnNonCleanError, ICE) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnNonCleanError, None) => TestOutcome::Regressed, + (OutputProcessingMode::RegressOnNonCleanError, _) => TestOutcome::Baseline, }; debug!( "default_outcome_of_output: input: {:?} result: {:?}", @@ -316,27 +310,27 @@ enum OutputProcessingMode { RegressOnSuccessStatus, /// `RegressOnIceAlone`: Marks test outcome as `Regressed` if and only if - /// the `rustc` process issues a diagnostic indicating that an internal - /// compiler error (ICE) occurred. This covers the use case for when you - /// want to bisect to see when an ICE was introduced pon a codebase that is - /// meant to produce a clean error. + /// the `rustc` process crashes or reports an interal compiler error (ICE) + /// has occurred. This covers the use case for when you want to bisect to + /// see when an ICE was introduced pon a codebase that is meant to produce a + /// clean error. /// /// You explicitly opt into this seting via `--regress=ice`. RegressOnIceAlone, /// `RegressOnNotIce`: Marks test outcome as `Regressed` if and only if - /// the `rustc` process does not issue a diagnostic indicating that an - /// internal compiler error (ICE) occurred. This covers the use case for - /// when you want to bisect to see when an ICE was fixed. + /// the `rustc` process does not crash or report that an internal compiler + /// error (ICE) has occurred. This covers the use case for when you want to + /// bisect to see when an ICE was fixed. /// /// You explicitly opt into this setting via `--regress=non-ice` RegressOnNotIce, /// `RegressOnNonCleanError`: Marks test outcome as `Baseline` if and only - /// if the `rustc` process reports error status and does not issue any - /// diagnostic indicating that an internal compiler error (ICE) occurred. - /// This is the use case if the regression is a case where an ill-formed - /// program has stopped being properly rejected by the compiler. + /// if the `rustc` process reports error status that is not an internal + /// compiler error (ICE). This is the use case if the regression is a case + /// where an ill-formed program has stopped being properly rejected by the + /// compiler. /// /// (The main difference between this case and `RegressOnSuccessStatus` is /// the handling of ICE: `RegressOnSuccessStatus` assumes that ICE should be @@ -351,11 +345,10 @@ impl OutputProcessingMode { fn must_process_stderr(&self) -> bool { match self { OutputProcessingMode::RegressOnErrorStatus - | OutputProcessingMode::RegressOnSuccessStatus => false, - - OutputProcessingMode::RegressOnNonCleanError + | OutputProcessingMode::RegressOnSuccessStatus + | OutputProcessingMode::RegressOnNonCleanError | OutputProcessingMode::RegressOnIceAlone - | OutputProcessingMode::RegressOnNotIce => true, + | OutputProcessingMode::RegressOnNotIce => false, } } }