Improved diff-based failure reports from the test suite

Carl Worth cworth at cworth.org
Thu Apr 22 14:14:31 PDT 2010


On Fri, 16 Apr 2010 10:17:15 +0200, Michal Sojka <sojkam1 at fel.cvut.cz> wrote:
> It's definitely better than before. The current implementation of
> pass_if_equal has IMHO one drawback - if it compares multiline text and
> there is a difference, it is quite hard to see where.
> 
> In my tests for maildir synchronization I use this approach:
> 
>   notmuch search tag:inbox | filter_output > actual &&
>   diff -u - actual <<EOF
>   thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; test message 3 (inbox)
>   EOF
> 
> Thanks to the usee of diff, I immediately see only the differences.

I just added a very long multi-line test to the test suite.

So I took the opportunity to fix it to output the failures with diff. It
also saves both the complete expected and actual output (for any failed
tests) to files of the form test-XXX.expected and test-XXX.output.

Enjoy!

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100422/0ba22012/attachment.pgp>


More information about the notmuch mailing list