Momus / ert-it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

Intro

A wrapper for ert to easily run tests.

About this Project

Uses Babel Org, everything, including the `README.md` file, is generated form a single file, `ert-it.org,` where all the changes should go.

The Plan

[100%] Bare minimum to be useful

  • In a .el file:
    • find a corresponding buffer named *-test.el
    • evaluate it. The whole thing
    • feed it to ert

[0%] Next Steps

  • search subdirectories
  • get all *-test.el files
  • look for any tests in the current buffer. Evaluate those functons.

ert-it

;;; 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

tests

;;; ert-it-test.el --- Tests for ert-it

;;; Commentary:

;;; Code:
(load-file "ert-it.el")

(provide 'ert-it-test)
;;; ert-it-test ends here

About


Languages

Language:Emacs Lisp 100.0%