ERT: Emacs Lisp Regression Testing
ERT is a tool for automated testing in Emacs Lisp. Its main features are facilities for defining tests, running them and reporting the results, and for debugging test failures interactively.
ERT is similar to tools for other environments such as JUnit, but has unique features that take advantage of the dynamic and interactive nature of Emacs. Despite its name, it works well both for test-driven development (see http://en.wikipedia.org/wiki/Test-driven_development) and for traditional software development methods.
| Introduction | A simple example of an ERT test. |
| How to Run Tests | Run tests in Emacs or from the command line. |
| How to Write Tests | How to add tests to your Emacs Lisp code. |
| How to Debug Tests | What to do if a test fails. |
| Extending ERT | ERT is extensible in several ways. |
| Other Testing Concepts | Features not in ERT. |
| GNU Free Documentation License | The license for this documentation. |
Detailed Node Listing
How to Run Tests
| How to Write Tests | |
|---|---|
The should Macro |
A powerful way to express assertions. |
| Expected Failures | Tests for known bugs. |
| Tests and Their Environment | Don't depend on customizations; no side effects. |
| Useful Techniques | Some examples. |
| How to Debug Tests | |
| Understanding Explanations | How ERT gives details on why an assertion failed. |
| Interactive Debugging | Tools available in the ERT results buffer. |
| Extending ERT | |
| Defining Explanation Functions | Teach ERT about more predicates. |
| Low-Level Functions for Working with Tests | Use ERT's data for your purposes. |
| Other Testing Concepts | |
| Mocks and Stubs | Stubbing out code that is irrelevant to the test. |
| Fixtures and Test Suites | How ERT differs from tools for other languages. |
| Appendix | |
| GNU Free Documentation License | The license for this documentation. |