go/src/pkg
Russ Cox ccc4553491 cmd/go, testing: streamline direct use of test binaries
Before:

        $ go test -c -cover fmt
        $ ./fmt.test -test.covermode=set
        PASS
        coverage: 65.1% of statements in strconv
        $

After:

        $ go test -c -cover fmt
        $ ./fmt.test
        PASS
        coverage: 65.1% of statements in strconv
        $

In addition to being cumbersome, the old flag didn't make sense:
the cover mode cannot be changed after the binary has been built.

Another useful effect of this CL is that if you happen to do

        $ go test -c -covermode=atomic fmt

and then forget you did that and run benchmarks,
the final line of the output (the coverage summary) reminds you
that you are benchmarking with coverage enabled, which might
not be what you want.

        $ ./fmt.test -test.bench .
        PASS
        BenchmarkSprintfEmpty	10000000	       217 ns/op
        BenchmarkSprintfString	 2000000	       755 ns/op
        BenchmarkSprintfInt	 2000000	       774 ns/op
        BenchmarkSprintfIntInt	 1000000	      1363 ns/op
        BenchmarkSprintfPrefixedInt	 1000000	      1501 ns/op
        BenchmarkSprintfFloat	 1000000	      1257 ns/op
        BenchmarkManyArgs	  500000	      5346 ns/op
        BenchmarkScanInts	    1000	   2562402 ns/op
        BenchmarkScanRecursiveInt	     500	   3189457 ns/op
        coverage: 91.4% of statements
        $

As part of passing the new mode setting in via _testmain.go, merge
the two registration mechanisms into one extensible mechanism
(a struct).

R=r
CC=golang-dev
https://golang.org/cl/11219043
2013-07-12 20:40:30 -04:00
..
archive all: avoid leaking fds during tests 2013-06-21 11:13:14 +10:00
bufio bufio: fix SplitFunc docs 2013-05-23 04:38:32 +08:00
builtin builtin: document print and println 2013-07-09 16:20:19 -07:00
bytes runtime/bytes: fast Compare for byte arrays and strings. 2013-05-14 16:05:51 -07:00
compress compress/bzip2: don't panic on invalid input. 2013-06-24 10:59:41 -04:00
container
crypto crypto/tls: implement TLS 1.2. 2013-07-02 19:58:56 -04:00
database/sql database/sql: remove extra RemoveDep call 2013-05-21 14:58:08 -07:00
debug all: avoid leaking fds during tests 2013-06-21 11:13:14 +10:00
encoding undo CL 11161044 / ba455262a9db 2013-07-12 17:42:01 -04:00
errors
expvar
flag flag: add Getter interface; implement for all Value types 2013-06-27 15:30:45 -07:00
fmt all: excise some warts found by vet -shadow 2013-06-20 16:14:40 -07:00
go go/format: fix failing test (fix build) 2013-07-10 14:19:35 -07:00
hash hash: tweak the package docs 2013-06-24 16:53:13 -07:00
html html: add escaping tests 2013-07-10 17:31:46 +10:00
image image/draw: add the Quantizer type. 2013-07-11 15:17:32 +10:00
index/suffixarray
io io/ioutil: make WriteFile notice errors from Close() 2013-06-05 21:16:44 -07:00
log all: avoid leaking fds during tests 2013-06-21 11:13:14 +10:00
math math/big: fix Errorf verb 2013-06-18 14:16:40 -07:00
mime mime: add support for Plan 9 2013-06-04 17:30:45 -07:00
net net/rpc: fix a test bug 2013-07-11 15:55:08 -04:00
os os: rename error_posix.go to error_unix.go 2013-06-24 11:23:37 +10:00
path path/filepath: Skip TestEvalSymlinks. Plan 9 doesn't have symlinks. 2013-05-24 11:01:04 -07:00
reflect reflect: add Value.Slice3 and Value.SetCap methods, to match x[i:j:k] 2013-07-01 20:32:53 -04:00
regexp regexp: doc fix 2013-05-02 18:59:39 -07:00
runtime cmd/ld: fix large stack split for preempt check 2013-07-12 12:12:56 -04:00
sort sort: fix 32-bit build 2013-07-01 21:44:14 -04:00
strconv strconv: corrected several bad references to err.Error in doc comments. 2013-06-13 17:04:47 -07:00
strings
sync sync/atomic: remove test dependency on net/http 2013-07-01 17:27:19 -04:00
syscall syscall: implement Sendfile for Darwin. 2013-07-12 04:34:54 +08:00
testing cmd/go, testing: streamline direct use of test binaries 2013-07-12 20:40:30 -04:00
text text/template: comment fix 2013-05-03 14:22:34 -07:00
time time: find correct zone abbreviations even on non-English windows systems 2013-07-10 15:34:24 +10:00
unicode
unsafe