From: Richard H Lee <ricardohenrylee@gmail.com>
To: emacs-devel@gnu.org
Subject: ielm interfering with ert test signalling
Date: Sun, 21 Apr 2013 00:19:21 +0100 [thread overview]
Message-ID: <51732279.90605@gmail.com> (raw)
I seem to have encountered a problem with running ert from ielm.
When running ert from M-x ert or from the scratch buffer (ert t) , if
ert encounters an failing test, it will fail that test and carry on with
the other tests. However when running (ert t) from ielm, when a failing
test is reached, all testing is aborted and no more tests are carried out.
This can be reproduced by declaring a failing test .e.g. :
(ert-deftest mytest () (should nil))
and running (ert t) from ielm or *scratch* or M-x ert RET RET .
When ert aborts from ielm it gives the error:
*** Eval error *** Test failed: ((should nil) :form nil :value nil)
The way ert works is that, when running tests it sets up an environment
with a debugger that catches all signals and errors. This is done in the
function ert--run-test-internal , where the debugger is set up to call
ert--run-test-debugger, passing on some extra test data. The various
"should" macros are then executed in these environments and the result
of them raises various signals depending on the outcome of the test.
These signals are trapped and interpreted by the debugger and result is
recorded against the test.
This is what is supposed to happen and happens when you run (ert t) in
*scratch* or M-x ert RET RET .
But when running (ert t) in ielm, what happens is that the signal from
the "should" macro get trapped by ielm rather than ert's debugger. Hence
ert interprets the initial fallback test result which is "test aborted".
You can see it catches the signal raised by "should" by running (should
nil) in ielm. It will give the exact same eval error as above. Also by
setting a flag (print or breakpoint) in ert--run-test-debugger , you can
see that it gets hit from *scratch* or M-x ert , but not from ielm.
I even dumped the bound value of debugger in all 3 cases and it was
correctly set to ert's debugger.
What I would like to know is that what is different in ielm's
environment that causes it to intercept the signals to ert's debugger?
reply other threads:[~2013-04-20 23:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51732279.90605@gmail.com \
--to=ricardohenrylee@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).