From e34d7a7c4eb90cde7a2dc55ac5a02fae303e5d0f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 2 Mar 2025 21:00:48 +0800 Subject: [PATCH] ; Adapt more tests for Android * test/infra/android/test-controller.el (ats-eval): Document new values of ats-eval. (ats-run-test): Report conditions where tests induce Emacs to exit. * test/lisp/erc/resources/erc-tests-common.el (erc-tests-common-kill-buffers): Bind kill-buffer-query-functions to nil. --- test/infra/android/test-controller.el | 12 ++++++++---- test/lisp/erc/resources/erc-tests-common.el | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/infra/android/test-controller.el b/test/infra/android/test-controller.el index 4a8b592648b..44eb6ddef64 100644 --- a/test/infra/android/test-controller.el +++ b/test/infra/android/test-controller.el @@ -1922,10 +1922,11 @@ this machine and an SSH daemon be executing on the host)." "Evaluate FORM in PROCESS, which form must be printable. Form should evaluate to a value that must be printable, or signal an error. Value is (ok . VALUE) if no error was -signaled, or (error . VALUE) otherwise. If RAW, instruct -PROCESS not to attempt to decode the printed representation of -FORM as multibyte text; this does not influence the decoding -whatever value it returns. +signaled, or (error . VALUE) otherwise. It may also be (exit +. BACKTRACE) if Emacs exited whilst FORM was executing. If RAW, +instruct PROCESS not to attempt to decode the printed +representation of FORM as multibyte text; this does not +influence the decoding whatever value it returns. Set AS-PRINTED to insist that the value be returned as a string; this enables non-printable values to be returned in a meaningful @@ -2476,6 +2477,9 @@ Display the output of the tests executed in a buffer." (point-min) (point-max))))))) (cond ((eq (car rc) 'error) (error "Error executing `%s-tests.el': %S" test (cdr rc))) + ((eq (car rc) 'exit) + (message "Backtrace:\n%s" (cdr rc)) + (error "Remote Emacs exited inside `%s-tests.el'" test)) (t (progn (goto-char (point-max)) (insert (cdr rc)) diff --git a/test/lisp/erc/resources/erc-tests-common.el b/test/lisp/erc/resources/erc-tests-common.el index eedea8c44de..91e248a944f 100644 --- a/test/lisp/erc/resources/erc-tests-common.el +++ b/test/lisp/erc/resources/erc-tests-common.el @@ -75,7 +75,10 @@ Assign the result to `erc-server-process' in the current buffer." ;; `get-buffer-create' with INHIBIT-BUFFER-HOOKS. (defun erc-tests-common-kill-buffers (&rest extra-buffers) "Kill all ERC buffers and possibly EXTRA-BUFFERS." - (let (erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook) + (let (erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook + ;; To facilitate automatic testing when a fake-server has already + ;; been created by an earlier ERT test. + (kill-buffer-query-functions nil)) (dolist (buf (erc-buffer-list)) (kill-buffer buf)) (named-let doit ((buffers extra-buffers))