A wrapper for ert to easily run tests.
Uses Babel Org, everything, including the `README.md` file, is generated form a single file, `ert-it.org,` where all the changes should go.
- In a .el file:
- find a corresponding buffer named *-test.el
- evaluate it. The whole thing
- feed it to ert
- search subdirectories
- get all *-test.el files
- look for any tests in the current buffer. Evaluate those functons.
;;; ert-it --- Find and run all your tests.
;;; Commentary:
;; Best used while the tune to Michael Jackson's \"Beat
;; It!\" runs through your head.
;;; Code:
(defun ert-file ()
"Take name of the current buffer, make it into a test file."
(concat
(file-name-sans-extension (expand-file-name (buffer-name)))
"-test.el"))
(defun ert-it ()
"Look for a test file in the working directory.
Then evaluate and feed it into \\[ert]."
(interactive)
(save-buffer)
(ert-delete-all-tests)
(load (ert-file))
(ert-run-tests-interactively t))
(provide 'ert-it)
;;; ert-it ends here
;;; ert-it-test.el --- Tests for ert-it
;;; Commentary:
;;; Code:
(load-file "ert-it.el")
(provide 'ert-it-test)
;;; ert-it-test ends here