A proposal for better template constraint error reporting.
Jonathan M Davis
jmdavisProg at gmx.com
Wed Oct 26 11:51:24 PDT 2011
On Wednesday, October 26, 2011 11:38 Jonny Dee wrote:
> I'd prefer this approach, too. For the following reason. I don't know if
> you know GoogleTest library [1] for C++. There you define unittests with
> symbols as names, too. And if you want to run your test suite you can
> filter the set of test cases to be executed by providing wildcard
> filters as command line parameters. It's really a nice feature. But OTOH
> having a more explanatory comment is also a nice thing. Maybe one could
> consider both approaches?
Having named unittest blocks opens up a number of possibilities for improving
how unit tests are run, though obviously other improvements would have to be
made to druntime to enable them. The use case that always comes to my mind is
how you can tell eclipse to run a specific unit test with JUnit rather than
telling it to run all of them (though I think that it may still run all of the
prior tests in the file in case that affects the result). For large test
suites, that could be quite valuable. So, a number of improvements like that
could theoretically be done once we have name unittest blocks.
The biggest benefit though IMHO is simply that stack traces for exceptions
that escape unittest blocks would clearly indicate _which_ unittest block the
exception escaped from.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list