Commit f6f1daa4 authored by Steven Hartland's avatar Steven Hartland Committed by Rob Pike

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 ba8ff87d

Updates #6329

Change-Id: I87f0618ac31e96071bca61055cc17c0cbdee208a
Reviewed-on: https://go-review.googlesource.com/38640Reviewed-by: default avatarRob Pike <r@golang.org>
parent c5e8ec5b
...@@ -1437,6 +1437,9 @@ ...@@ -1437,6 +1437,9 @@
// -cover // -cover
// Enable coverage analysis. // Enable coverage analysis.
// //
// BUG: If a compilation or test fails with coverage enabled,
// the reported line numbers may be incorrect.
//
// -covermode set,count,atomic // -covermode set,count,atomic
// Set the mode for coverage analysis for the package[s] // Set the mode for coverage analysis for the package[s]
// being tested. The default is "set" unless -race is enabled, // being tested. The default is "set" unless -race is enabled,
...@@ -1459,6 +1462,11 @@ ...@@ -1459,6 +1462,11 @@
// benchmarks should be executed. The default is the current value // benchmarks should be executed. The default is the current value
// of GOMAXPROCS. // 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 // -parallel n
// Allow parallel execution of test functions that call t.Parallel. // Allow parallel execution of test functions that call t.Parallel.
// The value of this flag is the maximum number of tests to run // The value of this flag is the maximum number of tests to run
......
...@@ -162,6 +162,9 @@ const testFlag2 = ` ...@@ -162,6 +162,9 @@ const testFlag2 = `
-cover -cover
Enable coverage analysis. Enable coverage analysis.
BUG: If a compilation or test fails with coverage enabled,
the reported line numbers may be incorrect.
-covermode set,count,atomic -covermode set,count,atomic
Set the mode for coverage analysis for the package[s] Set the mode for coverage analysis for the package[s]
being tested. The default is "set" unless -race is enabled, being tested. The default is "set" unless -race is enabled,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment