ert

Homepage: https://www.gnu.org/software/emacs

Author: Christian Ohler

Summary

Emacs Lisp Regression Testing

Commentary

ERT is a tool for automated testing in Emacs Lisp.  Its main
features are facilities for defining and running test cases and
reporting the results as well as for debugging test failures
interactively.

The main entry points are `ert-deftest', which is similar to
`defun' but defines a test, and `ert-run-tests-interactively',
which runs tests and offers an interactive interface for inspecting
results and debugging.  There is also
`ert-run-tests-batch-and-exit' for non-interactive use.

The body of `ert-deftest' forms resembles a function body, but the
additional operators `should', `should-not', `should-error' and
`skip-unless' are available.  `should' is similar to cl's `assert',
but signals a different error when its condition is violated that
is caught and processed by ERT.  In addition, it analyzes its
argument form and records information that helps debugging
(`assert' tries to do something similar when its second argument
SHOW-ARGS is true, but `should' is more sophisticated).  For
information on `should-not' and `should-error', see their
docstrings.  `skip-unless' skips the test immediately without
processing further, this is useful for checking the test
environment (like availability of features, external binaries, etc).

See ERT's info manual as well as the docstrings for more details.
To compile the manual, run `makeinfo ert.texinfo' in the ERT
directory, then C-u M-x info ert.info in Emacs to view it.

To see some examples of tests written in ERT, see its self-tests in
ert-tests.el.  Some of these are tricky due to the bootstrapping
problem of writing tests for a testing tool, others test simple
functions and are straightforward.

Dependencies

Reverse dependencies