help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: calling ert from a script


From: Lowell Gilbert
Subject: Re: calling ert from a script
Date: Wed, 17 Apr 2013 10:52:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix)

Richard H Lee <ricardohenrylee@gmail.com> writes:

> I'm using ert for unit testing currently.
>
> I know you can call ert interactively to run all defined tests. When
> you do so tests pass and fail as expected.
>
> I have a script that clears existing tests, reloads the file under
> test and the tests themselves and then runs the tests. The way I run
> the tests is by calling (ert t) . This is the same thing that is
> called when you call ert interactively.
>
> However when I call (ert t) from a script, rather than passing and
> failing tests, it aborts at the first failure, not running any further
> tests. (And it returns with an eval error saying that the test
> failed.)
>
> Can anybody tell me why this happens?

>From the output of "C-f ert":
    ert is an alias for `ert-run-tests-interactively' in `ert.el'.

    (ert SELECTOR &optional OUTPUT-BUFFER-NAME MESSAGE-FN)

    Run the tests specified by SELECTOR and display the results in a buffer.

    SELECTOR works as described in `ert-select-tests'.
    OUTPUT-BUFFER-NAME and MESSAGE-FN should normally be nil; they
    are used for automated self-tests and specify which buffer to use
    and how to display message.

There's a whole manual for ert, but the fairly brief comments at the top
of ert.el will probably be enough for you.


reply via email to

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