• Rob Pike's avatar
    cmd/vet: build the binary only once in the test · ebd96933
    Rob Pike authored
    Recent changes caused vet to build the binary for each Test function.
    This is wasteful and will become only more so as more tests are added.
    Use testing.Main to build only once.
    
    Verified that compilation errors still appear if the binary cannot be
    built.
    
    Before:
    	real	0m11.169s
    	user	0m18.328s
    	sys	0m2.152s
    
    After:
    	real	0m5.132s
    	user	0m9.404s
    	sys	0m1.168s
    
    Of course if the compiler were fast we might not notice, but vet is
    a big program and growing bigger all the time, as are the tests.
    
    Change-Id: I209a8fdcace94bc5cec946f5dd365d7191f44c02
    Reviewed-on: https://go-review.googlesource.com/14822Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    ebd96933
vet_test.go 3.34 KB