From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: unit test framework Date: Tue, 23 Mar 2010 14:15:39 +0100 Message-ID: References: <20100318.163911.560917315840337376.yamato@redhat.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1269351366 5732 80.91.229.12 (23 Mar 2010 13:36:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Mar 2010 13:36:06 +0000 (UTC) Cc: Nikolaj Schumacher , web@shellarchive.co.uk, Masatake YAMATO , ohler+emacs@fastmail.net, emacs-devel@gnu.org, rubikitch , Stefan Monnier , Phil Hagelberg To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 23 14:36:00 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 1Nu4H2-0002Qq-K6 for ged-emacs-devel@m.gmane.org; Tue, 23 Mar 2010 14:36:00 +0100 Original-Received: from localhost ([127.0.0.1]:42909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu46r-0005GT-JD for ged-emacs-devel@m.gmane.org; Tue, 23 Mar 2010 09:25:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nu46i-0005FO-SN for emacs-devel@gnu.org; Tue, 23 Mar 2010 09:25:20 -0400 Original-Received: from [140.186.70.92] (port=48099 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu46g-0005CX-Ba for emacs-devel@gnu.org; Tue, 23 Mar 2010 09:25:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nu3xh-0001ZB-FF for emacs-devel@gnu.org; Tue, 23 Mar 2010 09:16:03 -0400 Original-Received: from mail-ew0-f227.google.com ([209.85.219.227]:33073) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nu3xh-0001Z4-9C for emacs-devel@gnu.org; Tue, 23 Mar 2010 09:16:01 -0400 Original-Received: by ewy27 with SMTP id 27so1272366ewy.33 for ; Tue, 23 Mar 2010 06:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=44PkmhEoq2SAAXMKtS0CqZxzpdYTLR8NoWQY+a7fWkg=; b=QUjPt7PWSIez53/2+ZQc0bXsX6DKw1nZ8vA9dJAsScsId/b17CQ2OvN9XtcLtbAbNi kZc2RKwJVein1DpsvLah7Exhf8VhsOFJj3tBJIPqNaU4GNvL5yKjpkOXxhBEYhTF7xb6 jAIZib7ITLEd80cDjczrOdUluwRXYZ4qC1dFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=vGsMBHm+Om1ElUTVB1oGJjgLRiS5sY9EKHL3/XilrLkSSC4Et8L8QnUhLbJIhNcjx6 3RW6A8BZzaKaWZxUMLUQ5UT+9Ydsovs7pRZNzLbITFyITiNrrqfVPr/GbbbTpatNewE9 NANHql/mglrUvj/1hAP4mvJUXQwk8g73QyFr0= Original-Received: by 10.239.188.210 with SMTP id q18mr1996985hbh.143.1269350160147; Tue, 23 Mar 2010 06:16:00 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:122545 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" > > - 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.