Skip to content

Commit

Permalink
cmd/go: convert TestGoGenerateBadImports 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: Id1afafad2063d917fd55e08f0725ce3e93201c35
Reviewed-on: https://go-review.googlesource.com/c/go/+/212878
Run-TryBot: Michael Matloob <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
matloob committed Jan 6, 2020
1 parent cf7a46c commit e8729a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
14 changes: 0 additions & 14 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2738,20 +2738,6 @@ func TestGoGenerateXTestPkgName(t *testing.T) {
}
}

func TestGoGenerateBadImports(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("skipping because windows has no echo command")
}

// This package has an invalid import causing an import cycle,
// but go generate is supposed to still run.
tg := testgo(t)
defer tg.cleanup()
tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
tg.run("generate", "gencycle")
tg.grepStdout("hello world", "go generate gencycle did not run generator")
}

func TestGoGetCustomDomainWildcard(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
testenv.MustHaveExecPath(t, "git")
Expand Down
11 changes: 11 additions & 0 deletions src/cmd/go/testdata/script/generate_bad_imports.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[windows] skip # skip because windows has no echo command

go generate gencycle
stdout 'hello world' # check go generate gencycle ran the generator

-- gencycle/gencycle.go --
//go:generate echo hello world

package gencycle

import _ "gencycle"
5 changes: 0 additions & 5 deletions src/cmd/go/testdata/src/gencycle/gencycle.go

This file was deleted.

0 comments on commit e8729a7

Please sign in to comment.