Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 17be091

Browse files
committedJun 25, 2025·
tests: Require run-fail ui tests to have an exit code (SIGABRT not ok)
Normally a `run-fail` ui test shall not be terminated by a signal like SIGABRT. So begin having that as a hard requirement. Some of our current tests do terminate by a signal however. Introduce and use `run-crash` for those tests.
1 parent 3129d37 commit 17be091

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+132
-75
lines changed
 

‎src/tools/compiletest/src/common.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,22 @@ string_enum! {
110110
}
111111
}
112112

113+
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
114+
pub enum RunFailMode {
115+
/// Running the program must exit with an exit code >= 1 && <= 127. If the
116+
/// program is terminated by a signal (or the exit code indicates abnormal
117+
/// exit) the test will fail.
118+
FailureExitCode,
119+
/// The running program must have crashed, e.g. by SIGABRT on Unix or
120+
/// Windows by setting an appropriate NTSTATUS high bit in the exit code.
121+
Crash,
122+
}
123+
113124
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
114125
pub enum FailMode {
115126
Check,
116127
Build,
117-
Run,
128+
Run(RunFailMode),
118129
}
119130

120131
string_enum! {

‎src/tools/compiletest/src/directive-list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
241241
"regex-error-pattern",
242242
"remap-src-base",
243243
"revisions",
244+
"run-crash",
244245
"run-fail",
245246
"run-flags",
246247
"run-pass",

0 commit comments

Comments
 (0)
Please sign in to comment.