]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: Document that -cover causes incorrect line numbers
authorSteven Hartland <steven.hartland@multiplay.co.uk>
Mon, 27 Mar 2017 13:28:19 +0000 (13:28 +0000)
committerRob Pike <r@golang.org>
Mon, 22 May 2017 19:31:43 +0000 (19:31 +0000)
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>
src/cmd/go/alldocs.go
src/cmd/go/internal/test/test.go

index f52d8d2a442f5421c3d81cc7eb18d927d07218a4..6a2f35d39bb2dfb9ef3318f38d1854ed7f5ebac6 100644 (file)
 //     -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,
 //         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
index aae3af408076f64f34a00c1e01b4f1cae94372eb..f362984d2933af5b9aa9a7288f88149584ea17c0 100644 (file)
@@ -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,