Accept the special token 'UNTRANSLATED_ERROR' instead of the expected error code when -loose-errors argument is used. Usable for non-bssl shims

Change-Id: I7e85a2677fe28a22103a975d517bbee900c44ac3
Reviewed-on: https://boringssl-review.googlesource.com/9050
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
EKR 2016-07-29 15:52:49 +02:00 committed by CQ bot account: commit-bot@chromium.org
parent ccd511e499
commit 173bf93827

View File

@ -58,6 +58,7 @@ var (
idleTimeout = flag.Duration("idle-timeout", 15*time.Second, "The number of seconds to wait for a read or write to bssl_shim.")
deterministic = flag.Bool("deterministic", false, "If true, uses a deterministic PRNG in the runner.")
allowUnimplemented = flag.Bool("allow-unimplemented", false, "If true, report pass even if some tests are unimplemented.")
looseErrors = flag.Bool("loose-errors", false, "If true, allow shims to report an untranslated error code.")
)
type testCert int
@ -911,7 +912,9 @@ func runTest(test *testCase, shimPath string, mallocNumToFail int64) error {
}
failed := err != nil || childErr != nil
correctFailure := len(test.expectedError) == 0 || strings.Contains(stderr, test.expectedError)
correctFailure := len(test.expectedError) == 0 || strings.Contains(stderr, test.expectedError) ||
(*looseErrors && strings.Contains(stderr, "UNTRANSLATED_ERROR"))
localError := "none"
if err != nil {
localError = err.Error()