all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Unit testing Emacs Lisp
@ 2007-07-15 23:36 Phil Hagelberg
  2007-07-16  8:07 ` gteale
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Hagelberg @ 2007-07-15 23:36 UTC (permalink / raw)
  To: emacs-devel


I've been developing a few miscellaneous modes for Emacs Lisp for a
while now, and I've always felt a bit uncomfortable about the lack of
tests for my modes. I usually write test-driven code in other
languages, and writing code without automated testing is somewhat of
an anathema to me; I like to be able to know immediately when my
changes have broken things.

Anyhow, I've been playing with unit testing Elisp for a while and have
gone through a number of incarnations of test frameworks, but none of
them have really been convenient enough to get me to use them on a
regular basis.

With that in mind, I'm trying to gather input on what would make a
good unit testing framework for Elisp. The gist is that it would be
loosely based on xUnit, with tests divided up into suites. Each test
is stored as a lambda that contains setup code and a number of
assertions that prove the code did what it was supposed to do. Rather
than executing the tests when the code is evaled, they are stored in
memory to be run by a separate interactive command.

What is equally or more important is the helper functions that would
accompany such a framework. I find that in my own tests the bulk of
the work is in setting up buffers and getting things to the point
where I can perform checks on behaviour; I believe a few functions for
abstractions for those types of tasks could go a long way towards
making things easier.

I've begun a brainstorm on the Emacs Wiki:
http://www.emacswiki.org/cgi-bin/wiki/ElUnit

Comments (either on the wiki or on the list) would be appreciated.

Thanks.

-Phil Hagelberg
http://technomancy.us

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unit testing Emacs Lisp
  2007-07-15 23:36 Unit testing Emacs Lisp Phil Hagelberg
@ 2007-07-16  8:07 ` gteale
  2007-07-17 14:59   ` Johan Bockgård
  0 siblings, 1 reply; 3+ messages in thread
From: gteale @ 2007-07-16  8:07 UTC (permalink / raw)
  To: Phil Hagelberg; +Cc: emacs-devel

Quoting Phil Hagelberg <lists@hagelb.org>:

> I've begun a brainstorm on the Emacs Wiki:
> http://www.emacswiki.org/cgi-bin/wiki/ElUnit
>
> Comments (either on the wiki or on the list) would be appreciated.

Hey Phil,

That looks like a great idea.  Probably jumping the gun a little, but  
if you could somehow produce stats on the code coverage of the tests  
it would help the non-techy process of making statements about code  
quality.

We use Emacs code as part of a clinical system and this kind of stuff  
is extremely useful in justifying what we've done.

--
Geoff Teale
Cmed Technology: <gteale@cmedresearch.com>
FSF Associate: <tealeg@member.fsf.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unit testing Emacs Lisp
  2007-07-16  8:07 ` gteale
@ 2007-07-17 14:59   ` Johan Bockgård
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Bockgård @ 2007-07-17 14:59 UTC (permalink / raw)
  To: emacs-devel

gteale@cmedltd.com writes:

> if you could somehow produce stats on the code coverage of the tests
> it would help the non-techy process of making statements about code
> quality.

(info "(elisp)Test Coverage")

-- 
Johan Bockgård

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-17 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-15 23:36 Unit testing Emacs Lisp Phil Hagelberg
2007-07-16  8:07 ` gteale
2007-07-17 14:59   ` Johan Bockgård

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.