On Thursday, 30 March 2017 at 09:04:28 UTC, ixid wrote:
On Thursday, 30 March 2017 at 06:53:47 UTC, XavierAP wrote:
I would consider this harmful... The spec already states this
about unit tests, so I'd guess the decision was taken in the
past conscientiously.
If you're worried about compilation time, you can always
define your unit tests in separate files that are included for
compilation only when needed.
Why is it harmful (actually asking, not telling you you're
wrong)? I thought we were going to use a pay for what you use
philosophy, if a unit test is not run then why is it paid for?
rjframe and Stefan have said it better than I could. I do
understand the more I think about it how people could be worried
about the downsides. Priorities depends on user cases and some
personal inclination. But with the stated arguments I would think
it's a bit of a slippery slope. And moreover for people so
concerned with compilation time there are easy clean workarounds
such as separate files. Compilers could implement something
analogous to pre-compiled headers for this case.