diff options
| author | Vegard Øye <vegard_oye@hotmail.com> | 2011-06-16 15:03:45 +0200 |
|---|---|---|
| committer | Vegard Øye <vegard_oye@hotmail.com> | 2011-06-16 15:03:45 +0200 |
| commit | 5fb9afef1e2687f1d30276fb33202112f05926c6 (patch) | |
| tree | 6cfa2f8a9902571710e5b4e7277a8e83ae78625e | |
| parent | 1fd907cb0105cfbc45a707a9642a9c1ab4066bfb (diff) | |
Add TAG variable to "make emacs" and "make terminal"
This makes it possible to specify up-front which tests to run
inside an instance of Emacs.
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | evil-tests.el | 24 |
2 files changed, 14 insertions, 14 deletions
@@ -40,7 +40,7 @@ tests: compile-batch emacs: clean $(EMACS) -Q -L . -l evil-tests.el --eval "(evil-mode 1)" \ --eval "(if (y-or-n-p-with-timeout \"Run tests? \" 2 t) \ -(evil-tests-run t) \ +(evil-tests-run '(${TAG}) t) \ (message \"You can run the tests at any time with \`M-x evil-tests-run\'\"))" & # Load Evil in a terminal Emacs and run all tests. @@ -48,7 +48,7 @@ term: terminal terminal: clean $(EMACS) -nw -Q -L . -l evil-tests.el --eval "(evil-mode 1)" \ --eval "(if (y-or-n-p-with-timeout \"Run tests? \" 2 t) \ -(evil-tests-run t) \ +(evil-tests-run '(${TAG}) t) \ (message \"You can run the tests at any time with \`M-x evil-tests-run\'\"))" # Re-indent all Evil code. diff --git a/evil-tests.el b/evil-tests.el index 6069a8b..7122caf 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -15,19 +15,19 @@ (defvar evil-tests-run nil "*Run Evil tests.") -(defun evil-tests-run (&optional tests) +(defun evil-tests-run (&optional tests interactive) "Run Evil tests." - (interactive '(t)) - (if (not (listp tests)) - (ert-run-tests-interactively t) - (ert-run-tests-batch-and-exit - (or (null tests) - `(or ,@(mapcar (lambda (test) - (or (null test) - (and (memq test '(evil t)) t) - `(or (tag ,test) - ,(format "^%s$" test)))) - tests)))))) + (interactive '(nil t)) + (setq tests (or (null tests) + `(or ,@(mapcar (lambda (test) + (or (null test) + (and (memq test '(evil t)) t) + `(or (tag ,test) + ,(format "^%s$" test)))) + tests)))) + (if interactive + (ert-run-tests-interactively tests) + (ert-run-tests-batch-and-exit tests))) (defmacro evil-test-buffer (&rest body) "Execute BODY in a temporary buffer. |
