1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00
Commit Graph

38 Commits

Author SHA1 Message Date
Rob Pike
b042505490 go.tools/cmd/vet: use types.Eval to simplify some checking.
Depends on CL 10748044

R=gri
CC=golang-dev
https://golang.org/cl/11206043
2013-07-13 07:52:00 +10:00
Rob Pike
1c382c95b2 go.tools/cmd/cover: get cover counters on if conditions
This requires a little more tree rewriting to put a block around the if of an "else if".
More tests too.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11042045
2013-07-10 15:20:52 +10:00
Andrew Gerrand
5b27bc1db9 go.talks/cmd/cover: show simpler legend for "set" mode
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10738044
2013-07-10 14:03:35 +10:00
Andrew Gerrand
c659fcb7c8 go.tools/cmd/cover: add floating bar with file selector and legend
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11076043
2013-07-10 13:22:04 +10:00
Andrew Gerrand
2b6515094c go.talks/cmd/cover: better color scheme and fonts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11032043
2013-07-09 16:58:15 +10:00
Andrew Gerrand
a82eaff6b7 go.tools/cmd/cover: change color scheme and add legend
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/10991043
2013-07-08 15:24:34 +10:00
Andrew Gerrand
00268482c0 go.tools/cmd/cover: use html/template for html generation
Also includes simple JavaScript dropdown picker.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10838045
2013-07-06 16:58:50 +10:00
Andrew Gerrand
d9e6cbb135 go.tools/cmd/cover: use a gradient to colorize "count" profiles
R=r
CC=golang-dev
https://golang.org/cl/10858047
2013-07-05 13:53:09 +10:00
Andrew Gerrand
98e8131132 go.tools/cmd/vet: add image.Uniform to untagged literal white list
R=nigeltao
CC=golang-dev
https://golang.org/cl/10817043
2013-07-01 12:42:08 +10:00
Rob Pike
78efac5f33 go.tools/cmd/cover: yet another attempt at a usage message (YAAAAUM) for go tool cover
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10710044
2013-06-27 14:48:27 -07:00
Rob Pike
b52f745c3a go.tools/cmd/cover: delete TODO that is NOWDONE
R=adg
CC=golang-dev
https://golang.org/cl/10505044
2013-06-27 09:20:34 -07:00
Rob Pike
6740bb0838 go.tools/cmd/vet: delete the word "only" from a warning
No semantic change.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/10516043
2013-06-24 12:56:35 -07:00
Rob Pike
40caf1ff72 go.tools/cmd/cover: better usage message
R=adg, rsc
CC=golang-dev
https://golang.org/cl/10453044
2013-06-24 12:56:25 -07:00
Rob Pike
78d364c43e go.tools/cmd/cover: fix build
Need the ./ for the path. Quick fix to get the build green, but what really is the right answer for Windows?

R=golang-dev
CC=golang-dev
https://golang.org/cl/10359044
2013-06-21 14:47:04 -07:00
Rob Pike
c28528d489 go.tools/cmd/cover: add a test
Test the statistics work as expected for a simple program, which can be extended as needed. This is all a bit meta.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10392050
2013-06-21 14:35:09 -07:00
Rob Pike
decfd079c5 go.tools/cmd/cover: skip mode line (first line of profile)
Still to do: use the mode to affect how to present the data.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/10364050
2013-06-21 14:19:57 -07:00
Rob Pike
331c428e76 go.tools/cmd/vet: add check for shadowed variables
Experimental feature. It's too noisy yet to be enabled by default,
so it must be enabled explicitly by
        go tool vet -shadow *.go
or
        go tool vet -shadow directory
(The go command does not know about the -shadow flag.)

Fixes golang/go#5634.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/10409047
2013-06-21 11:27:53 -07:00
Rob Pike
33ae2b030f go.tools.cmd/cover: define a block to end at the closing brace rather than last statement
Makes for prettier output in many cases.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/10360049
2013-06-19 09:11:32 -07:00
Rob Pike
86c0ff156c go.tools/cmd/vet: set the package name unconditionally
A better fix than the one in CL 10400044

R=gri
CC=golang-dev
https://golang.org/cl/10376044
2013-06-18 14:12:51 -07:00
Rob Pike
ce82fb0e23 go.tools/cmd/vet: use directory for pkg.path if path is "."
Before:
        math/big/nat_test.go:688: arg r for printf verb %s of wrong type: ..Word
After:
        math/big/nat_test.go:688: arg r for printf verb %s of wrong type: big.Word

R=gri
CC=golang-dev
https://golang.org/cl/10400044
2013-06-18 14:02:01 -07:00
Rob Pike
df787c2073 go.tools/cmd/vet: check for missing printf verb
A trailing % resulted in a bad error message.
Also clean up a couple of dregs left over from the
refactoring to add indexed formats.

