-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: convert TestSymlink* to the script framework
Part of converting all tests to script framework to improve test parallelism. Updates #36320 Updates #17751 Change-Id: I0696fa54184514d69c0763ac772d99b12e133eb0 Reviewed-on: https://go-review.googlesource.com/c/go/+/214288 Reviewed-by: Jay Conrod <[email protected]>
- Loading branch information
Showing
5 changed files
with
84 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[!symlink] skip | ||
|
||
mkdir $WORK/tmp/src | ||
symlink $WORK/tmp/src/dir1 -> $WORK/tmp | ||
cp p.go $WORK/tmp/src/dir1/p.go | ||
env GOPATH=$WORK/tmp | ||
go list -f '{{.Root}}' dir1 | ||
stdout '^'$WORK/tmp'$' | ||
|
||
-- p.go -- | ||
package p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[!symlink] skip | ||
|
||
mkdir $WORK/tmp/gopath/src/dir1/internal/v | ||
cp p.go $WORK/tmp/gopath/src/dir1/p.go | ||
cp v.go $WORK/tmp/gopath/src/dir1/internal/v/v.go | ||
symlink $WORK/tmp/symdir1 -> $WORK/tmp/gopath/src/dir1 | ||
env GOPATH=$WORK/tmp/gopath | ||
cd $WORK/tmp/symdir1 | ||
go list -f '{{.Root}}' . | ||
stdout '^'$WORK/tmp/gopath'$' | ||
|
||
# All of these should succeed, not die in internal-handling code. | ||
go run p.go & | ||
go build & | ||
go install & | ||
|
||
wait | ||
|
||
-- p.go -- | ||
package main | ||
|
||
import _ `dir1/internal/v` | ||
|
||
func main() {} | ||
-- v.go -- | ||
package v |
27 changes: 27 additions & 0 deletions
27
src/cmd/go/testdata/script/list_symlink_vendor_issue14054.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[!symlink] skip | ||
|
||
mkdir $WORK/tmp/gopath/src/dir1/vendor/v | ||
cp p.go $WORK/tmp/gopath/src/dir1/p.go | ||
cp v.go $WORK/tmp/gopath/src/dir1/vendor/v/v.go | ||
symlink $WORK/tmp/symdir1 -> $WORK/tmp/gopath/src/dir1 | ||
env GOPATH=$WORK/tmp/gopath | ||
cd $WORK/tmp/symdir1 | ||
|
||
go list -f '{{.Root}}' . | ||
stdout '^'$WORK/tmp/gopath'$' | ||
|
||
# All of these should succeed, not die in vendor-handling code. | ||
go run p.go & | ||
go build & | ||
go install & | ||
|
||
wait | ||
|
||
-- p.go -- | ||
package main | ||
|
||
import _ `v` | ||
|
||
func main () {} | ||
-- v.go -- | ||
package v |
20 changes: 20 additions & 0 deletions
20
src/cmd/go/testdata/script/list_symlink_vendor_issue15201.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[!symlink] skip | ||
|
||
mkdir $WORK/tmp/gopath/src/x/y/_vendor/src/x | ||
symlink $WORK/tmp/gopath/src/x/y/_vendor/src/x/y -> ../../.. | ||
mkdir $WORK/tmp/gopath/src/x/y/_vendor/src/x/y/w | ||
cp w.go $WORK/tmp/gopath/src/x/y/w/w.go | ||
symlink $WORK/tmp/gopath/src/x/y/w/vendor -> ../_vendor/src | ||
mkdir $WORK/tmp/gopath/src/x/y/_vendor/src/x/y/z | ||
cp z.go $WORK/tmp/gopath/src/x/y/z/z.go | ||
|
||
env GOPATH=$WORK/tmp/gopath/src/x/y/_vendor${:}$WORK/tmp/gopath | ||
cd $WORK/tmp/gopath/src | ||
go list ./... | ||
|
||
-- w.go -- | ||
package w | ||
|
||
import "x/y/z" | ||
-- z.go -- | ||
package z |