]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cover: fix TestHtmlUnformatted in module mode
authorBryan C. Mills <bcmills@google.com>
Fri, 15 Feb 2019 22:58:21 +0000 (17:58 -0500)
committerBryan C. Mills <bcmills@google.com>
Wed, 20 Feb 2019 15:45:22 +0000 (15:45 +0000)
Updates #30228

Change-Id: Id9dffa6c805ac630945bac8febe342ce633626c6
Reviewed-on: https://go-review.googlesource.com/c/162830
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/cover/cover_test.go

index 3de9b0c12d7ea64dd18440b879a6106ff7da5cb8..f002442b638fb758edb5beaf23c37192a297ff02 100644 (file)
@@ -448,6 +448,10 @@ func TestHtmlUnformatted(t *testing.T) {
                t.Fatal(err)
        }
 
+       if err := ioutil.WriteFile(filepath.Join(htmlUDir, "go.mod"), []byte("module htmlunformatted\n"), 0444); err != nil {
+               t.Fatal(err)
+       }
+
        const htmlUContents = `
 package htmlunformatted
 
@@ -475,6 +479,7 @@ lab:
 
        // testcover -html TMPDIR/htmlunformatted.cov -o unformatted.html
        cmd = exec.Command(testcover, "-html", htmlUProfile, "-o", htmlUHTML)
+       cmd.Dir = htmlUDir
        run(cmd, t)
 }