From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#9803: [PATCH] Add ERT option to skip test Date: Sat, 19 Oct 2013 08:44:14 +0200 Message-ID: <87li1p220x.fsf@gmx.de> References: <87vc0usnrj.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382165118 11749 80.91.229.3 (19 Oct 2013 06:45:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Oct 2013 06:45:18 +0000 (UTC) Cc: 9803@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 19 08:45:18 2013 Return-path: Envelope-to: geb-bug-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 1VXQHm-0004qF-E6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2013 08:45:18 +0200 Original-Received: from localhost ([::1]:60517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXQHm-0005R4-3a for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2013 02:45:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXQHd-0005Qm-OB for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 02:45:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXQHX-00031Q-T3 for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 02:45:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXQHX-000307-Oi for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 02:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VXQHW-0008BT-KF for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 02:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2013 06:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9803 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9803-submit@debbugs.gnu.org id=B9803.138216506731401 (code B ref 9803); Sat, 19 Oct 2013 06:45:02 +0000 Original-Received: (at 9803) by debbugs.gnu.org; 19 Oct 2013 06:44:27 +0000 Original-Received: from localhost ([127.0.0.1]:57574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXQGx-0008AN-30 for submit@debbugs.gnu.org; Sat, 19 Oct 2013 02:44:27 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:59853) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXQGt-0008A8-1E for 9803@debbugs.gnu.org; Sat, 19 Oct 2013 02:44:24 -0400 Original-Received: from detlef.gmx.de ([93.202.48.191]) by mail.gmx.com (mrgmx001) with ESMTPS (Nemesis) id 0M4nt7-1VxDUj0X9h-00ywrW for <9803@debbugs.gnu.org>; Sat, 19 Oct 2013 08:44:16 +0200 In-Reply-To: (Glenn Morris's message of "Fri, 18 Oct 2013 21:02:45 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:FNIZx8P+vgPWcSm5ouJbTYmX0/4FhZwScqD/J77/Qnsp1JN9/lP IjjpDUsZHu+LHEndfwfihxq1gKeW5wtFx1PcTfUwQcGyECaEaATafKuNX5Dsh8m9w4LQug0 LRgYRfA5s6P9qzJKMrsM0UD9nKawQCacdiuyWFYxpjWldEh5KoRltRXJPqBaTMKDOOwNQp2 X50AErAhYnEtKc+LE2cog== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79384 Archived-At: Glenn Morris writes: > Thank you, looks nice. > Your method is not quite how I imagined it working, but maybe your way is > better, I haven't thought about it much... With your approach, it seems > like I have to specify the skip condition twice? Eg I have to write: > > (ert-deftest foo-test () > "Test for foo." > :expected-result (if (executable-find "foo") :passed :skipped) > (skip-if (not (executable-find "foo"))) > t ; in a real use case, some test using "foo" here > ) > > rather than: > > (ert-deftest foo-test () > "Test for foo." > :skip (not (executable-find "foo")) > t) No. The idea is that skip-if works whatever you have defined in :expected-result. It simply ignores :expected-result, when it finds a non-nil form. > Also, ert-run-tests-batch-and-exit seems to need updating: > > Running 1 tests (2013-10-18 17:49:11-0700) > skipped 1/1 foo-test > > Ran 1 tests, 0 results as expected (2013-10-18 17:49:11-0700) > > I don't think "0 results as expected" is appropriate. Will check. I've tested the interactive call so far. Best regards, Michael.