Support a map of test names to expected errors.
diff -ru vanilla/runner.go bogo/runner.go
@@ -78,6 +78,10 @@
// “:NO_SHARED_CIPHER:” (a BoringSSL error string) to something
// like “SSL_ERROR_NO_CYPHER_OVERLAP”.
ErrorMap map[string]string
+
+ // TestErrorMap maps from full test names to the correct error
+ // string for the shim in question.
+ TestErrorMap map[string]string
}
var shimConfig ShimConfiguration
@@ -766,7 +770,11 @@
}
}
-func translateExpectedError(errorStr string) string {
+func translateExpectedError(testName string, errorStr string) string {
+ if translated, ok := shimConfig.TestErrorMap[testName]; ok {
+ return translated
+ }
+
if translated, ok := shimConfig.ErrorMap[errorStr]; ok {
return translated
}
@@ -936,7 +944,7 @@
}
failed := err != nil || childErr != nil
- expectedError := translateExpectedError(test.expectedError)
+ expectedError := translateExpectedError(test.name, test.expectedError)
correctFailure := len(expectedError) == 0 || strings.Contains(stderr, expectedError)
localError := "none"