Commit 5c9a3382 by Ben Clayton

Regres: Fix debug macro detection

`err` was getting nullified when the program terminated abnormally, preventing the regex matching logic from being called. Should fix binning of abortion caused by SwiftShader debug macros. Change-Id: I811441296841c77cb87839039cde754d13f2a108 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39309 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarPaul Thomson <paulthomson@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent 157ba260
...@@ -282,17 +282,6 @@ nextTest: ...@@ -282,17 +282,6 @@ nextTest:
out = strings.ReplaceAll(out, k, v) out = strings.ReplaceAll(out, k, v)
} }
// Don't treat non-zero error codes as crashes.
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
if exitErr.ExitCode() != 255 {
out += fmt.Sprintf("\nProcess terminated with code %d", exitErr.ExitCode())
err = nil
}
}
switch err.(type) {
default:
for _, test := range []struct { for _, test := range []struct {
re *regexp.Regexp re *regexp.Regexp
s testlist.Status s testlist.Status
...@@ -313,6 +302,18 @@ nextTest: ...@@ -313,6 +302,18 @@ nextTest:
continue nextTest continue nextTest
} }
} }
// Don't treat non-zero error codes as crashes.
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
if exitErr.ExitCode() != 255 {
out += fmt.Sprintf("\nProcess terminated with code %d", exitErr.ExitCode())
err = nil
}
}
switch err.(type) {
default:
results <- TestResult{ results <- TestResult{
Test: name, Test: name,
Status: testlist.Crash, Status: testlist.Crash,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment