Files
garble/testdata/scripts/modinfo.txt
Daniel Martí 511779d8ff testdata: set GOPRIVATE in all but two tests (#104)
basic.txt just builds main.go without a module. Similarly, we leave
imports.txt without a GOPRIVATE, to test the 'go list -m' fallback.

For all other tests, explicitly set GOPRIVATE, to avoid two exec calls -
both 'go env GOPRIVATE' as well as 'go list -m'. Each of those calls
takes in the order of 10ms, so saving ~26 exec calls should easily add
to 200-300ms saved from 'go test -short'.
2020-08-20 11:51:55 +02:00

33 lines
527 B
Plaintext

env GOPRIVATE=test/main
garble build
exec ./main
cmp stderr main.stderr
! binsubstr main$exe '(devel)'
[short] stop # no need to verify this with -short
exec go build
exec ./main
cmp stderr main.stderr-orig
binsubstr main$exe '(devel)'
-- go.mod --
module test/main
-- main.go --
package main
import "runtime/debug"
func main() {
if info, ok := debug.ReadBuildInfo(); ok {
println("version", info.Main.Version)
} else {
println("no version")
}
}
-- main.stderr-orig --
version (devel)
-- main.stderr --
no version