README

The only dependency is [[http://www.emacswiki.org/emacs/ErtTestLibrary][ERT]] the Emacs testing library which ships withEmacs24. If you are running an older version of Emacs and don'talready have ERT installed it can be installed from its old [[https://github.com/ohler/ert][gitrepository]].

* Non-interactive batch testing from the command line

The simplest way to run the Org mode test suite is from the commandline with the following invocation. Note that the paths below arerelative to the base of the Org mode directory.

The 'dirty' targets are for recompiling without cleaning andrebuilding everything. This usually speeds up the recompilationconsiderably. Note that this speed up comes to the price of possiblyweird errors due to the unclean build.

When a test fails, run it interactively and investigate the problem in the ERT results buffer.

To run one test: Use this as a demo example of a failing test #+BEGIN_SRC emacs-lisp (ert-deftest test-org/org-link-escape-ascii-character-demo-of-fail () (should (string= "%5B" ; Expecting %5B is correct. (org-link-escape "["))) (should (string= "%5C" ; Expecting %5C is wrong, %5D correct. (org-link-escape "]")))) #+END_SRC or evaluate the ~ert-deftest form~ of the test you want to run. Then ~M-x ert RET test-org/org-link-escape-ascii-character-demo-of-fail RET~. When not visible yet switch to the ERT results buffer named ~*ert*~. When a test failed the ERT results buffer shows the details of the first ~should~ that failed. See ~(info "(ert)Running Tests Interactively")~ on how to re-run, start the debugger etc.

Consider to set #+BEGIN_SRC emacs-lisp (setq pp-escape-newlines nil) #+END_SRC before running the test when looking at ~should~ in the ERT results buffer. Especially when using ~l~ to look at passed test results and possibly missing an appropriate setting of ~pp-escape-newlines~ made only temporarily for the running time of the test as e. g. tests using ~org-test-table-target-expect-tblfm~ do.

* Troubleshooting

- If the variable ~org-babel-no-eval-on-ctrl-c-ctrl-c~ is non-nil then it will result in some test failure, as there are tests which rely on this behavior.