New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test options do not work for compiled binaries #533
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Godog.BindCommandLineFlags in init does not work for binaries
When using test flags like
-coverprofile
they are not honored when trying a godog application which has been created bygo test -c ... -o ...
happy case
Using the a test as suggested by the README:
Running this directly is working:
Running the compiled variant:
Notice that the help file does not show any
--test.coverprofile
as suggestion.✨ Do you have a proposal for making it better?
It seems not having
godog.BindCommandLineFlags("godog.", &opts)
in ainit()
function and placing it just beforepflag.Parse()
is enough. And seems to work for test binaries as well as with directly rango test
applicationsContinuing with the code given above
Rerunning:
Still not working, though notice the added
--test-....
options now.Simply using
--test.coverprofile
now works:📚 Any additional context?
I'm unsure if there was a good reason to have the above line in the
init()
in the first place (?)This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: