aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/cover
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2018-06-08 10:14:29 +0200
committerDavid du Colombier <0intro@gmail.com>2018-06-08 09:35:10 +0000
commitabeac0912a037ac557861e6522204627585d6517 (patch)
treed6c190be7a95eb52b49ad3a17ee5ebb7c6e526ba /src/cmd/cover
parent29e5a81e28c633aa8d1062ce9f3749e9a8f040da (diff)
downloadgo-abeac0912a037ac557861e6522204627585d6517.tar.gz
go-abeac0912a037ac557861e6522204627585d6517.zip
cmd/cover: fix TestCoverHTML on Plan 9
CL 116975 added TestCoverHTML. However, this test is failing on Plan 9, because the GNU diff tool is called "ape/diff" instead of "diff" on Plan 9. This change replaces the "diff" command by the "ape/diff" command on Plan 9. Fixes #25795. Change-Id: I15b49868cd09f3f977aa13fffdfc430c882bf757 Reviewed-on: https://go-review.googlesource.com/117415 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/cover')
-rw-r--r--src/cmd/cover/cover_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go
index 8462b2d015..ec80f94e59 100644
--- a/src/cmd/cover/cover_test.go
+++ b/src/cmd/cover/cover_test.go
@@ -310,8 +310,12 @@ func TestCoverHTML(t *testing.T) {
if err := ioutil.WriteFile(htmlHTML, out.Bytes(), 0644); err != nil {
t.Fatal(err)
}
+ diff := "diff"
+ if runtime.GOOS == "plan9" {
+ diff = "/bin/ape/diff"
+ }
// diff -uw testdata/html/html.html testdata/html/html.golden
- cmd = exec.Command("diff", "-u", "-w", htmlHTML, htmlGolden)
+ cmd = exec.Command(diff, "-u", "-w", htmlHTML, htmlGolden)
run(cmd, t)
}