Skip to content
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

Allow setting (at least some) command-line options with DOCTEST_... macros #801

Open
xparq opened this issue Sep 2, 2023 · 0 comments
Open

Comments

@xparq
Copy link

xparq commented Sep 2, 2023

Description

It would be super useful if we could bake option defaults (different from the shipped ones) into the executables.

For example: now that e.g. --no-intro has been implemented (#181, #245, #342), we can nicely disable it, but only by adding the relevant command-line option at run-time.

During the set-up period of projects (or indefinitely, for smaller ones), when there are no (stable) automation scripts, or in case of every random, ad-hoc manual run of executables directly (which happens a lot, actually), typing extra command-line options to change options is tedious, especially repetitively. (You know there's this uncanny-valley-like gap for this, when a command is repetitive enough to be frustrating, but not repetitive enough to actually write a script for it. :) )

If the options could also be controlled by #defines (e.g. DOCTEST_SET_<option-name>, matching the command-line option names), you could simply set them once and for all right in the source, e.g. where you also set DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN etc. anyway, and be done with it for any given module or project.

No need to support each, all at once, but at least some, gradually. For me (and I think others), the most important would be (unsurprisingly) DOCTEST_SET_NO_INTRO, to always save those extra lines of the output (as we typically only need it when encountering doctest the first time, and then not ever after).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant