Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Include compiler crashes in ICE defintion" #94

Merged
merged 1 commit into from
May 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 43 additions & 36 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,33 +240,39 @@ impl Config {
status, stdout_utf8, stderr_utf8
);

// 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 saw_ice = || -> bool { stderr_utf8.contains("error: internal compiler error") };

const SUCCESS: Option<i32> = Some(0);
const ICE: Option<i32> = Some(101);

let input = (self.output_processing_mode(), status.code());
let input = (self.output_processing_mode(), status.success());
let result = match input {
(OutputProcessingMode::RegressOnErrorStatus, SUCCESS) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnErrorStatus, _) => TestOutcome::Regressed,

(OutputProcessingMode::RegressOnSuccessStatus, SUCCESS) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnSuccessStatus, _) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnErrorStatus, true) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnErrorStatus, false) => TestOutcome::Regressed,

(OutputProcessingMode::RegressOnIceAlone, ICE) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnIceAlone, None) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnIceAlone, _) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnSuccessStatus, true) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnSuccessStatus, false) => TestOutcome::Baseline,

(OutputProcessingMode::RegressOnNotIce, ICE) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnNotIce, None) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnNotIce, _) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnIceAlone, _) => {
if saw_ice() {
TestOutcome::Regressed
} else {
TestOutcome::Baseline
}
}
(OutputProcessingMode::RegressOnNotIce, _) => {
if saw_ice() {
TestOutcome::Baseline
} else {
TestOutcome::Regressed
}
}

(OutputProcessingMode::RegressOnNonCleanError, SUCCESS) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnNonCleanError, ICE) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnNonCleanError, None) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnNonCleanError, _) => TestOutcome::Baseline,
(OutputProcessingMode::RegressOnNonCleanError, true) => TestOutcome::Regressed,
(OutputProcessingMode::RegressOnNonCleanError, false) => {
if saw_ice() {
TestOutcome::Regressed
} else {
TestOutcome::Baseline
}
}
};
debug!(
"default_outcome_of_output: input: {:?} result: {:?}",
Expand Down Expand Up @@ -311,27 +317,27 @@ enum OutputProcessingMode {
RegressOnSuccessStatus,

/// `RegressOnIceAlone`: Marks test outcome as `Regressed` if and only if
/// 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.
/// 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.
///
/// 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 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.
/// 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.
///
/// 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 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.
/// 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.
///
/// (The main difference between this case and `RegressOnSuccessStatus` is
/// the handling of ICE: `RegressOnSuccessStatus` assumes that ICE should be
Expand All @@ -346,10 +352,11 @@ impl OutputProcessingMode {
fn must_process_stderr(&self) -> bool {
match self {
OutputProcessingMode::RegressOnErrorStatus
| OutputProcessingMode::RegressOnSuccessStatus
| OutputProcessingMode::RegressOnNonCleanError
| OutputProcessingMode::RegressOnSuccessStatus => false,

OutputProcessingMode::RegressOnNonCleanError
| OutputProcessingMode::RegressOnIceAlone
| OutputProcessingMode::RegressOnNotIce => false,
| OutputProcessingMode::RegressOnNotIce => true,
}
}
}
Expand Down