-
-
Notifications
You must be signed in to change notification settings - Fork 747
Add a StdUnittest version #5927
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
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
|
Did we not have this or something very similar to this before? Am I thinking of another component? |
|
Oh, I was probably thinking of In which case maybe make the two consistent. |
|
bikesheading: any |
|
I'd say let's just "reserve" all |
Renamed to |
Great idea! |
andralex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need here a version(unittest) - the same we have for version(assert).
| import std.typecons : Ternary; | ||
| import std.typecons : tuple, Tuple; | ||
|
|
||
| version(StdUnittest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this here? I'd assume if no unittest is conducted, unittests are ignored anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From DIP82:
At present, unittest blocks inside of a templated type are compiled into every instantation, which only works with tests that are generic, which most tests aren't, and it almost never works with examples and thus doesn't work for ddoc-ed unittest blocks.
- these unittest blocks might not even be run (I have a couple of these issues during the runnable examples story)
- these unittest blocks will be executed as part of a user's testsuite
This already exists, but it's defined during a user's test run too. |
|
FYI there have been two recent pull requests for which this identifier would have been useful:
So maybe we can simply move on with this? There are many other places in Phobos which should have used |
There's still quite a bit of stuff in Phobos, that shouldn't be parsed & executed when Phobos is imported by a user who runs his tests.
For the motivation of excluding
unittestin templates, please see https://wiki.dlang.org/DIP82(I don't have any preferences on the name of this
version.)