You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #143002 - Enselic:tests-ui-run-fail-exit-vs-signal, r=<try>
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-fail-without-exit-code`~ `run-crash` for those tests.
This adds further (cc #142304, #142886) protection against the regression in #123733 since that bug also manifested as `SIGABRT` in `tests/ui/panics/panic-main.rs` (shown as `Aborted (core dumped)` in the logs attached to that issue, and I have also been able to reproduce this locally).
### TODO
- [x] **Q:** what about on Windows?
**A:** we'll treat any exit code outside of 1 - 127 as "crashed", and we'll do the same on unix.
- [x] test all permutations of actual vs expected
**Done:** See #143002 (comment).
- [x] Handle targets without unwind support
- [ ] Add `run-fail-or-crash` for some sanitizer tests
### Zulip discussion
See https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/compiletest.3A.20terminate.20by.20signal.20vs.20exit.20with.20error/with/525611235
try-job: aarch64-apple
// try-job: x86_64-msvc-1
// try-job: x86_64-gnu
// try-job: dist-i586-gnu-i586-i686-musl
// try-job: test-various
try-job: aarch64-apple
Copy file name to clipboardExpand all lines: src/tools/compiletest/src/common.rs
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -111,11 +111,35 @@ string_enum! {
111
111
}
112
112
}
113
113
114
+
string_enum!{
115
+
#[derive(Clone,Copy,PartialEq,Debug,Hash)]
116
+
pubenumRunResult{
117
+
Pass => "run-pass",
118
+
Fail => "run-fail",
119
+
Crash => "run-crash",
120
+
}
121
+
}
122
+
123
+
#[derive(Copy,Clone,Debug,PartialEq,PartialOrd)]
124
+
pubenumRunFailMode{
125
+
/// Running the program must make it exit with a regular failure exit code
126
+
/// in the range `1..=127`. If the program is terminated by e.g. a signal
127
+
/// the test will fail.
128
+
Fail,
129
+
/// Running the program must result in a crash, e.g. by `SIGABRT` or
130
+
/// `SIGSEGV` on Unix or on Windows by having an appropriate NTSTATUS high
131
+
/// bit in the exit code.
132
+
Crash,
133
+
/// Running the program must either fail or crash. Useful for e.g. sanitizer tests
134
+
/// since some sanitizer implementations exit the process with code 1 to indicate failure while others abort (crash) the process in the face of memory errors.
0 commit comments