Running all unittests in gdc

Jim Burnes jvburnes at gmail.com
Tue Jul 22 08:33:28 PDT 2008


Hi,

I'm in the middle of building a mid-size application in D and have been conscientious about building unittests in all of my classes.

The main() module as well as all component modules have been built with -funittest.   I know that unittests are run before main() starts, but my problem is that gdc is only running the unittests that appear in the main() module and not those that are linked in from supporting object modules.

Is there a way to enable the unittests that are linked into main()?

The crazy thing is that my main module contains no class definitions so no unittests are actually being run.  I verified  this in gdc by creating a small class definiton with built-in unittest.

I can, of course, cruft up a dummy "void main()" in each of the component modules, but that's pretty ugly.  

(BTW: I've seen some of the utilities that run all unittests, but I'm hoping there's a better solution.)

Any help greatly appreciated.

Thanks,

Jim Burnes
Boulder, CO




More information about the Digitalmars-d mailing list