From 6ab5e65f200a52aa44aa7fed09e792fefe656f85 Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Sun, 11 Dec 2016 22:00:49 -0800 Subject: [PATCH 1/3] Print test output properly with "--win" and "-no-win" --- ert-runner.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ert-runner.el b/ert-runner.el index 095a91f..11e0c82 100644 --- a/ert-runner.el +++ b/ert-runner.el @@ -105,8 +105,10 @@ Arguments: stats, test, result") This bypasses the normal output capturing ert-runner does, and is primarily intended for reporters." - (princ (apply #'format format args) - t)) + (let ((message (apply #'format format args))) + (if ert-runner-output-file + (f-append-text message 'utf-8 ert-runner-output-file) + (princ message t)))) ;; Work around Emacs bug #16121, which is fixed in Emacs 24.4, but still present ;; in former releases. See ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16121 From 05b13eb620303a11ebfbdcfd1386d8f53fad634a Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Tue, 16 May 2017 23:55:01 -0400 Subject: [PATCH 2/3] Add a files declaration to the Cask file This should allow Cask to install the package using Git. --- Cask | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cask b/Cask index e7db753..ce9de1d 100644 --- a/Cask +++ b/Cask @@ -3,6 +3,10 @@ (package-file "ert-runner.el") +(files ("*.el" + ("bin" "bin/*") + ("reporters" "reporters/*.el"))) + (development (depends-on "s") (depends-on "dash") From 3b913931b4dc520cc6093ea8b274dc952f668ca1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Wed, 19 Jul 2017 00:23:18 -0700 Subject: [PATCH 3/3] Ensure that emacs always exits even in non-batch mode --- ert-runner.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ert-runner.el b/ert-runner.el index 11e0c82..ea4b032 100644 --- a/ert-runner.el +++ b/ert-runner.el @@ -198,14 +198,19 @@ nil, `ert-runner-test-path' will be used instead." (ert-runner/use-reporter ert-runner-reporter-name) (let ((test-files (ert-runner--test-files tests)) (test-helper (f-expand "test-helper.el" ert-runner-test-path))) - (-each ert-runner-load-files #'ert-runner--load) - (if (f-exists? test-helper) - (ert-runner--load test-helper)) - (-each test-files #'ert-runner--load) + (condition-case e + (progn + (-each ert-runner-load-files #'ert-runner--load) + (if (f-exists? test-helper) + (ert-runner--load test-helper)) + (-each test-files #'ert-runner--load)) + (error + (ert-runner-message "Error during test setup: %S. No tests were run.\n" e) + (kill-emacs 1))) (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runner-selector) (shut-up - (ert-runner/run-tests-batch-and-exit ert-runner-selector))))) + (ert-runner/run-tests-batch-and-exit ert-runner-selector))))) (defun ert-runner/init (&optional name) "Create new test project (optional project name)."