Commit graph

19 commits

Author SHA1 Message Date
Po Lu
426a016d61 ; * test/infra/android/test-controller.el (ats-eval): Correct punctuation. 2025-04-10 18:19:28 +08:00
Po Lu
5d02ca181d ; New bisect' argument to ats-execute-tests-batch'
* test/infra/android/test-controller.el
(ats-execute-tests-batch): New argument `bisect'.
2025-03-16 20:14:34 +08:00
Mattias Engdegård
773108fc04 ; * test/infra/android/test-controller.el: minor regexp snags 2025-03-03 10:49:09 +01:00
Stefan Kangas
56202138a3 ; Add missing lexical-binding cookies 2025-03-02 19:46:15 +01:00
Po Lu
e34d7a7c4e ; 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.
2025-03-02 21:02:10 +08:00
Po Lu
749e33bb48 Specifically report attempts to exit Emacs during test execution
* test/infra/android/test-driver.el (ats-in-eval): Fix typo in
doc string.
(ats-eval-as-printed, ats-eval-serial, ats-eval-do-decode):
Render buffer-local.
(ats-executing-form): New variable.
(ats-process-filter): Bind the same around `eval'.
(ats-kill-emacs-function): New function; register it to execute
when Emacs exits.
2025-03-02 21:02:10 +08:00
Po Lu
c73003ade1 Don't byte compile early-init.el
* test/infra/android/early-init.el (frame-initialize): Remove
redundant debugging printouts.
2025-03-02 19:23:44 +08:00
Po Lu
8e007f7990 ; * test/infra/android/test-driver.el: Don't byte-compile. 2025-03-02 19:15:48 +08:00
Stefan Kangas
c4232a08f1 ; Silence byte-compiler in Android tests 2025-03-02 09:19:54 +01:00
Po Lu
a8988ce800 Run Android tests in the initial frame
* test/infra/android/early-init.el: New file.

* test/infra/android/test-controller.el (ats-connect): Upload
`early-init.el' to the staging directory and configure that
directory as the Emacs instance's initialization directory.
(ats-run-test): Always append to the test buffer.  Execute tests
within terminal-frame.
(ats-run-all-tests): Gracefully respond to errors.
(ats-cmd-error): New function.
(ats-execute-tests-batch): Accept a number of command line
arguments.
2025-03-02 16:05:04 +08:00
Po Lu
7ae069b676 ; * test/infra/android/test-controller.el: Fix typos. 2025-02-26 21:22:03 +08:00
Po Lu
67b444e290 ; New function for executing Android tests in batch mode
* test/infra/android/test-controller.el
(ats-execute-tests-batch): New function.
2025-02-26 20:58:01 +08:00
Po Lu
3e496fc317 Port Eshell tests to Android
* test/infra/android/test-controller.el (ats-run-test): Run
tests in a temp buffer.

* test/lisp/eshell/em-alias-tests.el (ert, em-alias)
(eshell-tests-helpers):

* test/lisp/eshell/em-basic-tests.el (em-basic)
(eshell-tests-helpers):

* test/lisp/eshell/em-cmpl-tests.el (em-unix)
(eshell-tests-helpers):

* test/lisp/eshell/em-dirs-tests.el (em-dirs)
(eshell-tests-helpers):

* test/lisp/eshell/em-extpipe-tests.el (ert-x)
(eshell-tests-helpers):

* test/lisp/eshell/em-glob-tests.el (ert, eshell-tests-helpers):

* test/lisp/eshell/em-hist-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/em-pred-tests.el (em-pred)
(eshell-tests-helpers):

* test/lisp/eshell/em-prompt-tests.el (em-prompt)
(eshell-tests-helpers):

* test/lisp/eshell/em-script-tests.el (em-script)
(eshell-tests-helpers):

* test/lisp/eshell/em-unix-tests.el (ert-x)
(eshell-tests-helpers):

* test/lisp/eshell/esh-arg-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-cmd-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-ext-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-io-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-mode-tests.el (em-prompt)
(eshell-tests-helpers):

* test/lisp/eshell/esh-proc-tests.el (em-prompt)
(eshell-tests-helpers):

* test/lisp/eshell/esh-util-tests.el (esh-util)
(eshell-tests-helpers):

* test/lisp/eshell/esh-var-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/eshell-tests.el (esh-mode)
(eshell-tests-helpers): Load `eshell-tests-helpers' from the
resource directory.