R=dsymonds
CC=golang-dev
https://golang.org/cl/10336044
2013-06-18 08:21:06 -07:00
Andrew Gerrand
16c6244c27 go.tools/cmd/cover: add HTML output
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/10277043
2013-06-15 08:53:10 +10:00
Rob Pike
3162ce0df2 go.tools/cmd/cover: record statements-per-block
This number will allow us to give a conventional meaning to "coverage":
the percentage of executable statements visited by the test.

R=adonovan
CC=golang-dev
https://golang.org/cl/10271045
2013-06-13 14:27:22 -07:00
Rob Pike
e330494adc go.tool/cmd/cover: use a struct instead of multiple variables
We are going to need one more piece of data, so rather than create
a third variable let's just put it all in one struct. The interface gets
easier too.

R=adonovan
CC=golang-dev
https://golang.org/cl/10271044
2013-06-13 12:50:30 -07:00
Rob Pike
0ca15cc618 go.tools/cmd/cover: add -o outputfile option
Makes it easier to get error output when run from the go tool.

R=adonovan
CC=golang-dev
https://golang.org/cl/10190043
2013-06-11 10:18:55 -07:00
Rob Pike
73612ddbfd go.tools/cmd/cover: handle empty select
Putting a coverage counter inside select{} is invalid Go.

R=adonovan
CC=golang-dev
https://golang.org/cl/10175043
2013-06-10 15:58:32 -07:00
Rob Pike
ba51e7a586 go.tools/cmd/cover: make -mode=atomic work again
It was broken by a previous simplification. The import was missing.

R=adonovan
CC=golang-dev
https://golang.org/cl/10117045
2013-06-10 10:58:08 -07:00
Rob Pike
ab78c3fa10 go.tools/cmd/cover: new tool
This is just the tool proper; stitching into "go test" will be a separate CL.
Tests are missing - they'll come once it's integrated - but it can handle,
perhaps correctly, all of src/pkg/...

The basic approach is to rewrite the source to add annotations that will
track coverage; the rewritten source must of course be compiled and
run after this tool has done its job.

R=adonovan
CC=golang-dev
https://golang.org/cl/10102043
2013-06-06 23:51:51 -07:00
Rob Pike
3402cf10ab go.tools/cmd/vet: verify printf for String and Error implementers
Fixes golang/go#5624.

R=adonovan
CC=gobot, golang-dev, gri
https://golang.org/cl/9657048
2013-06-06 16:05:14 -07:00
Rob Pike
838e9a8987 go.tools/cmd/vet: check indexed arguments in printf
Refactor the printf parser to be easier to understand.

R=gri
CC=golang-dev
https://golang.org/cl/9909043
2013-05-31 16:31:01 -04:00
Rob Pike
291b2c84b6 go.tools/cmd/vet: prepare print format checker for indexed arguments
Rewrite the checker to be more flexible and better documented, being
more explicit about parsed format vs. checked arguments.
No attempt yet to do check indexed formats; this just paves the way.
All tests still pass.

R=gri
CC=golang-dev
https://golang.org/cl/9881044
2013-05-30 14:26:22 -04:00
Rob Pike
d6c1c75eab go.tools/cmd/vet: say ./testvet instead of testvet
I bet "." is not in the default PATH.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9867043
2013-05-29 15:00:51 -04:00
Rob Pike
f91ca66179 go.tools/cmd/vet: attempt to fix build
Can't reproduce the failure outside the builder, but attempt a fix
by changing the criterion for failure: FAIL iff the output contains "BUG".

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/9798050
2013-05-29 11:28:19 -04:00
Rob Pike
2b48cfca08 cmd/vet: use length of output from errchk to check PASS/FAIL
errchk is itself a FAIL: it doesn't exit non-zero on error!

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9842044
2013-05-28 16:51:47 -04:00
Rob Pike
c7f7fa1381 cmd/vet: simplify format checker
Simplify the code a bit, get it working after recent go/types changes,
and handle "%*%" just in case. Preparation for handling argument indexing.

R=gri
CC=golang-dev
https://golang.org/cl/9747045
2013-05-28 15:37:34 -04:00
Rob Pike
bf87b9f0f5 go.tools/cmd/vet: use "go test" to test
- remove Makefile
- move test data into a subdirectory
- encapsulate the invocation of errchk into a standard Test using os.exec

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/9509045
2013-05-22 10:20:50 -07:00
Rob Pike
08cc526448 go.tools/cmd/vet: update to new go/types package
Now that it's in the same repository as the go/types package we can delete
the mechanism to build it without type checking.

Add a make rule to install it where the go tool can find it.
Why doesn't "go install" take a -o flag?

R=gri
CC=gobot, golang-dev
https://golang.org/cl/9526043
2013-05-20 12:20:05 -07:00
Rob Pike
01f8cd246d go.tools: add go/types, ssa, and cmd/vet
They will be deleted from their current homes once this has landed.
Changes made to import paths to make the code compile, and to find
errchk in the right place in cmd/vet's Makefile.
TODO in a later CL: tidy up vet.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9495043
2013-05-17 13:20:39 -07:00