aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-02-20 15:08:00 +0100
committerMichael Albinus2014-02-20 15:08:00 +0100
commitd9386b0ca0ca420ab9f7ea1c41096707373ccd70 (patch)
tree00e4004f50bf1a0c02e269ad06d24bf733011f98
parentee0761cad38d5b4319806b04a9bcb081d0bdd993 (diff)
downloademacs-d9386b0ca0ca420ab9f7ea1c41096707373ccd70.tar.gz
emacs-d9386b0ca0ca420ab9f7ea1c41096707373ccd70.zip
* automated/tramp-tests.el (tramp--instrument-test-case): New macro.
(tramp-test17-insert-directory): First line could contain more text, when produced by `ls-lisp'. (tramp-test19-directory-files-and-attributes): Instrument failed test case.
-rw-r--r--test/ChangeLog8
-rw-r--r--test/automated/tramp-tests.el30
2 files changed, 30 insertions, 8 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index afb191a941a..67b83444e8f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,11 @@
12014-02-20 Michael Albinus <michael.albinus@gmx.de>
2
3 * automated/tramp-tests.el (tramp--instrument-test-case): New macro.
4 (tramp-test17-insert-directory): First line could contain more
5 text, when produced by `ls-lisp'.
6 (tramp-test19-directory-files-and-attributes): Instrument failed
7 test case.
8
12014-02-19 Michael Albinus <michael.albinus@gmx.de> 92014-02-19 Michael Albinus <michael.albinus@gmx.de>
2 10
3 * automated/tramp-tests.el (tramp-test17-insert-directory): 11 * automated/tramp-tests.el (tramp-test17-insert-directory):
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index bda37ea95f0..9e77c111f4d 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -89,6 +89,20 @@ being the result.")
89 (expand-file-name 89 (expand-file-name
90 (make-temp-name "tramp-test") tramp-test-temporary-file-directory)) 90 (make-temp-name "tramp-test") tramp-test-temporary-file-directory))
91 91
92(defmacro tramp--instrument-test-case (verbose &rest body)
93 "Run BODY with `tramp-verbose' equal VERBOSE.
94Print the the content of the Tramp debug buffer, if BODY does not
95eval properly in `should', `should-not' or `should-error'."
96 `(let ((tramp-verbose ,verbose))
97 (condition-case err
98 (progn ,@body)
99 (ert-test-failed
100 (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
101 (with-current-buffer (tramp-get-debug-buffer v)
102 (message "%s" (buffer-string))))
103 (signal (car err) (cdr err))))))
104(put 'tramp--instrument-test-case 'lisp-indent-function 1)
105
92(ert-deftest tramp-test00-availability () 106(ert-deftest tramp-test00-availability ()
93 "Test availability of Tramp functions." 107 "Test availability of Tramp functions."
94 :expected-result (if (tramp--test-enabled) :passed :failed) 108 :expected-result (if (tramp--test-enabled) :passed :failed)
@@ -823,7 +837,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
823 (goto-char (point-min)) 837 (goto-char (point-min))
824 (should 838 (should
825 (looking-at-p 839 (looking-at-p
826 "\\(total +[[:digit:]]+\n\\)?.+ \\.\n.+ \\.\\.\n.+ foo$")))) 840 "\\(total.+[[:digit:]]+\n\\)?.+ \\.\n.+ \\.\\.\n.+ foo$"))))
827 (ignore-errors (delete-directory tmp-name1 'recursive))))) 841 (ignore-errors (delete-directory tmp-name1 'recursive)))))
828 842
829(ert-deftest tramp-test18-file-attributes () 843(ert-deftest tramp-test18-file-attributes ()
@@ -891,13 +905,15 @@ This tests also `file-readable-p' and `file-regular-p'."
891 (setq attr (directory-files-and-attributes tmp-name)) 905 (setq attr (directory-files-and-attributes tmp-name))
892 (should (consp attr)) 906 (should (consp attr))
893 (dolist (elt attr) 907 (dolist (elt attr)
894 (should 908 (tramp--instrument-test-case 10
895 (equal (file-attributes (expand-file-name (car elt) tmp-name)) 909 (should
896 (cdr elt)))) 910 (equal (file-attributes (expand-file-name (car elt) tmp-name))
911 (cdr elt)))))
897 (setq attr (directory-files-and-attributes tmp-name 'full)) 912 (setq attr (directory-files-and-attributes tmp-name 'full))
898 (dolist (elt attr) 913 (dolist (elt attr)
899 (should 914 (tramp--instrument-test-case 10
900 (equal (file-attributes (car elt)) (cdr elt)))) 915 (should
916 (equal (file-attributes (car elt)) (cdr elt)))))
901 (setq attr (directory-files-and-attributes tmp-name nil "^b")) 917 (setq attr (directory-files-and-attributes tmp-name nil "^b"))
902 (should (equal (mapcar 'car attr) '("bar" "boz")))) 918 (should (equal (mapcar 'car attr) '("bar" "boz"))))
903 (ignore-errors (delete-directory tmp-name 'recursive))))) 919 (ignore-errors (delete-directory tmp-name 'recursive)))))
@@ -1344,8 +1360,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1344;; * set-file-acl 1360;; * set-file-acl
1345;; * set-file-selinux-context 1361;; * set-file-selinux-context
1346 1362
1347;; * Fix `tramp-test17-insert-directory' for
1348;; `ls-lisp-insert-directory' ("plink" and friends, tramp-gvfs.el).
1349;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). 1363;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?).
1350;; * Fix `tramp-test28-shell-command' on MS Windows (`process-send-eof'?). 1364;; * Fix `tramp-test28-shell-command' on MS Windows (`process-send-eof'?).
1351;; * Fix `tramp-test30-utf8' on MS Windows. Seems to be in `directory-files'. 1365;; * Fix `tramp-test30-utf8' on MS Windows. Seems to be in `directory-files'.