mirror of
https://github.com/burrowers/garble.git
synced 2025-12-24 12:58:05 +08:00
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'.
33 lines
527 B
Plaintext
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
|