fix #10731 ; runnableExamples "-b:cpp --run:off": code
works
#14384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rdoccmd
to runnableExamples (bringing feature parity with the rst code block nim)example
more examples
see tests in tests/nimdoc/trunnableexamples.nim
features
plays well with
--doccmd:cmd
:--doccmd:cmd
(if passed) is appended (not prepended) to rdoccmd so that we can override a test via cmdline; it'd be easy to add a prepend option if ever needed.runnableExamples are grouped by unique
rdoccmd
so that we maintain the "megatest" speed advantages introduced in 5fc78d8fixes runnableExamples that are only compiled #10731 as a special case: simply write:
workaround
if false:
was not good enoughit's uglier, eg:
and doesn't work in many cases as a replacement for
compile but not run
:-d:cpp --threads
, or--compileOnly
, etc.bottom line: this makes it simple to have self contained examples in a single file, even if individual examples need different cmdline options