Commit Graph

7 Commits

Author SHA1 Message Date
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
Daniel Martí
e4b58b1452 reduce unnecessary std imports in tests
Since we have to recompile all dependencies, this reduces a substantial
amount of work, reducing 'go test -short' time from ~16s to ~12s on my
laptop.
2020-05-25 22:07:41 +01:00
Daniel Martí
19e4c098cd make selection of packages configurable via GOPRIVATE
Carefully select a default that will do the right thing when inside a
module, as well as when building ad-hoc packages.

This means we no longer need to look at the compiler's -std flag, which
is nice.

Also replace foo.com/ with test/, as per golang/go#37641.

Fixes #7.
2020-04-28 21:42:39 +01:00
Daniel Martí
53272a1eda do less work in 'go test -short'
Only reduces the approximate elapsed time on my laptop from 7.8s to
7.5s, but that's still a win.
2020-04-04 20:48:46 +01:00
Daniel Martí
308e984293 don't use regexes when searching binaries for strings
This is a bit simpler, and saves us a small amount of CPU work in the
tests.
2020-02-23 12:57:39 +01:00
Daniel Martí
e08dd99c1e introduce a binary grep command for the tests
The problem with the "grep" built-in command is that it prints the
entire data if there is an error. We don't want megabytes of binary
output for a test.
2019-12-09 12:21:48 +00:00
Daniel Martí
3f35fb07f2 remove module info from the resulting binary 2019-12-08 21:32:37 +00:00