Parallel execution of unittests

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 13:09:14 PDT 2014


On Wed, 2014-04-30 at 11:19 -0700, Jonathan M Davis via Digitalmars-d
wrote:
[…]
> I disagree with this. A unit test is a test that tests a single piece
> of functionality - generally a function - and there are functions which
> have to access the file system or network. And those tests are done in

These are integration/system tests not unit tests. For unit tests
network activity should be mocked out.

> unittest blocks just like any other unit test. I would very much
> consider std.file's tests to be unit tests. But even if you don't
> want to call them unit tests, because they access the file system, the
> reality of the matter is that tests like them are going to be run in
> unittest blocks, and we have to take that into account when we decide
> how we want unittest blocks to be run (e.g. whether they're
> parallelizable or not).

In which case D is wrong to allow them in the unittest blocks and should
introduce a new way of handling these tests. And even then all tests can
and should be parallelized. If they cannot be then there is an
inappropriate dependency.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d mailing list