diff options
author | Roman Scherer <roman@burningswell.com> | 2014-08-22 10:03:05 +0200 |
---|---|---|
committer | Roman Scherer <roman@burningswell.com> | 2014-08-22 19:32:33 +0200 |
commit | 94496e4b14ea5149812ca91a4ad4d7ce1785cdf2 (patch) | |
tree | d6f8142c4116d1853f9f005c4c2ffbb94b439b7c /cider-test.el | |
parent | 00c8cb96fafa2d68a6a707c800bcde037c55a86d (diff) |
Only show cider-test-report buffer on test failures.
This PR doesn't show the *cider-test-report* on successful tests anymore. Most
people will close that buffer anyway right after it popped up, and a message in
the echo area is probably enough to indicate that everything is fine. Setting
`cider-test-report-on-success` to `t` restores the old behaviour.
Diffstat (limited to 'cider-test.el')
-rw-r--r-- | cider-test.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cider-test.el b/cider-test.el index a40acdbf..29c45f05 100644 --- a/cider-test.el +++ b/cider-test.el @@ -41,6 +41,12 @@ :prefix "cider-test-" :group 'cider) +(defcustom cider-test-show-report-on-success nil + "Whether to show the `*cider-test-report*` buffer on passing tests." + :type 'boolean + :group 'cider-test + :package-version '(cider . "0.8.0")) + (defvar cider-test-last-test-ns nil "The namespace for which tests were last run.") @@ -403,14 +409,16 @@ displayed. When test failures/errors occur, their sources are highlighted." (cond ((member "namespace-not-found" status) (message "No tests namespace: %s" ns)) (results - (progn + (nrepl-dbind-response summary (error fail) (setq cider-test-last-test-ns ns) (setq cider-test-last-results results) (cider-test-highlight-problems ns results) (cider-test-echo-summary summary) - (cider-test-render-report - (cider-popup-buffer cider-test-report-buffer t) - ns summary results)))))))) + (when (or (cl-plusp (+ error fail)) + cider-test-show-report-on-success) + (cider-test-render-report + (cider-popup-buffer cider-test-report-buffer t) + ns summary results))))))))) (defun cider-test-rerun-tests () "Rerun failed and erring tests from the last tested namespace." |