-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Add example how to remove doctest options from the command line for the program after the tests run #20
Comments
Well my idea was for all doctest related options to have also a prefixed version with In the case where the user wants to supply a If you have a better idea - I'm all ears. Perhaps doctest could also provide |
Depending on the commandline processor someone uses, the presence of This may not necessarily be something doctest should solve, but an example how such a case might be handled in application code would be helpful (See below). Aside: You may consider adding an option Example of application code that is shielded from the doctest options:
Edit: In Compile and run:
|
thanks! will add as an example |
mmm, before you do: there's a little snatch: because of the trailing null argument, args.size() is one higher than argc must be. Corrected:
Perhaps ok for a barebones example to show how it can be done; maybe nicer to wrap it into a class of its own (will try). |
Something like:
Compile and run:
|
… the program after the tests run - fixes #20
When test code is embedded with the application, the application code would preferably not have to deal with commandline options that belong to the test code. See example below.
Currently there seems to be no provision to only provide the application code with the non-doctest options.
Compile and run:
The text was updated successfully, but these errors were encountered: