From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lowell Gilbert Newsgroups: gmane.emacs.help Subject: Re: calling ert from a script Date: Wed, 17 Apr 2013 10:52:08 -0400 Organization: A noiseless patient Spider Message-ID: <4461zltdk7.fsf@lowell-desk.lan> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366214985 22604 80.91.229.3 (17 Apr 2013 16:09:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Apr 2013 16:09:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 17 18:09:50 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USUvd-0006Nz-Ag for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Apr 2013 18:09:49 +0200 Original-Received: from localhost ([::1]:46814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USUvc-0003nj-Rq for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Apr 2013 12:09:48 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Injection-Info: mx05.eternal-september.org; posting-host="987c50db848b35afff7deb022985ba62"; logging-data="14753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qAFWesJYdeuCOEvPgK/9I" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Cancel-Lock: sha1:rZgCVrwuAWbJxT2iheTwXP08gLM= sha1:53+7CzkYKEr5zpuK3nPsd/EhPrE= Original-Xref: usenet.stanford.edu gnu.emacs.help:197939 X-Mailman-Approved-At: Wed, 17 Apr 2013 12:09:38 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90209 Archived-At: Richard H Lee 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.