From 173bf938271e2f3c35d97af580936564ae04e13b Mon Sep 17 00:00:00 2001 From: EKR Date: Fri, 29 Jul 2016 15:52:49 +0200 Subject: [PATCH] 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 Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- ssl/test/runner/runner.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go index 35fe585e..c3bdc9a6 100644 --- a/ssl/test/runner/runner.go +++ b/ssl/test/runner/runner.go @@ -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()