Just-run-the-unittests

2014-03-16 Thread Sergei Nosov
Hi! Suppose I have a small .d script that has a main. Is there any simple way to just run the unit tests without running main at all? I thought -main switch was intended for this, but apparently it works only if there's no main defined at all, otherwise, it issues a double main definition

Re: Just-run-the-unittests

2014-03-16 Thread safety0ff
On Sunday, 16 March 2014 at 07:59:33 UTC, Sergei Nosov wrote: Hi! Suppose I have a small .d script that has a main. Is there any simple way to just run the unit tests without running main at all? Here's the first thing that came to mind: If you never want to both unit tests and regular

Re: Just-run-the-unittests

2014-03-16 Thread Sergei Nosov
On Sunday, 16 March 2014 at 08:22:04 UTC, safety0ff wrote: On Sunday, 16 March 2014 at 07:59:33 UTC, Sergei Nosov wrote: Hi! Suppose I have a small .d script that has a main. Is there any simple way to just run the unit tests without running main at all? Here's the first thing that came to

Re: Just-run-the-unittests

2014-03-16 Thread Andrej Mitrovic
On 3/16/14, Sergei Nosov sergei.no...@gmail.com wrote: Thx! That's better, but I think -main switch could be made to work like 'add or replace main by stub' instead of just 'add'. I don't think it'll hurt anybody, what do you think? It can't work, because main could be stored in a pre-built

Re: Just-run-the-unittests

2014-03-16 Thread Rikki Cattermole
On Sunday, 16 March 2014 at 10:15:00 UTC, Andrej Mitrovic wrote: It can't work, because main could be stored in a pre-built object or static library that's passed to DMD. Hmm I really should consider making a DIP for a deferred CTFE block. Could really come in handy for a situation like

Re: Just-run-the-unittests

2014-03-16 Thread Dicebot
On Sunday, 16 March 2014 at 12:57:04 UTC, Rikki Cattermole wrote: On Sunday, 16 March 2014 at 10:15:00 UTC, Andrej Mitrovic wrote: It can't work, because main could be stored in a pre-built object or static library that's passed to DMD. Hmm I really should consider making a DIP for a

Re: Just-run-the-unittests

2014-03-16 Thread Rikki Cattermole
On Sunday, 16 March 2014 at 20:22:15 UTC, Dicebot wrote: On Sunday, 16 March 2014 at 12:57:04 UTC, Rikki Cattermole wrote: On Sunday, 16 March 2014 at 10:15:00 UTC, Andrej Mitrovic wrote: It can't work, because main could be stored in a pre-built object or static library that's passed to DMD.