Next: , Previous: , Up: ERT: Emacs Lisp Regression Testing [Contents][Index]


3 How to Write Tests

ERT lets you define tests in the same way you define functions. You can type ert-deftest forms in a buffer and evaluate them there with eval-defun or compile-defun, or you can save the file and load it, optionally byte-compiling it first.

Just like find-function is able to find where a function was defined only if the function was loaded from a file, ERT is able to find where a test was defined only if the test was loaded from a file.

If the test definition is generated by a macro, the macro may want to help ERT find the defining call to the macro by putting the property find-function-type-alist on the test name. See Finding Definitions in GNU Emacs Lisp Reference Manual.

AltStyle によって変換されたページ (->オリジナル) /