1 #+Title: Org-mode Testing
2 #+Babel: results silent
4 The following instructions describe how to get started using the
5 Org-mode test framework.
7 1) Install the ERT and jump.el testing dependencies which are included
8 as git submodules in the org-mode repository. To do so run the
9 following git submodule commands from inside the base of the
10 Org-mode directory (or just execute the following code block).
17 2) Load the [[file:org-test.el][org-test.el]] file
18 #+begin_src emacs-lisp
19 (load-file "org-test.el")
22 3) The =org-test-jump= command is now bound to =M-C-j= in all
23 emacs-lisp files. Call this command from any file in the =lisp/=
24 directory of the org-mode repository to jump to the related test
25 file in the =testing/= directory. Call this functions with a
26 prefix argument, and the corresponding test file will be stubbed
27 out if it doesn't already exist.
29 4) Review the ERT documentation, to do this run =makeinfo= in the
30 =testing/ert= directory,
35 then browse the [[elisp:(info (expand-file-name "ert/ert.info"))][resulting info file]].
37 5) A number of org-mode-specific functions and macros are provided in
38 =org-test.el= see the [[file:org-test.el::%3B%3B%3B%20Functions%20for%20writing%20tests][;;; Functions for Writing Tests]] subsection of
39 that file. Some of these functions make use of example org-mode
40 files located in the [[file:examples][examples/]] directory.
42 6) Functions for loading and running the Org-mode tests are provided
43 in the [[file:org-test.el::%3B%3B%3B%20Load%20and%20Run%20tests][;;; Load and Run Tests]] subsection, the most important of
45 - =org-test-load= which loads the entire Org-mode test suite
46 - =org-test-current-defun= which runs all tests for the current
47 function around point (should be called from inside of an
49 - =org-test-run-all-tests= which runs the entire Org-mode test suite
50 - also note that the =ert= command can also be used to run tests