* test/lisp/eshell/resources/eshell-tests-helpers.el: Move from
`test/lisp/eshell'.
2025-02-26 20:58:01 +08:00
Po Lu
2938afab36 Adapt a number of regression tests to Android
* 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.
2025-02-26 11:33:35 +08:00
Po Lu
c2804f9280 ; Improve Android testing facilities
* test/infra/android/test-controller.el (ats-eval): Don't block
other processes.
(ats-run-test): Bind ert-remote-temporary-file-directory to nil
and always print messages into the output buffer.
(ats-upload-all-tests): New function.
(ats-run-all-tests): New argument SELECTOR.  Only execute
already uploaded tests.
2025-02-26 10:39:46 +08:00
Po Lu
5ea0cee19a Respect temporary-file-directory in Android test controller
* test/infra/android/test-controller.el (ats-exec-script):
Respect temporary-file-directory.
2025-02-25 23:20:31 +08:00
Po Lu
55768eaaaa Implement commands for executing all tests on connected Android devices
* test/infra/android/test-controller.el (ats-upload-test):
Correct minor encoding error.  Transfer solitary files without
creating a tar archive, and handle `resources' directories.
(ats-list-tests-locally, ats-list-tests): Don't list files in
`resources' directories.  Insert test header locally, and
redisplay after insertion.
(ats-run-all-tests): New function.
2025-02-25 22:35:00 +08:00
Po Lu
93a185a1fb ; Improve Android regression test execution facilities
* test/infra/android/test-controller.el
(ats-associated-process): New variable.
(ats-start-server): Set coding system to `no-conversion'.
(ats-read-connection): If this buffer is associated with a
connection, return the same.
(ats-establish-connection): New arg INTERACTIVE.  Interactively,
open a Lisp interaction buffer with this connection as its
associated process.
(ats-connect): Provide this argument if called interactively.
(ats-eval): New argument RAW.  Request that encoded forms not be
decoded if specified, and decode results.
(ats-remote-eval-defuns, ats-remote-eval-print-sexp)
(ats-remote-eval-for-interaction)
(ats-remote-eval-print-last-sexp, ats-remote-eval-last-sexp)
(ats-remote-eval-defun, ats-remote-eval-region-or-buffer)
(ats-lisp-interaction-mode-map, ats-lisp-interaction-mode-menu)
(ats-lisp-interaction-mode, ats-open-lisp-interaction-buffer)
(ats-emacs-test-directory, ats-upload-test)
(ats-list-tests-locally, ats-list-tests, ats-run-test): New
functions and variables.

* test/infra/android/test-driver.el (ats-eval-do-decode): New
variable.
(ats-process-filter, ats-establish-connection)
(ats-initiate-connection): Adjust correspondingly.
2025-02-25 19:13:24 +08:00
Po Lu
08077788db ; Begin integrating facilities for executing ERT tests on Android
* test/infra/android/README:

* test/infra/android/bin/AtsStub.java (AtsStub):

* test/infra/android/bin/README:

* test/infra/android/test-controller.el (tramp)
(ats-adb-executable, ats-adb-host, ats-adb-infile, ats-cache)
(ats-adb-disable-stderr, ats-adb-device-regexp, ats-adb)
(ats-adb-process-filter, ats-start-adb, ats-enumerate-devices)
(ats-online-devices, ats-memoize, ats-ps-device, ats-getprop)
(ats-get-sdk-version, ats-package-list-regexp)
(ats-is-package-debuggable, ats-list-users, ats-get-package-aid)
(ats-aid-user-offset, ats-aid-isolated-start, ats-aid-app-start)
(ats-aid-to-uid, ats-uid-to-username, ats-verify-directory)
(ats-get-package-data-directory)
(ats-get-user-external-storage-directory, ats-transfer-padding)
(ats-exec-script, ats-exec-script-checked)
(ats-use-private-staging-directory, ats-get-staging-directory)
(ats-base64-available, ats-echo-n-e, ats-echo-c, ats-octab, c)
(ats-upload-encode-binary, ats-upload, ats-download)
(ats-create-empty-temporary, ats-run-jar)
(ats-supports-am-force-stop, ats-supports-am-force-stop-user)
(ats-kill-process-by-username-and-name)
(ats-portforward-local-type-regexp)
(ats-portforward-remote-type-regexp, ats-portforward-list-regexp)
(ats-portreverse-type-regexp, ats-portreverse-list-regexp)
(ats-reverse-list, ats-reverse-tcp, ats-forward-list)
(ats-forward-tcp, ats-is-tail-available, ats-java-int-min)
(ats-java-int-max, ats-java-long-min, ats-java-long-max)
(ats-intent-array-type, ats-fmt-array-element, ats-build-intent)
(ats-working-stub-file, ats-file-directory, ats-am-start-intent)
(ats-create-commfile, ats-watch-commfile, ats-server)
(ats-default-port, ats-accepting-connection)
(ats-address-to-hostname, ats-is-localhost-p)
(ats-server-sentinel, ats-server-log, ats-server-exists-p)
(ats-start-server, ats-await-connection-timeout)
(ats-await-connection, ats-forward-server-sentinel)
(ats-forward-server-filter, ats-reverse-server)
(ats-forward-server, ats-cancel-forward-server, ats-remote-port)
(ats-in-connection-context, ats-outstanding-reverse-connection)
(ats-terminate-reverse-safely, ats-disconnect-internal)
(ats-read-connection, ats-disconnect, ats-establish-connection)
(ats-connect, ats-eval, test-controller):

* test/infra/android/test-driver.el (ats-process)
(ats-connection-established, ats-header, ats-in-eval)
(ats-eval-as-printed, ats-eval-serial, ats-process-filter)
(ats-display-status-buffer, ats-establish-connection)
(ats-driver-log, ats-initiate-connection, test-driver): New
files.
2025-02-25 09:15:35 +08:00