Skip to content

Commit

Permalink
cmd/go: convert TestDotDotDotOutsideGOPATH to script framework
Browse files Browse the repository at this point in the history
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2170f427c238e9fe8c029b43b346621d82c5e8fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/214388
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
matloob committed Feb 19, 2020
1 parent 3791594 commit 2cdb2ec
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2404,29 +2404,6 @@ GLOBL ·constants<>(SB),8,$8
tg.run("build", "p")
}

// Issue 18778.
func TestDotDotDotOutsideGOPATH(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()

tg.tempFile("pkgs/a.go", `package x`)
tg.tempFile("pkgs/a_test.go", `package x_test
import "testing"
func TestX(t *testing.T) {}`)

tg.tempFile("pkgs/a/a.go", `package a`)
tg.tempFile("pkgs/a/a_test.go", `package a_test
import "testing"
func TestA(t *testing.T) {}`)

tg.cd(tg.path("pkgs"))
tg.run("build", "./...")
tg.run("test", "./...")
tg.run("list", "./...")
tg.grepStdout("pkgs$", "expected package not listed")
tg.grepStdout("pkgs/a", "expected package not listed")
}

// Issue 18975.
func TestFFLAGS(t *testing.T) {
if !canCgo {
Expand Down
29 changes: 29 additions & 0 deletions src/cmd/go/testdata/script/build_patterns_outside_gopath.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Tests issue #18778

cd pkgs
go build ./...
! stdout .
go test ./...
stdout '^ok'
go list ./...
stdout 'pkgs$'
stdout 'pkgs/a'

-- pkgs/a.go --
package x
-- pkgs/a_test.go --
package x_test

import "testing"

func TestX(t *testing.T) {
}
-- pkgs/a/a.go --
package a
-- pkgs/a/a_test.go --
package a_test

import "testing"

func TestA(t *testing.T) {
}

0 comments on commit 2cdb2ec

Please sign in to comment.