mirror of
https://github.com/golang/go.git
synced 2025-05-30 19:52:53 +00:00
internal/cpu: revise test to make it work properly with -cover
Fix up a test to insure that it does the right thing when "go test -cover" is in effect. Fixes #52761. Change-Id: I0c141181e2dcaefd592fb04813f812f2800511da Reviewed-on: https://go-review.googlesource.com/c/go/+/404715 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
7ca1e2aa56
commit
c4311a47a0
@ -10,7 +10,6 @@ import (
|
|||||||
"internal/testenv"
|
"internal/testenv"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -35,13 +34,9 @@ func runDebugOptionsTest(t *testing.T, test string, options string) {
|
|||||||
cmd.Env = append(cmd.Env, env)
|
cmd.Env = append(cmd.Env, env)
|
||||||
|
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
lines := strings.Fields(string(output))
|
if err != nil {
|
||||||
lastline := lines[len(lines)-1]
|
t.Fatalf("%s with %s: run failed: %v output:\n%s\n",
|
||||||
|
test, env, err, string(output))
|
||||||
got := strings.TrimSpace(lastline)
|
|
||||||
want := "PASS"
|
|
||||||
if err != nil || got != want {
|
|
||||||
t.Fatalf("%s with %s: want %s, got %v", test, env, want, got)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user