You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: The test binaries should not ignore arguments after the first unrecognized one, but only after --.
I built a test binary instrumented for code coverage.
I used the command go test -coverpkg=./... ./cmd -c -o experiment for building it.
I ran ./experiment some_argument -test.coverprofile=coverage.txt
=> No coverage.txt is generated
I ran ./experiment -test.coverprofile=coverage.txt some_argument
=> coverage.txt is generated as expected
The complete test, along with a more verbose description of my use case (integration tests with coverage reports integrated into a CI) is available in this Github repository.
The text was updated successfully, but these errors were encountered:
I see, it comes from the package, hence why looking that the command documentation didn't yield any result. It's a rather odd behavior IMHO, but since it works as intended and is documented...
What version of Go are you using (
go version
)?go version go1.10.3 darwin/amd64
Also tested on linux/amd64 with 1.10.3 and 1.9.0
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Irrelevant, but:
What did you do / expect to see / see instead?
TL;DR: The test binaries should not ignore arguments after the first unrecognized one, but only after
--
.I built a test binary instrumented for code coverage.
I used the command
go test -coverpkg=./... ./cmd -c -o experiment
for building it.I ran
./experiment some_argument -test.coverprofile=coverage.txt
=> No
coverage.txt
is generatedI ran
./experiment -test.coverprofile=coverage.txt some_argument
=>
coverage.txt
is generated as expectedThe complete test, along with a more verbose description of my use case (integration tests with coverage reports integrated into a CI) is available in this Github repository.
The text was updated successfully, but these errors were encountered: