diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index de85f83982c..1f56baad7ce 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -75,6 +75,7 @@ | |||
| 75 | ;; Needed for Emacs 26. | 75 | ;; Needed for Emacs 26. |
| 76 | (defvar async-shell-command-width) | 76 | (defvar async-shell-command-width) |
| 77 | ;; Needed for Emacs 27. | 77 | ;; Needed for Emacs 27. |
| 78 | (defvar process-file-return-signal-string) | ||
| 78 | (defvar shell-command-dont-erase-buffer) | 79 | (defvar shell-command-dont-erase-buffer) |
| 79 | 80 | ||
| 80 | ;; Beautify batch mode. | 81 | ;; Beautify batch mode. |
| @@ -4208,18 +4209,27 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4208 | (should (zerop (process-file "true"))) | 4209 | (should (zerop (process-file "true"))) |
| 4209 | (should-not (zerop (process-file "false"))) | 4210 | (should-not (zerop (process-file "false"))) |
| 4210 | (should-not (zerop (process-file "binary-does-not-exist"))) | 4211 | (should-not (zerop (process-file "binary-does-not-exist"))) |
| 4211 | (should | 4212 | ;; Return exit code. |
| 4212 | (= 42 | 4213 | (should (= 42 (process-file |
| 4214 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | ||
| 4215 | nil nil nil "-c" "exit 42"))) | ||
| 4216 | ;; Return exit code in case the process is interrupted, | ||
| 4217 | ;; and there's no indication for a signal describing string. | ||
| 4218 | (let (process-file-return-signal-string) | ||
| 4219 | (should | ||
| 4220 | (= (+ 128 2) | ||
| 4221 | (process-file | ||
| 4222 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | ||
| 4223 | nil nil nil "-c" "kill -2 $$")))) | ||
| 4224 | ;; Return string in case the process is interrupted and | ||
| 4225 | ;; there's an indication for a signal describing string. | ||
| 4226 | (let ((process-file-return-signal-string t)) | ||
| 4227 | (should | ||
| 4228 | (string-equal | ||
| 4229 | "Interrupt" | ||
| 4213 | (process-file | 4230 | (process-file |
| 4214 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | 4231 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") |
| 4215 | nil nil nil "-c" "exit 42"))) | 4232 | nil nil nil "-c" "kill -2 $$")))) |
| 4216 | ;; Return string in case the process is interrupted. | ||
| 4217 | (should | ||
| 4218 | (string-equal | ||
| 4219 | "Signal 2" | ||
| 4220 | (process-file | ||
| 4221 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | ||
| 4222 | nil nil nil "-c" "kill -2 $$"))) | ||
| 4223 | 4233 | ||
| 4224 | (with-temp-buffer | 4234 | (with-temp-buffer |
| 4225 | (write-region "foo" nil tmp-name) | 4235 | (write-region "foo" nil tmp-name) |