aboutsummaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-09-20 19:41:04 -0400
committerAdam Langley <agl@google.com>2016-09-21 17:25:32 +0000
commitd2ba8891e07522396efc7bca00a12e3cc37e6ba0 (patch)
tree38579a597229f429dab061759a95a71952bfbc59 /ssl
parent9aafb64849d4339f5c3e0b31ea4ead51cf20dca4 (diff)
downloadboringssl-d2ba8891e07522396efc7bca00a12e3cc37e6ba0.zip
boringssl-d2ba8891e07522396efc7bca00a12e3cc37e6ba0.tar.gz
boringssl-d2ba8891e07522396efc7bca00a12e3cc37e6ba0.tar.bz2
Improve -valgrind error-handling.
Passing --quiet makes valgrind only print out errors, so we don't need to suppress things. Combine that with checking valgrind's dedicated exit code so we notice errors that happen before the "---DONE---" marker. This makes that marker unnecessary for valgrind. all_tests.go was not sensitive to this, but still would do well to have valgrind be silent. Change-Id: I841edf7de87081137e38990e647e989fd7567295 Reviewed-on: https://boringssl-review.googlesource.com/11128 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl')
-rw-r--r--ssl/test/runner/runner.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go
index 7b45e88..039cd5c 100644
--- a/ssl/test/runner/runner.go
+++ b/ssl/test/runner/runner.go
@@ -724,7 +724,7 @@ func doExchange(test *testCase, config *Config, conn net.Conn, isResume bool) er
}
func valgrindOf(dbAttach bool, path string, args ...string) *exec.Cmd {
- valgrindArgs := []string{"--error-exitcode=99", "--track-origins=yes", "--leak-check=full"}
+ valgrindArgs := []string{"--error-exitcode=99", "--track-origins=yes", "--leak-check=full", "--quiet"}
if dbAttach {
valgrindArgs = append(valgrindArgs, "--db-attach=yes", "--db-command=xterm -e gdb -nw %f %p")
}
@@ -937,12 +937,15 @@ func runTest(test *testCase, shimPath string, mallocNumToFail int64) error {
listener = nil
childErr := <-waitChan
+ var isValgrindError bool
if exitError, ok := childErr.(*exec.ExitError); ok {
switch exitError.Sys().(syscall.WaitStatus).ExitStatus() {
case 88:
return errMoreMallocs
case 89:
return errUnimplemented
+ case 99:
+ isValgrindError = true
}
}
@@ -991,10 +994,14 @@ func runTest(test *testCase, shimPath string, mallocNumToFail int64) error {
return fmt.Errorf("%s: local error '%s', child error '%s', stdout:\n%s\nstderr:\n%s\n%s", msg, localError, childError, stdout, stderr, extraStderr)
}
- if !*useValgrind && (len(extraStderr) > 0 || (!failed && len(stderr) > 0)) {
+ if len(extraStderr) > 0 || (!failed && len(stderr) > 0) {
return fmt.Errorf("unexpected error output:\n%s\n%s", stderr, extraStderr)
}
+ if *useValgrind && isValgrindError {
+ return fmt.Errorf("valgrind error:\n%s\n%s", stderr, extraStderr)
+ }
+
return nil
}