dmd -unittest=<pattern> (same syntax as -i)
Steven Schveighoffer
schveiguy at yahoo.com
Fri Mar 16 15:40:18 UTC 2018
On 3/16/18 10:32 AM, Dejan Lekic wrote:
> On Wednesday, 14 March 2018 at 22:04:50 UTC, Adam D. Ruppe wrote:
>> On Wednesday, 14 March 2018 at 21:22:01 UTC, Timothee Cour wrote:
>>> would a PR for `dmd -unittest=<pattern> (same syntax as -i)` be welcome?
>>
>> so when this came up on irc earlier (was that you?) this was the first
>> thought that came to my mind. I'd support it, tho I'm no decision maker.
>
> I guess it was me talking about it two days ago on IRC...
>
> Almost exclusively I need to run unittests only in the module I
> currently work on and it really makes no sense to run other unittests at
> that point of time (unless I explicitly want to). I would even go
> further to say that we basically need to be able to run particular
> unittest.
>
> What I do at the moment is that I developed this kind of practice to
> have a test_runner.d top-level module in every D project of mine that
> contains tests I do during the development of particular feature TDD
> style, and then once I am done, I move this code to appropriate unittest
> blocks in my final module...
>
> There are bunch of issues with existing support for unittests that could
> be solved to make unit-testing a really pleasant activity.
You can do most of this via custom unit test handlers[1]. We could
potentially add more features to unit testing in druntime, but the more
we add, the more complex the code gets.
-Steve
[1]
https://dlang.org/phobos/core_runtime.html#.Runtime.extendedModuleUnitTester
More information about the Digitalmars-d
mailing list