From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.devel Subject: Re: unit test framework Date: Sat, 20 Mar 2010 12:01:45 +0100 Message-ID: <4BA4AB19.2080102@nschum.de> References: <20100318.163911.560917315840337376.yamato@redhat.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1269083888 655 80.91.229.12 (20 Mar 2010 11:18:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 20 Mar 2010 11:18:08 +0000 (UTC) Cc: web@shellarchive.co.uk, Masatake YAMATO , ohler+emacs@fastmail.net, emacs-devel@gnu.org, rubikitch , Phil Hagelberg , Stefan Monnier To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 20 12:18:03 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nswgs-0004Ck-2K for ged-emacs-devel@m.gmane.org; Sat, 20 Mar 2010 12:18:02 +0100 Original-Received: from localhost ([127.0.0.1]:34556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nswgr-0004Zg-AN for ged-emacs-devel@m.gmane.org; Sat, 20 Mar 2010 07:18:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NswRM-0001GE-4R for emacs-devel@gnu.org; Sat, 20 Mar 2010 07:02:00 -0400 Original-Received: from [140.186.70.92] (port=52203 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NswRI-0001Ez-Ea for emacs-devel@gnu.org; Sat, 20 Mar 2010 07:01:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NswRG-000755-2O for emacs-devel@gnu.org; Sat, 20 Mar 2010 07:01:56 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:56977) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NswRF-000743-LE for emacs-devel@gnu.org; Sat, 20 Mar 2010 07:01:53 -0400 Original-Received: from thursday.lan (ip-94-79-132-42.unitymediagroup.de [94.79.132.42]) by dd18200.kasserver.com (Postfix) with ESMTP id 3555B181936BE; Sat, 20 Mar 2010 12:01:46 +0100 (CET) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Sat, 20 Mar 2010 07:17:54 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122352 Archived-At: On 2010-03-18 15:56 , Lennart Borgman wrote: > elk-test: Nikolaj Schumacher elk-test might look more complicated than it is. Most of the code is for the user interface. The testing framework itself is just a thin wrapper around Emacs' error signaling with better readability. While (assert (equal "yy" foo)) causes (cl-assertion-failed (equal "yy" foo)) the macro (assert-equal "yy" foo) will cause the more readable: (error "assert-equal for failed: expected , was ") `assert-that' can take care of the formatting for custom tests, and `assert-error' fails when a specific error isn't thrown. The nice thing about these macros is that they work in any evaluation context. I'd vote to include such macros at the least. The (deftest "test name" ... macro just provides an name anchor for running individual tests. And the test runner will just catch errors and display them as text, highlight where the error occurred, and mark the buffer as "red". This GUI is more designed for test-driven development than automatic regression tests, but the macros would work fine for that, I suppose. kind regards, Nikolaj Schumacher