Skip to content

Commit

Permalink
cmd/go: convert TestIssue17119 to the script test framework
Browse files Browse the repository at this point in the history
It's already parallel, but we might as well convert it and
get rid of the testdata/src dircetory completely.

Updates #36320

Change-Id: I75e335b32d64a8ddedd65e4337949b729c9e0fbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/212877
Run-TryBot: Michael Matloob <[email protected]>
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
matloob committed Jan 6, 2020
1 parent fab2e86 commit a5cff1e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 25 deletions.
12 changes: 0 additions & 12 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3504,18 +3504,6 @@ func TestGoGetUpdateAllDoesNotTryToLoadDuplicates(t *testing.T) {
tg.grepStderrNot("duplicate loads of", "did not remove old packages from cache")
}

// Issue 17119 more duplicate load errors
func TestIssue17119(t *testing.T) {
testenv.MustHaveExternalNetwork(t)

tg := testgo(t)
defer tg.cleanup()
tg.parallel()
tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
tg.runFail("build", "dupload")
tg.grepBothNot("duplicate load|internal error", "internal error")
}

func TestBinaryOnlyPackages(t *testing.T) {
tooSlow(t)

Expand Down
24 changes: 24 additions & 0 deletions src/cmd/go/testdata/script/gopath_vendor_dup_err.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[!net] skip

# Issue 17119: Test more duplicate load errors.
! go build dupload
! stderr 'duplicate load|internal error'
stderr 'dupload/vendor/p must be imported as p'

-- dupload/dupload.go --
package main

import (
_ "dupload/p2"
_ "p"
)

func main() {}
-- dupload/p/p.go --
package p
-- dupload/p2/p2.go --
package p2

import _ "dupload/vendor/p"
-- dupload/vendor/p/p.go --
package p
8 changes: 0 additions & 8 deletions src/cmd/go/testdata/src/dupload/dupload.go

This file was deleted.

1 change: 0 additions & 1 deletion src/cmd/go/testdata/src/dupload/p/p.go

This file was deleted.

3 changes: 0 additions & 3 deletions src/cmd/go/testdata/src/dupload/p2/p2.go

This file was deleted.

1 change: 0 additions & 1 deletion src/cmd/go/testdata/src/dupload/vendor/p/p.go

This file was deleted.

0 comments on commit a5cff1e

Please sign in to comment.