[phobos] Recent changes in unittests
Jacob Carlborg
doob at me.com
Fri Dec 13 05:40:25 PST 2013
On 12 dec 2013, at 20:54, Andrei Alexandrescu <andrei at erdani.com> wrote:
> The thundering silence in response to my concern below is that apparently one order of magnitude slowdown in unittesting speed is not important :o).
I think it's very important that tests run as fast as possible.
> Anyhow, I posted https://github.com/D-Programming-Language/phobos/pull/1768 that attempts to make that better.
>
> However, I have to question the rationale of the entire change. I think the right way to unittest is build ONE phobos module with -unittest, link it against libphobos, and run unittest. The symbols defined in that module will override the symbols defined by that same module inside the library, and the rest of the library will be pulled in appropriately.
>
> This is exactly as unittests should be run - unittest one "unit" at a time.
With the Ruby on Rails testing framework I use at work it's possible to run all the tests, all the tests of a single file or only a single test in a file. I think all these cases are useful.
I would guess many would just invoke dmd to run the unit tests of a single file:
$ make ...
$ dmd -main -unittest -run std/algorithm.std
--
/Jacob Carlborg
More information about the phobos
mailing list