]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/amd64/versions_test.go
[dev.boringcrypto] all: merge master into dev.boringcrypto
[gostls13.git] / src / cmd / compile / internal / amd64 / versions_test.go
index e8bda78291fa6da3e48ff0bed6ddfcc2989bc481..a21e5f2e6f774f943fbd56c9decd4909ea585679 100644 (file)
@@ -76,8 +76,18 @@ func TestGoAMD64v1(t *testing.T) {
        if err != nil {
                t.Fatalf("couldn't execute test: %s", err)
        }
-       if string(out) != "PASS\n" {
-               t.Fatalf("test reported error: %s", string(out))
+       // Expect to see output of the form "PASS\n", unless the test binary
+       // was compiled for coverage (in which case there will be an extra line).
+       success := false
+       lines := strings.Split(string(out), "\n")
+       if len(lines) == 2 {
+               success = lines[0] == "PASS" && lines[1] == ""
+       } else if len(lines) == 3 {
+               success = lines[0] == "PASS" &&
+                       strings.HasPrefix(lines[1], "coverage") && lines[2] == ""
+       }
+       if !success {
+               t.Fatalf("test reported error: %s lines=%+v", string(out), lines)
        }
 }