Thoughts about unittest run order

H. S. Teoh hsteoh at quickfur.ath.cx
Tue May 7 17:22:05 UTC 2019


On Tue, May 07, 2019 at 08:49:15AM +0000, John Colvin via Digitalmars-d wrote:
> On Monday, 6 May 2019 at 18:13:37 UTC, H. S. Teoh wrote:
> > In theory, the order in which unittests are run ought to be
> > irrelevant.  In practice, however, the order can either make
> > debugging code changes quite easy, or very frustrating.
> > [...]
> 
> Use a test runner that runs all the tests regardless of previous
> errors?  (and does them in multiple threads, hooray!)

That's certainly one way to go about it.

But perhaps what I'm really looking for is a way to invoke a *specific*
unittest (probably identified by starting line number, just like what
dmd does to mangle unittests), so that I can iterate on a specific
problem case until it's fixed before running through all the tests
again.


> https://github.com/atilaneves/unit-threaded
> 
> Then you'll at least get to know everything that failed instead of
> just whatever happened to be lexically first.
> 
> I agree that some ordering system might improve the
> time-to-narrow-down-bug-location a bit, but the above might be
> acceptable nonetheless.

Yeah, not aborting immediately upon test failure would help a lot in
this respect.


T

-- 
"If you're arguing, you're losing." -- Mike Thomas


More information about the Digitalmars-d mailing list