How to iterate through all modules for use with the new getUnitTests trait?
Jacob Carlborg
doob at me.com
Thu Nov 7 00:38:01 PST 2013
On 2013-11-06 23:33, Gary Willoughby wrote:
> foreach (module_; ModuleInfo)
> {
> auto func = module_.unitTest;
> func(); // run tests;
> }
>
> The above code retrieves all of the current project's modules and then
> grabs each module's unit test blocks. The only trouble is that the
> module's unit tests are kinda rolled into one function as show by the
> 'func' variable above. It would be nice to do this but get each
> individual unit test instead of dealing with these rolled up versions.
See my reply to Dicebot:
http://forum.dlang.org/thread/ewtbainwyxxyaqwhfwmw@forum.dlang.org#post-l5fjfe:242nvb:241:40digitalmars.com
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list