From 9eaf3506327c03f6d41ab7cb0ca22cd3cb545986 Mon Sep 17 00:00:00 2001 From: Fabricationatorishnicatorist Date: Thu, 12 Nov 2015 13:14:56 +0200 Subject: [PATCH] [Fix #1406] When running tests, report test ns in minibuffer messages --- CHANGELOG.md | 1 + cider-test.el | 10 +++++----- cider-util.el | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 692d30928..df505b434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### New features +* [#1406](https://github.com/clojure-emacs/cider/issues/1406): When running tests, report test ns in minibuffer messages. * [#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). diff --git a/cider-test.el b/cider-test.el index 881796249..9866c6ebc 100644 --- a/cider-test.el +++ b/cider-test.el @@ -325,12 +325,12 @@ With the actual value, the outermost '(not ...)' s-expression is removed." ;;; Summary echo -(defun cider-test-echo-summary (summary) - "Echo SUMMARY statistics for a test run." +(defun cider-test-echo-summary (summary ns) + "Echo SUMMARY statistics for a test run of tests in NS." (nrepl-dbind-response summary (test fail error) (message (propertize - (format "Ran %s tests. %s failures, %s errors." test fail error) + (format "Ran %d tests in %s. %d failures, %d errors." test ns fail error) 'face (cond ((not (zerop error)) 'cider-test-error-face) ((not (zerop fail)) 'cider-test-failure-face) (t 'cider-test-success-face)))))) @@ -434,7 +434,7 @@ This uses the Leiningen convention of appending '-test' to the namespace name." Upon test completion, results are echoed and a test report is optionally displayed. When test failures/errors occur, their sources are highlighted." (cider-test-clear-highlights) - (message "Testing...") + (message "Running tests in %s..." ns) (cider-nrepl-send-request (list "ns" ns "op" (if retest "retest" "test") "tests" tests "session" (cider-current-session)) @@ -449,7 +449,7 @@ displayed. When test failures/errors occur, their sources are highlighted." (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-echo-summary summary ns) (if (or (not (zerop (+ error fail))) cider-test-show-report-on-success) (cider-test-render-report diff --git a/cider-util.el b/cider-util.el index ba29a017a..2bf7a9c9a 100644 --- a/cider-util.el +++ b/cider-util.el @@ -379,6 +379,7 @@ Any other value is just returned." "The true delight is in the finding out rather than in the knowing. -Isaac Asimov" "If paredit is not for you, then you need to become the sort of person that paredit is for. -Phil Hagelberg" "Express Yourself. -Madonna" + "Put On Your Red Shoes and Dance. -David Bowie" "Take this REPL, fellow hacker, and may it serve you well." "Let the hacking commence!" "Hacks and glory await!"