diff options
authorMichael Brand <>2012-12-28 13:58:24 (GMT)
committer Bastien Guerry <>2012-12-29 13:33:52 (GMT)
commit710f445768cb9eaf6ae7c7c17c11fc16016befca (patch)
parent3b994e78fbc1dd920b44dc661e974fc438d40d19 (diff)
testing/README: add howto run ERT partially
* testing/README (Interactive testing from within Emacs): Add a description how to run a single ERT or all tests of a single test file.
1 files changed, 32 insertions, 1 deletions
diff --git a/testing/README b/testing/README
index a81efa0..8ce7a19 100644
--- a/testing/README
+++ b/testing/README
@@ -43,11 +43,42 @@ load and run the test suite with the following commands.
(require 'org-test)
-2) Then run the test suite.
+2) Then run the test suite,
#+BEGIN_SRC emacs-lisp
+ or when a test fails run it interactively and investigate the
+ problem in the ERT results buffer.
+ How 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" ;; expected is right
+ (org-link-escape "[")))
+ (should (string= "%5C" ;; expected is wrong, "%5D" would be right
+ (org-link-escape "]"))))
+ 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.
+ How to run all tests of a single test file:
+ "M-x ert-delete-all-tests RET", confirm. Open the file
+ ./lisp/test-*.el, "M-x eval-buffer RET", "M-x ert RET t RET"
+ Consider to set pp-escape-newlines nil 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 value of the =org-babel-no-eval-on-ctrl-c-ctrl-c= is non-nil