Subject: Re: bug#47320: Improve failure reporting in test/lisp/electrict-tests.el

From: Alan Mackenzie <[email-masked]>
Date: Tue, 23 Mar 2021 14:47:41 +0000

Hello, Michael.

On Tue, Mar 23, 2021 at 09:53:04 +0100, Michael Albinus wrote:
> Alan Mackenzie <[email-masked]> writes:

> > Hello, Emacs.

> Hi Alan,

> > My proposal is that on a test failure, this generated doc-string should
> > be output along with the other failure stuff.  It doesn't actually add
> > all that much bulk to the .log file.

> > Here is patch which does this.  If there are no objections, I will
> > commit it in a day or two.

> There is the explainer functionality in ert, see

> (info "(ert)Defining Explanation Functions")

That description is rather terse.  In fact it is incomplete - it does
not say when the explanation function gets called, nor does it say what
is done with any resulting explanation.

It looks like a explanation function needs to duplicate the test code of
the test being explained - it seems the function has no access to the
internal state of the test.

I only wish to print the extra information when there is a test failure.
Otherwise the information in electric-tests.log would be swamped by
pointless voluminous doc strings.

Or am I missing something?

> I recommend to use it, for better readability of the test code. Examples
> are in our test files.

Thanks!

> Best regards, Michael.

-- 
Alan Mackenzie (Nuremberg, Germany).