[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add condition-case handler to ert test runner

From: Davis Herring
Subject: Re: Add condition-case handler to ert test runner
Date: Mon, 06 May 2013 08:30:49 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110717 Lanikai/3.1.11

> My patch is to wrap a condition-case around the funcall of the actual
> test in the function ert--run-test-internal with a handler that would
> invoke the debugger upon any error. This condition-case would take
> priority over the one in ielm.

If that's what you want...

> Would it be possible to improve emacs' documentation of condition-case?
> There is only one or two sentences about the handler on the page. I had
> to trawl through eval.c to figure out how to write the correct handler.

...you may be quite right about the documentation, because...

> +          (condition-case nil
> +            (funcall (ert-test-body (ert--test-execution-info-test
> +                                     test-execution-info)))
> +            ((error debug))))))

...you surely instead want

          (condition-case nil
            (funcall (ert-test-body (ert--test-execution-info-test
            (error (debug))))))

That said, you probably shouldn't invoke the debugger programmatically
-- what if this code is being called from a loop, or in a
non-interactive Emacs?

The real question is why ERT's signals are reaching IELM if the latter
invoked the former (whose handlers should thus be innermost).


This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

[Prev in Thread] Current Thread [Next in Thread]