diff options
| author | Eli Zaretskii | 2022-12-07 21:23:42 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-12-07 21:23:42 +0200 |
| commit | f7262b8f81e66a1963b020b1fe720575dc8aaba9 (patch) | |
| tree | 86e48fe4709d31b421fb570fb7ad652e34a731f4 | |
| parent | fef17557365010a03059f3954da89f74408b3485 (diff) | |
| download | emacs-f7262b8f81e66a1963b020b1fe720575dc8aaba9.tar.gz emacs-f7262b8f81e66a1963b020b1fe720575dc8aaba9.zip | |
Fix comint-tests on MS-Windows
* test/lisp/comint-tests.el (comint-tests/test-password-function):
On MS-Windows, call 'w32-native-executable-find' instead of
'executable-find', to find the native version of the 'cat'
program.
(w32-native-executable-p, w32-native-executable-find): New
functions.
| -rw-r--r-- | test/lisp/comint-tests.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el index 8402c13daf3..88427dd05b1 100644 --- a/test/lisp/comint-tests.el +++ b/test/lisp/comint-tests.el | |||
| @@ -59,9 +59,23 @@ | |||
| 59 | (dolist (str comint-testsuite-password-strings) | 59 | (dolist (str comint-testsuite-password-strings) |
| 60 | (should (string-match comint-password-prompt-regexp str)))) | 60 | (should (string-match comint-password-prompt-regexp str)))) |
| 61 | 61 | ||
| 62 | (declare-function 'w32-application-type "w32proc.c") | ||
| 63 | (defun w32-native-executable-p (fname) | ||
| 64 | "Predicate to test program FNAME for being a native Windows application." | ||
| 65 | (and (memq (w32-application-type fname) '(w32-native dos)) | ||
| 66 | (file-executable-p fname))) | ||
| 67 | |||
| 68 | (defun w32-native-executable-find (name) | ||
| 69 | "Find a native MS-Windows application named NAME. | ||
| 70 | This is needed to avoid invoking MSYS or Cygwin executables that | ||
| 71 | happen to lurk on PATH when running the test suite." | ||
| 72 | (locate-file name exec-path exec-suffixes 'w32-native-executable-p)) | ||
| 73 | |||
| 62 | (defun comint-tests/test-password-function (password-function) | 74 | (defun comint-tests/test-password-function (password-function) |
| 63 | "PASSWORD-FUNCTION can return nil or a string." | 75 | "PASSWORD-FUNCTION can return nil or a string." |
| 64 | (when-let ((cat (executable-find "cat"))) | 76 | (when-let ((cat (if (eq system-type 'windows-nt) |
| 77 | (w32-native-executable-find "cat") | ||
| 78 | (executable-find "cat")))) | ||
| 65 | (let ((comint-password-function password-function)) | 79 | (let ((comint-password-function password-function)) |
| 66 | (cl-letf (((symbol-function 'read-passwd) | 80 | (cl-letf (((symbol-function 'read-passwd) |
| 67 | (lambda (&rest _args) "non-nil"))) | 81 | (lambda (&rest _args) "non-nil"))) |