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,6 +282,27 @@ nextTest:
out = strings.ReplaceAll(out, k, v)
}
for _, test := range []struct {
re *regexp.Regexp
s testlist.Status
}{
{unimplementedRE, testlist.Unimplemented},
{unsupportedRE, testlist.Unsupported},
{unreachableRE, testlist.Unreachable},
{assertRE, testlist.Assert},
{abortRE, testlist.Abort},
} {
if s := test.re.FindString(out); s != "" {
results <- TestResult{
Test: name,
Status: test.s,
TimeTaken: duration,
Err: s,
}
continue nextTest
}
}
// Don't treat non-zero error codes as crashes.
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
......@@ -293,26 +314,6 @@ nextTest:
switch err.(type) {
default:
for _, test := range []struct {
re *regexp.Regexp
s testlist.Status
}{
{unimplementedRE, testlist.Unimplemented},
{unsupportedRE, testlist.Unsupported},
{unreachableRE, testlist.Unreachable},
{assertRE, testlist.Assert},
{abortRE, testlist.Abort},
} {
if s := test.re.FindString(out); s != "" {
results <- TestResult{
Test: name,
Status: test.s,
TimeTaken: duration,
Err: s,
}
continue nextTest
}
}
results <- TestResult{
Test: name,
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