How do I diagnose test errors?

Paul Moore p.f.moore at gmail.com
Thu Jun 5 07:26:39 UTC 2008


2008/6/5 Dirkjan Ochtman <dirkjan at ochtman.nl>:
> In general, I think hg reports adds whenever the added file isn't explicitly
> named. So bare hg add will report adds, and hg ci -A does too, for example. hg
> add file will not report, but hg add dir will. (This is from memory, I think
> this is roughly how it works).

OK, thanks. That is what I thought. My odd case may be something to do
with my changes altering how exact matches on filenames look. I can't
see how, but I'll check.

> As for finding out where exactly the error comes from, you're correct that this
> is not always easy to find out. The best you can do is litter the test code with
> echo % lines (at least this is how many other tests do it, and how I've done it
> in the past) making clear in the output where you are. See my recent
> test-mq-strip for an example.

That's what I thought... I hadn't thought of adding echo lines like
this. I'm a little scared of this type of "exact output match" test
approach, it seems too easy to break so I avoid touching things (it's
irrational I know...) I'll try that.

By the way, is there a way to run a single test on its own (under
Windows, I guess on Unix you can just run the script manually), so
that I don't have to wait the 2-3 hours for the test suite to run?

> Patches adding more such echo statements in tests
> that have few of them are very welcome, as far as I'm concerned.
>
> Perhaps splitting up some of the larger tests also wouldn't be such a bad idea,
> so if you find any of these, be sure to discuss it.

OK, I'll think about this. I also have ideas on how I can change some
of the tests to use doctest or unittest (without altering the
whole-operation testing approach, just to make it easier to run them
on Windows without special support), I might look at the whole area of
testing next, once the case folding changes are OK. But I won't mess
with anything without discussing it.

Thanks,
Paul.



More information about the Mercurial-devel mailing list