aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Hartland <steven.hartland@multiplay.co.uk>2017-03-27 13:28:19 +0000
committerRob Pike <r@golang.org>2017-05-22 19:31:43 +0000
commitf6f1daa4b807f1164da67c96dc8b07ee84731b52 (patch)
tree17a34d771184377a6fe1d3674cc77c75fcea99a2 /src
parentc5e8ec5b6dc63de087d93d96dc06cb3de6842ec4 (diff)
downloadgo-f6f1daa4b807f1164da67c96dc8b07ee84731b52.tar.xz
cmd/go: Document that -cover causes incorrect line numbers
Due to the fact that -cover injects additional code to the original source, tests run with -cover will often have incorrect line numbers. Also includes docs for -list regexp missed by ba8ff87 Updates #6329 Change-Id: I87f0618ac31e96071bca61055cc17c0cbdee208a Reviewed-on: https://go-review.googlesource.com/38640 Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/alldocs.go8
-rw-r--r--src/cmd/go/internal/test/test.go3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index f52d8d2a44..6a2f35d39b 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1437,6 +1437,9 @@
// -cover
// Enable coverage analysis.
//
+// BUG: If a compilation or test fails with coverage enabled,
+// the reported line numbers may be incorrect.
+//
// -covermode set,count,atomic
// Set the mode for coverage analysis for the package[s]
// being tested. The default is "set" unless -race is enabled,
@@ -1459,6 +1462,11 @@
// benchmarks should be executed. The default is the current value
// of GOMAXPROCS.
//
+// -list regexp
+// List tests, benchmarks, or examples matching the regular expression.
+// No tests, benchmarks or examples will be run. This will only
+// list top-level tests. No subtest or subbenchmarks will be shown.
+//
// -parallel n
// Allow parallel execution of test functions that call t.Parallel.
// The value of this flag is the maximum number of tests to run
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go
index aae3af4080..f362984d29 100644
--- a/src/cmd/go/internal/test/test.go
+++ b/src/cmd/go/internal/test/test.go
@@ -162,6 +162,9 @@ const testFlag2 = `
-cover
Enable coverage analysis.
+ BUG: If a compilation or test fails with coverage enabled,
+ the reported line numbers may be incorrect.
+
-covermode set,count,atomic
Set the mode for coverage analysis for the package[s]
being tested. The default is "set" unless -race is enabled,