From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: unit test framework Date: Wed, 24 Mar 2010 12:03:13 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20100324.120313.866373779585127683.yamato@redhat.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1269399519 15890 80.91.229.12 (24 Mar 2010 02:58:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 24 Mar 2010 02:58:39 +0000 (UTC) Cc: me@nschum.de, web@shellarchive.co.uk, phil@hagelb.org, ohler+emacs@fastmail.net, emacs-devel@gnu.org, rubikitch@ruby-lang.org, joakim@verona.se, monnier@iro.umontreal.ca To: lennart.borgman@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 24 03:58:33 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 1NuGnJ-0007xX-1W for ged-emacs-devel@m.gmane.org; Wed, 24 Mar 2010 03:58:32 +0100 Original-Received: from localhost ([127.0.0.1]:44451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuGnD-0001rl-Qs for ged-emacs-devel@m.gmane.org; Tue, 23 Mar 2010 22:58:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuGn9-0001qx-OL for emacs-devel@gnu.org; Tue, 23 Mar 2010 22:57:59 -0400 Original-Received: from [140.186.70.92] (port=48015 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuGn8-0001q6-Ku for emacs-devel@gnu.org; Tue, 23 Mar 2010 22:57:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuGn6-0007eA-Qf for emacs-devel@gnu.org; Tue, 23 Mar 2010 22:57:58 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:22913) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuGn6-0007du-Ip for emacs-devel@gnu.org; Tue, 23 Mar 2010 22:57:56 -0400 Original-Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2O2vno4000442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Mar 2010 22:57:49 -0400 Original-Received: from localhost (beach.nrt.redhat.com [10.64.200.71]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2O2vi5Q020039; Tue, 23 Mar 2010 22:57:45 -0400 In-Reply-To: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:122588 Archived-At: > On Tue, Mar 23, 2010 at 10:02 AM, wrote: >> >> I write try to write unit tests for my elisp, and it would be much >> easier if there was a canonical unit test framework in Emacs. >> >> I have written some tests for CEDET, which doesnt really use a >> framework, and should be included in Emacs(I havent looked at the merged >> version yet). I have also written some tests in elunit for other >> packages. >> >> I'm currently writing some code that would benefit from simulation of >> keyboard input, in particular code that uses read, read-number, >> completing-read etc. Some of the contenders listed above surely does >> this, right? >> >> Anyway, maybe we should make a list of requirements for a unit test >> package for inclusion. Heres my take: >> >> - possibility to generate unit tests reports in test runs during "make" I've extended ert.el for the purpose. http://github.com/masatake/ert/commit/5f1bc45c5c54e1f95e9e8ba787f3f66b33ddc583 The patch was improved based on the comment from the original author, Christian M. Ohler. I asked him to merge my patch to his source tree, but I have got no response yet. >> - at least rudimentary user input simulation, to test read, read-number, >> completing-read etc. > > > I have written some extensions to ert.el that allows running commands > in the test function (ie calling relevant hooks etc). > > >> - some way of isolating test runs from normal operations > > > I have some small things that starts a new Emacs instance for the tests. > > > >> - good error reporting, so that you dont have to spend hours in edebug needlessly > > > ert.el have good interactive reporting (that needs some usability > enhancements, like menu entries), but not so much for saving to file > (or maybe I have just missed that part). > > >> - convenient way of defining and running tests, in group or one-by-one > > > ert.el does it by regexp matching the names of the test functions. > > Masatake YAMATO