November 08, 2006 -unittest and main | ||||
---|---|---|---|---|
| ||||
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 |
November 08, 2006 Re: -unittest and main | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> 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
None that I haven't missed as well. Some of us have been wanting a feature like your '-main' switch for some time now. (Or at the very least for -unittest to implicitly behave this way.)
-- Chris Nicholson-Sauls
|
Copyright © 1999-2021 by the D Language Foundation