summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-08-26 18:18:18 +0200
committerUlrich Müller <ulm@gentoo.org>2024-08-27 23:23:33 +0200
commit4b112c7431b742c02a8bc3f246e687bf781b7781 (patch)
tree27dc58344c4b53258ec97e4f335cf04506c69d5e
parentSpecify indentation for static-if (diff)
downloadebuild-mode-4b112c7431b742c02a8bc3f246e687bf781b7781.tar.gz
ebuild-mode-4b112c7431b742c02a8bc3f246e687bf781b7781.tar.bz2
ebuild-mode-4b112c7431b742c02a8bc3f246e687bf781b7781.zip
Return a useful exit status for XEmacs tests
* test/xemacs-test-wrapper.el (kill-emacs): Return a useful exit status. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rw-r--r--test/xemacs-test-wrapper.el12
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fafb58..00840d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-08-26 Ulrich Müller <ulm@gentoo.org>
+
+ * test/xemacs-test-wrapper.el (kill-emacs): Return a useful exit
+ status.
+
2024-08-22 Ulrich Müller <ulm@gentoo.org>
* 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)))