Feedback to stdout when a specific unittest is run

Steven Schveighoffer schveiguy at gmail.com
Thu Jul 23 16:30:52 UTC 2020


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


More information about the Digitalmars-d-learn mailing list