unofficial mirror of emacs-devel@gnu.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

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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).