diff options
| author | Michael Albinus | 2014-02-19 20:28:32 +0100 |
|---|---|---|
| committer | Michael Albinus | 2014-02-19 20:28:32 +0100 |
| commit | 76c92fdd00fdfe12ecf899132db195eda0b18602 (patch) | |
| tree | 99d43805364691c0974acc81cf84aea05e4fc06a | |
| parent | 50bfdd5d78aa015d9032da7e6376665243f3f3b1 (diff) | |
| download | emacs-76c92fdd00fdfe12ecf899132db195eda0b18602.tar.gz emacs-76c92fdd00fdfe12ecf899132db195eda0b18602.zip | |
* automated/tramp-tests.el (tramp-test17-insert-directory):
Make first line "total 123" optional.
(tramp-test20-file-modes, tramp-test22-file-times)
(tramp-test26-process-file, tramp-test27-start-file-process)
(tramp-test28-shell-command): Skip for tramp-gvfs.el and
tramp-smb.el.
(tramp-test20-file-modes): Check for "root" only when there is an
explicit user name.
(tramp-test21-file-links): Handle "... not supported" error.
(tramp-test22-file-times): Skip for "don't know" return values.
(tramp-test26-process-file, tramp-test28-shell-command):
Remove color escape sequences.
(tramp-test28-shell-command): Use `accept-process-output' rather
than `sit-for'.
(tramp-test30-utf8): Set coding system `utf-8'.
| -rw-r--r-- | test/ChangeLog | 18 | ||||
| -rw-r--r-- | test/automated/tramp-tests.el | 74 |
2 files changed, 81 insertions, 11 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index f21b2e16118..afb191a941a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2014-02-19 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * automated/tramp-tests.el (tramp-test17-insert-directory): | ||
| 4 | Make first line "total 123" optional. | ||
| 5 | (tramp-test20-file-modes, tramp-test22-file-times) | ||
| 6 | (tramp-test26-process-file, tramp-test27-start-file-process) | ||
| 7 | (tramp-test28-shell-command): Skip for tramp-gvfs.el and | ||
| 8 | tramp-smb.el. | ||
| 9 | (tramp-test20-file-modes): Check for "root" only when there is an | ||
| 10 | explicit user name. | ||
| 11 | (tramp-test21-file-links): Handle "... not supported" error. | ||
| 12 | (tramp-test22-file-times): Skip for "don't know" return values. | ||
| 13 | (tramp-test26-process-file, tramp-test28-shell-command): | ||
| 14 | Remove color escape sequences. | ||
| 15 | (tramp-test28-shell-command): Use `accept-process-output' rather | ||
| 16 | than `sit-for'. | ||
| 17 | (tramp-test30-utf8): Set coding system `utf-8'. | ||
| 18 | |||
| 1 | 2014-02-17 Michael Albinus <michael.albinus@gmx.de> | 19 | 2014-02-17 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 20 | ||
| 3 | * automated/tramp-tests.el (tramp-test28-shell-command): Perform | 21 | * automated/tramp-tests.el (tramp-test28-shell-command): Perform |
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index f71f7ee239b..bda37ea95f0 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el | |||
| @@ -822,7 +822,8 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 822 | (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) | 822 | (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) |
| 823 | (goto-char (point-min)) | 823 | (goto-char (point-min)) |
| 824 | (should | 824 | (should |
| 825 | (looking-at-p "total +[[:digit:]]+\n.+ \\.\n.+ \\.\\.\n.+ foo$")))) | 825 | (looking-at-p |
| 826 | "\\(total +[[:digit:]]+\n\\)?.+ \\.\n.+ \\.\\.\n.+ foo$")))) | ||
| 826 | (ignore-errors (delete-directory tmp-name1 'recursive))))) | 827 | (ignore-errors (delete-directory tmp-name1 'recursive))))) |
| 827 | 828 | ||
| 828 | (ert-deftest tramp-test18-file-attributes () | 829 | (ert-deftest tramp-test18-file-attributes () |
| @@ -905,6 +906,11 @@ This tests also `file-readable-p' and `file-regular-p'." | |||
| 905 | "Check `file-modes'. | 906 | "Check `file-modes'. |
| 906 | This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | 907 | This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." |
| 907 | (skip-unless (tramp--test-enabled)) | 908 | (skip-unless (tramp--test-enabled)) |
| 909 | (skip-unless | ||
| 910 | (not | ||
| 911 | (memq | ||
| 912 | (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) | ||
| 913 | '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) | ||
| 908 | (tramp-cleanup-connection | 914 | (tramp-cleanup-connection |
| 909 | (tramp-dissect-file-name tramp-test-temporary-file-directory) | 915 | (tramp-dissect-file-name tramp-test-temporary-file-directory) |
| 910 | nil 'keep-password) | 916 | nil 'keep-password) |
| @@ -922,7 +928,8 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 922 | (should (= (file-modes tmp-name) #o444)) | 928 | (should (= (file-modes tmp-name) #o444)) |
| 923 | (should-not (file-executable-p tmp-name)) | 929 | (should-not (file-executable-p tmp-name)) |
| 924 | ;; A file is always writable for user "root". | 930 | ;; A file is always writable for user "root". |
| 925 | (unless (string-equal (file-remote-p tmp-name 'user) "root") | 931 | (when (and (stringp (file-remote-p tmp-name 'user)) |
| 932 | (not (string-equal (file-remote-p tmp-name 'user) "root"))) | ||
| 926 | (should-not (file-writable-p tmp-name)))) | 933 | (should-not (file-writable-p tmp-name)))) |
| 927 | (ignore-errors (delete-file tmp-name))))) | 934 | (ignore-errors (delete-file tmp-name))))) |
| 928 | 935 | ||
| @@ -941,7 +948,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 941 | (progn | 948 | (progn |
| 942 | (write-region "foo" nil tmp-name1) | 949 | (write-region "foo" nil tmp-name1) |
| 943 | (should (file-exists-p tmp-name1)) | 950 | (should (file-exists-p tmp-name1)) |
| 944 | (make-symbolic-link tmp-name1 tmp-name2) | 951 | ;; Method "smb" supports `make-symbolic-link' only if the |
| 952 | ;; remote host has CIFS capabilities. tramp-adb.el and | ||
| 953 | ;; tramp-gvfs.el do not support symbolic links at all. | ||
| 954 | (condition-case err | ||
| 955 | (make-symbolic-link tmp-name1 tmp-name2) | ||
| 956 | (file-error | ||
| 957 | (skip-unless | ||
| 958 | (not (string-equal (error-message-string err) | ||
| 959 | "make-symbolic-link not supported"))))) | ||
| 945 | (should (file-symlink-p tmp-name2)) | 960 | (should (file-symlink-p tmp-name2)) |
| 946 | (should-error (make-symbolic-link tmp-name1 tmp-name2)) | 961 | (should-error (make-symbolic-link tmp-name1 tmp-name2)) |
| 947 | (make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists) | 962 | (make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists) |
| @@ -983,6 +998,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 983 | (ert-deftest tramp-test22-file-times () | 998 | (ert-deftest tramp-test22-file-times () |
| 984 | "Check `set-file-times' and `file-newer-than-file-p'." | 999 | "Check `set-file-times' and `file-newer-than-file-p'." |
| 985 | (skip-unless (tramp--test-enabled)) | 1000 | (skip-unless (tramp--test-enabled)) |
| 1001 | (skip-unless | ||
| 1002 | (not | ||
| 1003 | (memq | ||
| 1004 | (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) | ||
| 1005 | '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) | ||
| 986 | (tramp-cleanup-connection | 1006 | (tramp-cleanup-connection |
| 987 | (tramp-dissect-file-name tramp-test-temporary-file-directory) | 1007 | (tramp-dissect-file-name tramp-test-temporary-file-directory) |
| 988 | nil 'keep-password) | 1008 | nil 'keep-password) |
| @@ -997,6 +1017,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 997 | (should (consp (nth 5 (file-attributes tmp-name1)))) | 1017 | (should (consp (nth 5 (file-attributes tmp-name1)))) |
| 998 | ;; '(0 0) means don't know, and will be replaced by `current-time'. | 1018 | ;; '(0 0) means don't know, and will be replaced by `current-time'. |
| 999 | (set-file-times tmp-name1 '(0 1)) | 1019 | (set-file-times tmp-name1 '(0 1)) |
| 1020 | ;; Dumb busyboxes are not able to return the date correctly. | ||
| 1021 | ;; They say "don't know. | ||
| 1022 | (skip-unless (not (equal (nth 5 (file-attributes tmp-name1)) '(0 0)))) | ||
| 1000 | (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1))) | 1023 | (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1))) |
| 1001 | (write-region "bla" nil tmp-name2) | 1024 | (write-region "bla" nil tmp-name2) |
| 1002 | (should (file-exists-p tmp-name2)) | 1025 | (should (file-exists-p tmp-name2)) |
| @@ -1077,6 +1100,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1077 | (ert-deftest tramp-test26-process-file () | 1100 | (ert-deftest tramp-test26-process-file () |
| 1078 | "Check `process-file'." | 1101 | "Check `process-file'." |
| 1079 | (skip-unless (tramp--test-enabled)) | 1102 | (skip-unless (tramp--test-enabled)) |
| 1103 | (skip-unless | ||
| 1104 | (not | ||
| 1105 | (memq | ||
| 1106 | (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) | ||
| 1107 | '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) | ||
| 1080 | (tramp-cleanup-connection | 1108 | (tramp-cleanup-connection |
| 1081 | (tramp-dissect-file-name tramp-test-temporary-file-directory) | 1109 | (tramp-dissect-file-name tramp-test-temporary-file-directory) |
| 1082 | nil 'keep-password) | 1110 | nil 'keep-password) |
| @@ -1096,6 +1124,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1096 | (should | 1124 | (should |
| 1097 | (zerop | 1125 | (zerop |
| 1098 | (process-file "ls" nil t nil (file-name-nondirectory tmp-name)))) | 1126 | (process-file "ls" nil t nil (file-name-nondirectory tmp-name)))) |
| 1127 | ;; `ls' could produce colorized output. | ||
| 1128 | (goto-char (point-min)) | ||
| 1129 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | ||
| 1130 | (replace-match "" nil nil)) | ||
| 1099 | (should | 1131 | (should |
| 1100 | (string-equal | 1132 | (string-equal |
| 1101 | (format "%s\n" (file-name-nondirectory tmp-name)) | 1133 | (format "%s\n" (file-name-nondirectory tmp-name)) |
| @@ -1105,6 +1137,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1105 | (ert-deftest tramp-test27-start-file-process () | 1137 | (ert-deftest tramp-test27-start-file-process () |
| 1106 | "Check `start-file-process'." | 1138 | "Check `start-file-process'." |
| 1107 | (skip-unless (tramp--test-enabled)) | 1139 | (skip-unless (tramp--test-enabled)) |
| 1140 | (skip-unless | ||
| 1141 | (not | ||
| 1142 | (memq | ||
| 1143 | (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) | ||
| 1144 | '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) | ||
| 1108 | (tramp-cleanup-connection | 1145 | (tramp-cleanup-connection |
| 1109 | (tramp-dissect-file-name tramp-test-temporary-file-directory) | 1146 | (tramp-dissect-file-name tramp-test-temporary-file-directory) |
| 1110 | nil 'keep-password) | 1147 | nil 'keep-password) |
| @@ -1153,6 +1190,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1153 | (ert-deftest tramp-test28-shell-command () | 1190 | (ert-deftest tramp-test28-shell-command () |
| 1154 | "Check `shell-command'." | 1191 | "Check `shell-command'." |
| 1155 | (skip-unless (tramp--test-enabled)) | 1192 | (skip-unless (tramp--test-enabled)) |
| 1193 | (skip-unless | ||
| 1194 | (not | ||
| 1195 | (memq | ||
| 1196 | (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) | ||
| 1197 | '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) | ||
| 1156 | (tramp-cleanup-connection | 1198 | (tramp-cleanup-connection |
| 1157 | (tramp-dissect-file-name tramp-test-temporary-file-directory) | 1199 | (tramp-dissect-file-name tramp-test-temporary-file-directory) |
| 1158 | nil 'keep-password) | 1200 | nil 'keep-password) |
| @@ -1165,6 +1207,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1165 | (should (file-exists-p tmp-name)) | 1207 | (should (file-exists-p tmp-name)) |
| 1166 | (shell-command | 1208 | (shell-command |
| 1167 | (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) | 1209 | (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) |
| 1210 | ;; `ls' could produce colorized output. | ||
| 1211 | (goto-char (point-min)) | ||
| 1212 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | ||
| 1213 | (replace-match "" nil nil)) | ||
| 1168 | (should | 1214 | (should |
| 1169 | (string-equal | 1215 | (string-equal |
| 1170 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) | 1216 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) |
| @@ -1176,11 +1222,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1176 | (should (file-exists-p tmp-name)) | 1222 | (should (file-exists-p tmp-name)) |
| 1177 | (async-shell-command | 1223 | (async-shell-command |
| 1178 | (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) | 1224 | (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) |
| 1179 | (sit-for 1 'nodisplay) | 1225 | (accept-process-output (get-buffer-process (current-buffer)) 1) |
| 1180 | (while (ignore-errors | 1226 | (while (ignore-errors |
| 1181 | (memq (process-status (get-buffer-process (current-buffer))) | 1227 | (memq (process-status (get-buffer-process (current-buffer))) |
| 1182 | '(run open))) | 1228 | '(run open))) |
| 1183 | (sit-for 1 'nodisplay)) | 1229 | (accept-process-output (get-buffer-process (current-buffer)) 1)) |
| 1230 | ;; `ls' could produce colorized output. | ||
| 1231 | (goto-char (point-min)) | ||
| 1232 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | ||
| 1233 | (replace-match "" nil nil)) | ||
| 1184 | (should | 1234 | (should |
| 1185 | (string-equal | 1235 | (string-equal |
| 1186 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) | 1236 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) |
| @@ -1194,11 +1244,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1194 | (process-send-string | 1244 | (process-send-string |
| 1195 | (get-buffer-process (current-buffer)) | 1245 | (get-buffer-process (current-buffer)) |
| 1196 | (format "%s\n" (file-name-nondirectory tmp-name))) | 1246 | (format "%s\n" (file-name-nondirectory tmp-name))) |
| 1197 | (sit-for 1 'nodisplay) | 1247 | (accept-process-output (get-buffer-process (current-buffer)) 1) |
| 1198 | (while (ignore-errors | 1248 | (while (ignore-errors |
| 1199 | (memq (process-status (get-buffer-process (current-buffer))) | 1249 | (memq (process-status (get-buffer-process (current-buffer))) |
| 1200 | '(run open))) | 1250 | '(run open))) |
| 1201 | (sit-for 1 'nodisplay)) | 1251 | (accept-process-output (get-buffer-process (current-buffer)) 1)) |
| 1202 | (should | 1252 | (should |
| 1203 | (string-equal | 1253 | (string-equal |
| 1204 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) | 1254 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) |
| @@ -1260,6 +1310,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1260 | nil 'keep-password) | 1310 | nil 'keep-password) |
| 1261 | 1311 | ||
| 1262 | (let ((tmp-name (tramp--test-make-temp-name)) | 1312 | (let ((tmp-name (tramp--test-make-temp-name)) |
| 1313 | (coding-system-for-read 'utf-8) | ||
| 1314 | (coding-system-for-write 'utf-8) | ||
| 1263 | (arabic "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") | 1315 | (arabic "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") |
| 1264 | (chinese "银河系漫游指南系列") | 1316 | (chinese "银河系漫游指南系列") |
| 1265 | (russian "Автостопом по гала́ктике")) | 1317 | (russian "Автостопом по гала́ктике")) |
| @@ -1293,10 +1345,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1293 | ;; * set-file-selinux-context | 1345 | ;; * set-file-selinux-context |
| 1294 | 1346 | ||
| 1295 | ;; * Fix `tramp-test17-insert-directory' for | 1347 | ;; * Fix `tramp-test17-insert-directory' for |
| 1296 | ;; `ls-lisp-insert-directory' ("plink" and friends). | 1348 | ;; `ls-lisp-insert-directory' ("plink" and friends, tramp-gvfs.el). |
| 1297 | ;; * Fix `tramp-test27-start-file-process' on MS Windows | 1349 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). |
| 1298 | ;; (`process-send-eof'?). | 1350 | ;; * Fix `tramp-test28-shell-command' on MS Windows (`process-send-eof'?). |
| 1299 | ;; * Fix `tramp-test29-utf8' on MS Windows. | 1351 | ;; * Fix `tramp-test30-utf8' on MS Windows. Seems to be in `directory-files'. |
| 1300 | 1352 | ||
| 1301 | (defun tramp-test-all (&optional interactive) | 1353 | (defun tramp-test-all (&optional interactive) |
| 1302 | "Run all tests for \\[tramp]." | 1354 | "Run all tests for \\[tramp]." |