]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt a number of regression tests to Android
authorPo Lu <luangruo@yahoo.com>
Wed, 26 Feb 2025 03:33:05 +0000 (11:33 +0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 26 Feb 2025 09:42:24 +0000 (10:42 +0100)
* test/infra/android/test-controller.el (ats-run-test): Strip
text properties from value string.  Inhibit text conversion.

* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--locate-symbols):

* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display)
(test-read-multiple-choice, test-read-multiple-choice-help):
Skip on Android in some wise or another.

(cherry picked from commit 2938afab3685f29c80d67f179ce8a935f6c27921)

test/infra/android/test-controller.el
test/lisp/emacs-lisp/find-func-tests.el
test/lisp/emacs-lisp/rmc-tests.el

index be4fc4586d71e409771e4b71c95a3ce635a85940..89b9b93f7b1d4ff6f29f8a15fe9bd32fc424ef02 100644 (file)
@@ -2436,6 +2436,7 @@ Display the output of the tests executed in a buffer."
                                     ;; present...
                                     (ert-remote-temporary-file-directory
                                      null-device)
+                                    (overriding-text-conversion-style nil)
                                     (set-message-function
                                      (lambda (message)
                                        (with-current-buffer temp-buffer
@@ -2443,7 +2444,8 @@ Display the output of the tests executed in a buffer."
                                (let ((noninteractive t))
                                  (ert-run-tests-batch ',selector))
                                (insert "=== Test execution complete ===\n")
-                               (buffer-string))))))
+                               (buffer-substring-no-properties
+                                (point-min) (point-max)))))))
       (cond ((eq (car rc) 'error)
             (error "Error executing `%s-tests.el': %S" test (cdr rc)))
            (t (progn
index 47190873ec3f5285516597756a4b6550835dc404..884e698bc762062bd136a138f4800a47ceeb3cad 100644 (file)
@@ -30,6 +30,8 @@
 (require 'find-func)
 
 (ert-deftest find-func-tests--locate-symbols ()
+  ;; C source files are unavailable when testing on Android.
+  (skip-when (featurep 'android))
   (should (cdr
            (find-function-search-for-symbol
             #'goto-line nil "simple")))
index d91704423c896441ffea8224e8567f58d3fe5bfe..de705691ced416cf881940c6c06af40f01cfb8e6 100644 (file)
@@ -30,6 +30,7 @@
 (eval-when-compile (require 'cl-lib))
 
 (ert-deftest test-rmc--add-key-description ()
+  (skip-when (display-graphic-p))
   (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) t)))
     (should (equal (rmc--add-key-description '(?y "yes"))
                    '(?y . "yes")))
@@ -50,6 +51,7 @@
            `(?\s . ,(concat (propertize "SPC" 'face 'read-multiple-choice) " foo bar")))))
 
 (ert-deftest test-read-multiple-choice ()
+  (skip-when (display-graphic-p))
   (dolist (char '(?y ?n))
     (cl-letf* (((symbol-function #'read-key) (lambda () char))
                (str (if (eq char ?y) "yes" "no")))