-unittest and main

Bill Baxter dnewsgroup at billbaxter.com
Tue Nov 7 20:15:50 PST 2006


I find it inconvenient that -unittest doesn't automatically supply a 
main() if there isn't one.  For instance if I just want to test one 
module of my library I end up going into the code, adding "void 
main(){}" and then "dmd -unittest -run module" then go back and remove 
the "void main(){}" line.

Ideally dmd would just realize that if there's no main and I'm doing 
-unittest, it should add one for me.

Second best would be a -main flag that says 'create a trivial main for 
me' so I could say  "dmd -unittest -main -run module".

Is there some other way to do this that I'm missing?

--bb



More information about the Digitalmars-d-learn mailing list