emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c7987a6 07/26: Emacs exits abnormally when noninteractive


From: Rocky Bernstein
Subject: [elpa] master c7987a6 07/26: Emacs exits abnormally when noninteractive test fails.
Date: Thu, 25 May 2017 02:22:13 -0400 (EDT)

branch: master
commit c7987a6e0d523b22712a937ab381d482dfe8fe9b
Author: rubikitch <address@hidden>
Commit: rubikitch <address@hidden>

    Emacs exits abnormally when noninteractive test fails.
---
 test-simple.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test-simple.el b/test-simple.el
index b9b4ffb..05a4e90 100644
--- a/test-simple.el
+++ b/test-simple.el
@@ -365,5 +365,15 @@ It is preferable to write at the first line of test files 
as a comment, e.g,
     (global-set-key (kbd test-simple-runner-key) func)
     (funcall func)))
 
+(defun test-simple-noninteractive-kill-emacs-hook ()
+  "Emacs exits abnormally when noninteractive test fails."
+  (when (and noninteractive test-simple-info
+             (<= 1 (test-info-failure-count test-simple-info)))
+    (let (kill-emacs-hook)
+     (kill-emacs 1))))
+(when noninteractive
+  (add-hook 'kill-emacs-hook 'test-simple-noninteractive-kill-emacs-hook))
+
+
 (provide 'test-simple)
 ;;; test-simple.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]