aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2022-09-17 17:50:38 +0200
committerMichael Albinus2022-09-17 17:50:38 +0200
commite2c3ce24023f8daee32d49b3724adbf43de9fc92 (patch)
treec092f1fdf2da5fe85ad20a62b85663a1b03979e8 /test
parent320f0cac8008a54b988c0166dbfd195f5de8790f (diff)
downloademacs-e2c3ce24023f8daee32d49b3724adbf43de9fc92.tar.gz
emacs-e2c3ce24023f8daee32d49b3724adbf43de9fc92.zip
Sync with Tramp 2.5.3.2. Don't merge with master
* doc/misc/tramp.texi (Android shell setup): Rework. (Frequently Asked Questions): Improve recommendations for speeding up. * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.5.4-pre". * lisp/net/tramp-adb.el (tramp-methods): Use "%d". (tramp-adb-handle-directory-files-and-attributes): Fix "." and ".." in listing. (tramp-adb-handle-file-attributes) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb-handle-file-name-all-completions): Pipe "ls" output through "cat", in order to avoid quoting special characters. (tramp-adb-maybe-open-connection): Compute args from `tramp-login-args'. * lisp/net/tramp-compat.el (tramp-compat-replace-regexp-in-region): New defalias. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): Adapt check for proper remote command. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-handle-make-process): Check for adb device if indicated. (tramp-get-remote-tmpdir): Cache result in temporary connection property. * test/lisp/net/tramp-tests.el (tramp-test17-insert-directory) (tramp-test22-file-times, tramp--test-utf8): Adapt tests. (tramp--test-shell-file-name): Do not depend on `tramp--test-adb-p'. (tramp-test46-unload): Ignore autoload functions in `tramp-file-name' structure tests, since `tramp-file-name-handler' is also autoloaded in Emacs 29.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el48
1 files changed, 27 insertions, 21 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index cee3651f213..06920ad5343 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3138,20 +3138,21 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
3138 (goto-char (point-min)) 3138 (goto-char (point-min))
3139 (should 3139 (should
3140 (looking-at-p (format "^.+ %s/$" (regexp-quote tmp-name1))))) 3140 (looking-at-p (format "^.+ %s/$" (regexp-quote tmp-name1)))))
3141 (with-temp-buffer 3141 (let ((directory-files (directory-files tmp-name1)))
3142 (insert-directory 3142 (with-temp-buffer
3143 (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) 3143 (insert-directory
3144 (goto-char (point-min)) 3144 (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p)
3145 (should 3145 (goto-char (point-min))
3146 (looking-at-p 3146 (should
3147 (concat 3147 (looking-at-p
3148 ;; There might be a summary line. 3148 (concat
3149 "\\(total.+[[:digit:]]+ ?[kKMGTPEZY]?i?B?\n\\)?" 3149 ;; There might be a summary line.
3150 ;; We don't know in which order ".", ".." and "foo" appear. 3150 "\\(total.+[[:digit:]]+ ?[kKMGTPEZY]?i?B?\n\\)?"
3151 (format 3151 ;; We don't know in which order ".", ".." and "foo" appear.
3152 "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" 3152 (format
3153 (regexp-opt (directory-files tmp-name1)) 3153 "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}"
3154 (length (directory-files tmp-name1))))))) 3154 (regexp-opt directory-files)
3155 (length directory-files)))))))
3155 3156
3156 ;; Check error cases. 3157 ;; Check error cases.
3157 (when (and (tramp--test-supports-set-file-modes-p) 3158 (when (and (tramp--test-supports-set-file-modes-p)
@@ -4005,7 +4006,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4005 (file-attributes tmp-name1)))) 4006 (file-attributes tmp-name1))))
4006 ;; Skip the test, if the remote handler is not able to set 4007 ;; Skip the test, if the remote handler is not able to set
4007 ;; the correct time. 4008 ;; the correct time.
4008 (skip-unless (set-file-times tmp-name1 (seconds-to-time 1))) 4009 ;; Some remote machines cannot resolve seconds. So we use a minute.
4010 (skip-unless (set-file-times tmp-name1 (seconds-to-time 60)))
4009 ;; Dumb remote shells without perl(1) or stat(1) are not 4011 ;; Dumb remote shells without perl(1) or stat(1) are not
4010 ;; able to return the date correctly. They say "don't know". 4012 ;; able to return the date correctly. They say "don't know".
4011 (unless (tramp-compat-time-equal-p 4013 (unless (tramp-compat-time-equal-p
@@ -4016,7 +4018,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4016 (tramp-compat-time-equal-p 4018 (tramp-compat-time-equal-p
4017 (tramp-compat-file-attribute-modification-time 4019 (tramp-compat-file-attribute-modification-time
4018 (file-attributes tmp-name1)) 4020 (file-attributes tmp-name1))
4019 (seconds-to-time 1))) 4021 (seconds-to-time 60)))
4020 (write-region "bla" nil tmp-name2) 4022 (write-region "bla" nil tmp-name2)
4021 (should (file-exists-p tmp-name2)) 4023 (should (file-exists-p tmp-name2))
4022 (should (file-newer-than-file-p tmp-name2 tmp-name1)) 4024 (should (file-newer-than-file-p tmp-name2 tmp-name1))
@@ -4027,12 +4029,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4027 ;; regular files, there shouldn't be a difference. 4029 ;; regular files, there shouldn't be a difference.
4028 (when (tramp--test-emacs28-p) 4030 (when (tramp--test-emacs28-p)
4029 (with-no-warnings 4031 (with-no-warnings
4030 (set-file-times tmp-name1 (seconds-to-time 1) 'nofollow) 4032 (set-file-times tmp-name1 (seconds-to-time 60) 'nofollow)
4031 (should 4033 (should
4032 (tramp-compat-time-equal-p 4034 (tramp-compat-time-equal-p
4033 (tramp-compat-file-attribute-modification-time 4035 (tramp-compat-file-attribute-modification-time
4034 (file-attributes tmp-name1)) 4036 (file-attributes tmp-name1))
4035 (seconds-to-time 1))))))) 4037 (seconds-to-time 60)))))))
4036 4038
4037 ;; Cleanup. 4039 ;; Cleanup.
4038 (ignore-errors 4040 (ignore-errors
@@ -4439,7 +4441,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4439 4441
4440(defun tramp--test-shell-file-name () 4442(defun tramp--test-shell-file-name ()
4441 "Return default remote shell." 4443 "Return default remote shell."
4442 (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh")) 4444 (if (file-exists-p
4445 (concat
4446 (file-remote-p tramp-test-temporary-file-directory) "/system/bin/sh"))
4447 "/system/bin/sh" "/bin/sh"))
4443 4448
4444(ert-deftest tramp-test28-process-file () 4449(ert-deftest tramp-test28-process-file ()
4445 "Check `process-file'." 4450 "Check `process-file'."
@@ -6815,7 +6820,8 @@ Use the \"ls\" command."
6815 "银河系漫游指南系列" 6820 "银河系漫游指南系列"
6816 "Автостопом по гала́ктике" 6821 "Автостопом по гала́ктике"
6817 ;; Use codepoints without a name. See Bug#31272. 6822 ;; Use codepoints without a name. See Bug#31272.
6818 "™›šbung" 6823 ;; Works on some Android systems only.
6824 (unless (tramp--test-adb-p) "™›šbung")
6819 ;; Use codepoints from Supplementary Multilingual Plane (U+10000 6825 ;; Use codepoints from Supplementary Multilingual Plane (U+10000
6820 ;; to U+1FFFF). 6826 ;; to U+1FFFF).
6821 "🌈🍒👋") 6827 "🌈🍒👋")
@@ -7354,7 +7360,7 @@ Since it unloads Tramp, it shall be the last test to run."
7354 (should-not (cl--find-class 'tramp-file-name)) 7360 (should-not (cl--find-class 'tramp-file-name))
7355 (mapatoms 7361 (mapatoms
7356 (lambda (x) 7362 (lambda (x)
7357 (and (functionp x) 7363 (and (functionp x) (null (autoloadp (symbol-function x)))
7358 (string-match-p "tramp-file-name" (symbol-name x)) 7364 (string-match-p "tramp-file-name" (symbol-name x))
7359 (ert-fail (format "Structure function `%s' still exists" x))))) 7365 (ert-fail (format "Structure function `%s' still exists" x)))))
7360 7366