Test Selectors
Functions like ert accept a test selector, a Lisp expression specifying a set of tests. Test selector syntax is similar to Common Lisp’s type specifier syntax:
nilselects no tests.tselects all tests.:newselects all tests that have not been run yet.:failedand:passedselect tests according to their most recent result.:expected,:unexpectedselect tests according to their most recent result.- A string is a regular expression that selects all tests with matching names.
- A test (i.e., an object of
ert-testdata type, see its doc string for details) selects that test. - A symbol selects the test that the symbol names.
(member tests...)selects the elements oftests, a list of tests or symbols naming tests.(eql test)selectstest, a test or a symbol naming a test.(and selectors…)selects the tests that match allselectors.(or selectors…)selects the tests that match any of theselectors.(not selector)selects all tests that do not matchselector.(tag tag)selects all tests that havetagon their tags list. (Tags are optional labels you can apply to tests when you define them.)(satisfies predicate)selects all tests that satisfypredicate, a function that takes a test as argument and returns non-nilif it is selected.
Selectors that are frequently useful when selecting tests to run include t to run all tests that are currently defined in Emacs, "^foo-" to run all tests in package foo (this assumes that package foo uses the prefix foo- for its test names), result-based selectors such as (or :new :unexpected) to run all tests that have either not run yet or that had an unexpected result in the last run, and tag-based selectors such as (not (tag :causes-redisplay)) to run all tests that are not tagged :causes-redisplay.