From 4b112c7431b742c02a8bc3f246e687bf781b7781 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Mon, 26 Aug 2024 18:18:18 +0200 Subject: Return a useful exit status for XEmacs tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test/xemacs-test-wrapper.el (kill-emacs): Return a useful exit status. Signed-off-by: Ulrich Müller --- ChangeLog | 5 +++++ test/xemacs-test-wrapper.el | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6fafb58..00840d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-08-26 Ulrich Müller + + * test/xemacs-test-wrapper.el (kill-emacs): Return a useful exit + status. + 2024-08-22 Ulrich Müller * test/ebuild-mode-tests.el (cl-letf, cl-letf*) diff --git a/test/xemacs-test-wrapper.el b/test/xemacs-test-wrapper.el index dd83a07..930d7ff 100644 --- a/test/xemacs-test-wrapper.el +++ b/test/xemacs-test-wrapper.el @@ -31,3 +31,15 @@ (defmacro should-error (form) `(Check-Error 'error ,form)) + +;; return a useful exit status +(defadvice kill-emacs (before xemacs-test-wrapper-kill-emacs activate) + (let ((ret (ad-get-arg 0))) + (cond ((and (integerp ret) (>= ret 2))) + ((/= unexpected-test-suite-failures 0) + (setq ret 2)) + (t (dolist (result test-harness-file-results-alist) + ;; result is a list: (file passes total) + (if (/= (nth 1 result) (nth 2 result)) + (setq ret 1))))) + (ad-set-arg 0 ret))) -- cgit v1.2.3-65-gdbad