Instead of writing replace directives to link the test's modules together, fill a GOPROXY dir and use `go mod download` to fill a real GOCACHE with them. This makes the tests more realistic, since replace directives will be somewhat unusual. It also gives the name= query something to search. Actually doing this in a way that's compatible with packagestest's abstraction is a little tricky, since it wants to know where the files will be. The actual files will be created by go mod download, so we have to get Export to put them there to begin with, then move them out of the way. Since the GOPROXY zip format doesn't support symlinks, those will only work in the primary module. Change-Id: I6bc1d368f1c950d789e409213107d60bb1389802 Reviewed-on: https://go-review.googlesource.com/c/144498 Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com> |
||
|---|---|---|
| .. | ||
| gopackages | ||
| packagestest | ||
| testdata | ||
| doc.go | ||
| example_test.go | ||
| external.go | ||
| golist.go | ||
| golist_fallback.go | ||
| golist_fallback_testmain.go | ||
| packages.go | ||
| packages110_test.go | ||
| packages_test.go | ||
| packagescgo_test.go | ||
| stdlib_test.go | ||
| visit.go | ||