rillig / gobco

Measure branch coverage of golang tests
62 stars 12 forks source link

Improvements to command line interface #25

Open KantarBruceAdams opened 2 years ago

KantarBruceAdams commented 2 years ago

Re: https://github.com/rillig/gobco/issues/23#issuecomment-975886652 "It looks a bit strange to have these options interleaved with -test, but I didn't see any better way to avoid all the quoting and escaping issues when passing command line arguments."

May I suggest using -- with the standard unix convention to mean end of options. So that:

gobco -test -test.v -verbose -test -test.count -test 5 -test -check.vv

Would become

gobco -verbose -- -test.v -test.count 5 -check.vv

That is you are required to give gobco options before options to go test

The -keep option is less useful without a way to set the location of the temporary directory. I would like to suggest a -workspace option or similar.

I note a gradual build up of gobco directories in /tmp (as per https://github.com/rillig/gobco/issues/9 ). I am not using the -keep option but using a new -workspace option I could guarantee my build doesn't cause this. I'm not sure yet if these are produced when the tests fail or when I press ctrl-C to abort them or both or something else. You possibly need to add a signal handler to clean things up before the program exits.