From: Phil Hagelberg <lists@hagelb.org>
To: emacs-devel@gnu.org
Subject: Unit testing Emacs Lisp
Date: Sun, 15 Jul 2007 16:36:16 -0700 [thread overview]
Message-ID: <87sl7pi6j3.fsf@hagelb.org> (raw)
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
next reply other threads:[~2007-07-15 23:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-15 23:36 Phil Hagelberg [this message]
2007-07-16 8:07 ` Unit testing Emacs Lisp gteale
2007-07-17 14:59 ` Johan Bockgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sl7pi6j3.fsf@hagelb.org \
--to=lists@hagelb.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).