File: hsys-ert.el.html
ERT is the Emacs Regression Test framework in "ert.el". Hyperbole uses
it for all of its regression testing as well.
Sometimes when building Emacs Lisp tests with the ERT package, multiple
tests are added to a single test fixture/function. Each subtest
has its own should-type clause. But if one of these subtests fails,
ERT shows you the test name and the should clause in its results buffer
but if there are 12 subtests, it is difficult to match the displayed
should clause to the source line that ran it.
The ert-should implicit button type defined herein solves this problem.
Hyperbole loads this and then a press of the Action Key within an ert
results buffer (or another buffer to which the results have been copied)
produces the following:
- If on the first line of the result with the test name, jump to the
test definition.
- If on a highlighted button, activate the button.
- Otherwise if not at the end of a line and within a failed test result,
find the should clause and go to the matching line within the test
source code. An easy way to use it is to put point at the beginning
of a line other than the first within an ert result and press the
Action Key.