README 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # -*- mode:org -*-
  2. #+Title: Org-mode Testing
  3. #+Property: results silent
  4. * dependencies
  5. The only dependency is [[http://www.emacswiki.org/emacs/ErtTestLibrary][ERT]] the Emacs testing library which ships with
  6. Emacs24. If you are running an older version of Emacs and don't
  7. already have ERT installed it can be installed from its old [[https://github.com/ohler/ert][git
  8. repository]].
  9. * non-interactive batch testing from the command line
  10. The simplest way to run the Org-mode test suite is from the command
  11. line with the following invocation. Note that the paths below are
  12. relative to the base of the Org-mode directory.
  13. #+BEGIN_SRC sh
  14. emacs -Q --batch -l lisp/org.el -l testing/org-test.el \
  15. --eval "(progn (org-reload) (setq org-confirm-babel-evaluate nil))" \
  16. -f org-test-run-batch-tests
  17. #+END_SRC
  18. The options in the above command are explained below.
  19. | -Q | ignores any personal configuration ensuring a vanilla Emacs instance is used |
  20. | --batch | runs Emacs in "batch" mode with no gui and termination after execution |
  21. | -l | loads Org-mode and the org mode test suite defined in testing/org-test.el |
  22. | --eval | reloads Org-mode and allows evaluation of code blocks by the tests |
  23. | -f | actually runs the tests using the `org-test-run-batch-tests' function |
  24. * interactive testing from within Emacs
  25. To run the Org-mode test suite from a current Emacs instance simply
  26. load and run the test suite with the following commands.
  27. 1) First load the test suite.
  28. #+BEGIN_SRC emacs-lisp :var here=(buffer-file-name)
  29. (add-to-list 'load-path (file-name-directory here))
  30. (require 'org-test)
  31. #+END_SRC
  32. 2) Then run the test suite.
  33. #+BEGIN_SRC emacs-lisp
  34. (org-test-run-all-tests)
  35. #+END_SRC
  36. * troubleshooting
  37. - If the value of the =org-babel-no-eval-on-ctrl-c-ctrl-c= is non-nil
  38. then it will result in some test failure, as there are tests which
  39. rely on this behavior.