Am 02.12.2013 08:32, schrieb Jacob Carlborg: > On 2013-11-30 21:48, Sönke Ludwig wrote: >> Based on the bug reports so far, I've prepared a new beta release of >> 0.9.21 for testing. Apart from fixes for the reported issues, it >> contains a revamped command line interface with detailed help for each >> command and also the new "dub test" command. >> >> http://code.dlang.org/download >> >> https://github.com/rejectedsoftware/dub/blob/master/CHANGELOG.md >> > > What exactly does "dub test" do? Is it like running "rdmd -main > -unittest foo.d"? >
It's similar. By default, for library projects, it generates a maim module of the form --- module test_main; import <library_name.main_module>; import std.stdio; import core.runtime; void main() { writeln("All unit tests were successful."); } --- and runs it with build type "unittest". It also supports setting a custom file containing main(), so that for example custom unit test runners can be specified and similar things. In this case, the generated file looks like this: --- module test_main; import <library_name.main_module>; import <custom_main_module>; --- For packages with only executable configurations it behaves the same as "dub run --build=unittest".