]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: make TestBuildDashIInstallsDependencies not depend only on time
authorRuss Cox <rsc@golang.org>
Sun, 16 Jul 2017 18:32:19 +0000 (14:32 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 18 Aug 2017 14:25:57 +0000 (14:25 +0000)
When we make the go command pay attention to content
instead of time, we want this test to continue working.

Change-Id: Ib7d9d0d62bfe87810d71bdfc4f29561a8c70eccc
Reviewed-on: https://go-review.googlesource.com/56273
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/go_test.go

index b836da9f5716d71bcee6ee0926e28f2341ead963..a3aa32d64a4808b8fbe91345b94214af8103b0f4 100644 (file)
@@ -2588,16 +2588,17 @@ func TestBuildDashIInstallsDependencies(t *testing.T) {
        tg.setenv("GOPATH", tg.path("."))
 
        checkbar := func(desc string) {
-               tg.sleep()
-               tg.must(os.Chtimes(tg.path("src/x/y/foo/foo.go"), time.Now(), time.Now()))
-               tg.sleep()
                tg.run("build", "-v", "-i", "x/y/bar")
                tg.grepBoth("x/y/foo", "first build -i "+desc+" did not build x/y/foo")
                tg.run("build", "-v", "-i", "x/y/bar")
                tg.grepBothNot("x/y/foo", "second build -i "+desc+" built x/y/foo")
        }
        checkbar("pkg")
+
        tg.creatingTemp("bar" + exeSuffix)
+       tg.sleep()
+       tg.tempFile("src/x/y/foo/foo.go", `package foo
+               func F() { F() }`)
        tg.tempFile("src/x/y/bar/bar.go", `package main
                import "x/y/foo"
                func main() { foo.F() }`)