Fix Regres false crash reports

Regres currently reports entire test batches as crashes when the
test batch completes, but returns error 255. For example: https://swiftshader-review.googlesource.com/c/SwiftShader/+/70069/6

This CL adds a check for dEQP's exit code, to make sure it isn't a
crash before logging the results for the entire test batch.

Bug: b/261715410
Change-Id: Ia37ad8ca062bba86bcb8f723d35dcf718f0688aa
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/70128
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/tests/regres/deqp/deqp.go b/tests/regres/deqp/deqp.go
index c2cffb4..0ac43ae 100644
--- a/tests/regres/deqp/deqp.go
+++ b/tests/regres/deqp/deqp.go
@@ -375,8 +375,19 @@
 		// Separate output per test case
 		caseOutputs := caseOutputRE.Split(out, -1)
 
-		// If the output isn't as expected, a crash may have happened, so re-run tests separately
-		if len(caseOutputs) != (numTests + 1) {
+		// If the output isn't as expected, a crash may have happened
+		isCrash := (len(caseOutputs) != (numTests + 1))
+
+		// Verify the exit code to see if a crash has happened
+		var exitErr *exec.ExitError
+		if errors.As(deqpErr, &exitErr) {
+			if exitErr.ExitCode() == 255 {
+				isCrash = true
+			}
+		}
+
+		// If a crash has happened, re-run tests separately
+		if isCrash {
 			// Re-run tests one by one
 			for _, testName := range testNames {
 				singleTest := []string{testName}