From e1ff8a27520a6eb478f092b64ee5bb70dd986d67 Mon Sep 17 00:00:00 2001 From: Jeff Hui Date: Fri, 6 Nov 2015 16:17:54 -0800 Subject: [PATCH] Update test-report buffer when tests pass If the user has the test-report buffer open. Update the buffer to show the tests pass instead of keeping previously failed errors. This is less confusing than seeing previously failed errors despite tests passing. --- CHANGELOG.md | 1 + cider-test.el | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc6ad27ee..692d30928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### New features +* [#1402](https://github.com/clojure-emacs/cider/pull/1402): When tests pass after previously failing, update the test-report buffer to show success. * [#1373](https://github.com/clojure-emacs/cider/issues/1373): Add gradle support for `cider-jack-in`. * Indentation of macros (and functions) [can be specified](https://github.com/clojure-emacs/cider#specifying-indentation) in the var's metadata, via [indent specs](Indent-Spec.md). * [Abbreviated printing](https://github.com/clojure-emacs/cider-nrepl/pull/268) for functions multimethods. Instead of seeing `#object[clojure.core$_PLUS_ 0x4e648e99 "clojure.core$_PLUS_@4e648e99"]` you'll see `#function[clojure.core/+]`. diff --git a/cider-test.el b/cider-test.el index 0f0481ae0..187448315 100644 --- a/cider-test.el +++ b/cider-test.el @@ -450,12 +450,16 @@ displayed. When test failures/errors occur, their sources are highlighted." (setq cider-test-last-results results) (cider-test-highlight-problems ns results) (cider-test-echo-summary summary) - (when (or (not (zerop (+ error fail))) - cider-test-show-report-on-success) - (cider-test-render-report - (cider-popup-buffer cider-test-report-buffer - cider-auto-select-test-report-buffer) - ns summary results))))))))) + (if (or (not (zerop (+ error fail))) + cider-test-show-report-on-success) + (cider-test-render-report + (cider-popup-buffer cider-test-report-buffer + cider-auto-select-test-report-buffer) + ns summary results) + (when (get-buffer cider-test-report-buffer) + (cider-test-render-report + (cider-popup-buffer cider-test-report-buffer) + ns summary results)))))))))) (defun cider-test-rerun-tests () "Rerun failed and erring tests from the last tested namespace."