www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Feedback to stdout when a specific unittest is run

reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
Is it possible to activate some feedback print to stdout when a 
unittest is started and ended to track which unittests that take 
the longest to execute?

Alternatively inject a hook being run before each test is run.
Jul 23 2020
next sibling parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Thursday, 23 July 2020 at 15:10:50 UTC, Per Nordlöw wrote:
 Is it possible to activate some feedback print to stdout when a 
 unittest is started and ended to track which unittests that 
 take the longest to execute?

 Alternatively inject a hook being run before each test is run.
I found https://code.dlang.org/packages/silly Problem solved.
Jul 23 2020
prev sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 7/23/20 11:10 AM, Per Nordlöw wrote:
 Is it possible to activate some feedback print to stdout when a unittest 
 is started and ended to track which unittests that take the longest to 
 execute?
 
 Alternatively inject a hook being run before each test is run.
Yes, you can copy the code [1], and handle the unittest runtime yourself [2], putting in whatever outputs you wish. -Steve [1] https://github.com/dlang/druntime/blob/d19c70b6130d70e6d727cd573230e4519eb0ef55/src/core/runtime.d#L602-L641 [2] https://dlang.org/phobos/core_runtime.html#.Runtime.extendedModuleUnitTester
Jul 23 2020