Bug 21333 – runModuleUnitTests inner code should be available as a function

Status
NEW
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-10-20T14:21:19Z
Last change time
2024-12-07T13:40:48Z
Assigned to
No Owner
Creator
Steven Schveighoffer
Moved to GitHub: dmd#17416 →

Comments

Comment #0 by schveiguy — 2020-10-20T14:21:19Z
Currently, in order to affect the behavior of the default unit tester, you must reimplement it. In this code: https://github.com/dlang/druntime/blob/86e5cf3fa15afda116994da0c91f40aa7a5e6c6e/src/core/runtime.d#L562 If you define a default unit tester, it skips the normal running of unittests. The meat of actually running the unit tests should be abstracted into a function, such that you can call it but just affect the result (like if you don't want to run main, but you want to suppress a successful output). Simple fix, just abstract the unit test running into its own function.
Comment #1 by robert.schadek — 2024-12-07T13:40:48Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17416 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB