On Thursday, 2 April 2015 at 06:33:50 UTC, Jacob Carlborg wrote:
On 2015-04-01 21:18, Kapps wrote:
The only issue I have with the way unittests are done right
now, is the
incredibly annoying requirement of having a main function and
that main
gets called. It makes generic tooling and CI systems much more
annoying,
as you have to try and guess whether you need to create a fake
main()
(or pass in -main), and worry about if the code is going to
keep running
after tests complete.
I just don't compile the module congaing the main function.
Although I place the my tests in a completely separate
directory.
Which is okay for running your own code, but the problem is it's
not really a good solution for a CI system. I made a plugin for
Bamboo to automatically test my dub projects, and essentially
just rely on the fact that 'dub test' works. Without that, I
would have no way of knowing whether or not there's a main
function, whether or not that main function actually does
something, etc. Being able to prevent main from being required
and running is, for me, the biggest issue with the current
unittest system.