On Saturday, 4 September 2021 at 00:09:37 UTC, H. S. Teoh wrote:
This is related to the bogonity of the current behaviour of -unittest, which compiles *all* unittests of *all* imported modules, even when you're compiling user code that has no interest in Phobos unittests.

Well, no; it compiles all unittests of all *compiled* modules, not all *imported* modules. So it does not actually include Phobos unittests.

StdUnittest is a hack introduced to suppress Phobos unittests in user programs.

The point of `StdUnittest` is to suppress

* `version (unittest)` blocks in Phobos
* Phobos unittests in the bodies of templates that are instantiated by user code

As Steven Schveighoffer [pointed out][1], Phobos unittests are never included in user code, regardless of whether `StdUnittest` is used.

[1]: https://forum.dlang.org/post/sglmk0$33m$1...@digitalmars.com

Reply via email to