Bug 1952 – Support a unit test handler

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2008-03-26T19:42:00Z
Last change time
2015-06-09T01:31:20Z
Assigned to
nobody
Creator
jason.james.house

Comments

Comment #0 by jason.james.house — 2008-03-26T19:42:55Z
I'd like to see a way for the D language to push unit test handling into an external library. If a unit test is treated as a delegate, it can then boil down to a single call to a unit test handler. I'd suggest using any args of the unit test to be arguments into whatever unit test handler exists. This would allow use of special libraries built to leverage an already existing unit testing framework. Example: source: unittest("My test name"){ ... } ... causes the compiler to call: void unitTestHandler(delegate void dg(), char[])
Comment #1 by caron800 — 2008-03-27T02:19:47Z
On 27/03/2008, [email protected] <[email protected]> wrote: > I'd like to see a way for the D language to push unit test handling into an > external library. Why?
Comment #2 by jason.james.house — 2008-03-27T06:47:10Z
> Why? Simple. It allows users of D to make a lot of unit testing design decisions up front avoid code bloat inside unit tests. Should exceptions be caught? Should all tests be run? How do you handle expected failures? How do you report results? Can D be hooked up to continuous integration program X? Etc...
Comment #3 by larsivar — 2008-03-27T11:40:37Z
Janice Caron wrote: > On 27/03/2008, [email protected] <[email protected]> wrote: >> I'd like to see a way for the D language to push unit test handling into >> an external library. > > Why? Tango already has support for a such a handler, but it would be nice if this could be extended further by adding support for named unittests.
Comment #4 by code — 2014-06-09T13:52:32Z
There is runtime support to set the unittest handler now, so I'll close this. http://dlang.org/phobos/core_runtime.html#.Runtime.moduleUnitTester