How to iterate through all modules for use with the new getUnitTests trait?

Gary Willoughby dev at nomad.so
Wed Nov 6 11:31:33 PST 2013


As part of developing the DUnit framework i'm looking into 
executing the unit test at a more fine grain level. The new 
'getUnitTests' trait looks interesting but it's value is a symbol 
of an aggregate (e.g. struct/class/module).

	foreach (module_; ModuleInfo)
	{
		if (module_)
		{
			foreach (unitTest; __traits(getUnitTests, module_.name))
			{
				...
			}
		}
			
	}

Obviously the 'module_.name' property doesn't work in this 
scenario so i wondered how can i iterate through the all of the 
compiling modules to make this code work?


More information about the Digitalmars-d-learn mailing list