From: Michael Albinus Date: Fri, 30 Mar 2018 10:36:07 +0000 (+0200) Subject: Improve Tramp test performance X-Git-Tag: emacs-27.0.90~5363 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef0617888c452d1a62d354b3d866f17eea2e1ced;p=emacs.git Improve Tramp test performance * lisp/net/tramp.el (tramp-backtrace): Improve performance. * test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules): Skip for older Emacsen. (tramp-test39-utf8): Remove instrumentation. --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 43b5e77428a..52ff021c500 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1691,10 +1691,11 @@ applicable)." "Dump a backtrace into the debug buffer. If VEC-OR-PROC is nil, the buffer *debug tramp* is used. This function is meant for debugging purposes." - (if vec-or-proc - (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))) - (if (>= tramp-verbose 10) - (with-output-to-temp-buffer "*debug tramp*" (backtrace))))) + (when (>= tramp-verbose 10) + (if vec-or-proc + (tramp-message + vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))) + (with-output-to-temp-buffer "*debug tramp*" (backtrace))))) (defsubst tramp-error (vec-or-proc signal fmt-string &rest arguments) "Emit an error. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 5e79a4bce6f..3ca401b2fa1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1727,6 +1727,8 @@ handled properly. BODY shall not contain a timeout." "Check host name rules for host-less methods." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) + ;; `user-error' has appeared in Emacs 24.3. + (skip-unless (fboundp 'user-error)) ;; Host names must match rules in case the command template of a ;; method doesn't use them. @@ -4687,8 +4689,7 @@ Use the `ls' command." (skip-unless (not (tramp--test-windows-nt-and-batch))) (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p))) - (tramp--test-instrument-test-case 10 - (tramp--test-utf8))) + (tramp--test-utf8)) (ert-deftest tramp-test39-utf8-with-stat () "Check UTF8 encoding in file names and file contents. @@ -5117,6 +5118,7 @@ Since it unloads Tramp, it shall be the last test to run." ;; * file-name-case-insensitive-p ;; * Work on skipped tests. Make a comment, when it is impossible. +;; * Revisit expensive tests, once problems in tramp-error are solved. ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. ;; * Fix `tramp-test06-directory-file-name' for `ftp'. ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'