diff options
| author | Michael Albinus | 2017-07-17 14:12:20 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-07-17 14:12:20 +0200 |
| commit | 4968aa685b85840d79258ff6b61ba2bcfb99e2bc (patch) | |
| tree | b8911e5b375b2d3f2cb6c917cf1823a3988d4ff0 | |
| parent | b2150e0b02fa4a7ad4c1461e0b4ff8fd632c0fb8 (diff) | |
| download | emacs-4968aa685b85840d79258ff6b61ba2bcfb99e2bc.tar.gz emacs-4968aa685b85840d79258ff6b61ba2bcfb99e2bc.zip | |
Fix `tramp-test39-unload'
* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case-p)
(tramp--test-instrument-test-case): Rename. Adapt all callees.
(tramp-test36-asynchronous-requests): Bind `timer-max-repeats'.
(tramp-test39-unload): Expect it to pass. Ignore buffer-local
variables and autoload functions; they are not removed. Check
also for `-function(s)'.
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 07d319bce0f..7a240826b55 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -132,12 +132,12 @@ If QUOTED is non-nil, the local part of the file is quoted." | |||
| 132 | (make-temp-name "tramp-test") | 132 | (make-temp-name "tramp-test") |
| 133 | (if local temporary-file-directory tramp-test-temporary-file-directory)))) | 133 | (if local temporary-file-directory tramp-test-temporary-file-directory)))) |
| 134 | 134 | ||
| 135 | ;; Don't print messages in nested `tramp--instrument-test-case' calls. | 135 | ;; Don't print messages in nested `tramp--test-instrument-test-case' calls. |
| 136 | (defvar tramp--instrument-test-case-p nil | 136 | (defvar tramp--test-instrument-test-case-p nil |
| 137 | "Whether `tramp--instrument-test-case' run. | 137 | "Whether `tramp--test-instrument-test-case' run. |
| 138 | This shall used dynamically bound only.") | 138 | This shall used dynamically bound only.") |
| 139 | 139 | ||
| 140 | (defmacro tramp--instrument-test-case (verbose &rest body) | 140 | (defmacro tramp--test-instrument-test-case (verbose &rest body) |
| 141 | "Run BODY with `tramp-verbose' equal VERBOSE. | 141 | "Run BODY with `tramp-verbose' equal VERBOSE. |
| 142 | Print the the content of the Tramp debug buffer, if BODY does not | 142 | Print the the content of the Tramp debug buffer, if BODY does not |
| 143 | eval properly in `should' or `should-not'. `should-error' is not | 143 | eval properly in `should' or `should-not'. `should-error' is not |
| @@ -150,9 +150,9 @@ handled properly. BODY shall not contain a timeout." | |||
| 150 | (cons "^make-symbolic-link not supported$" debug-ignored-errors)) | 150 | (cons "^make-symbolic-link not supported$" debug-ignored-errors)) |
| 151 | inhibit-message) | 151 | inhibit-message) |
| 152 | (unwind-protect | 152 | (unwind-protect |
| 153 | (let ((tramp--instrument-test-case-p t)) ,@body) | 153 | (let ((tramp--test-instrument-test-case-p t)) ,@body) |
| 154 | ;; Unwind forms. | 154 | ;; Unwind forms. |
| 155 | (when (and (null tramp--instrument-test-case-p) (> tramp-verbose 3)) | 155 | (when (and (null tramp--test-instrument-test-case-p) (> tramp-verbose 3)) |
| 156 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil | 156 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil |
| 157 | (with-current-buffer (tramp-get-connection-buffer v) | 157 | (with-current-buffer (tramp-get-connection-buffer v) |
| 158 | (message "%s" (buffer-string))) | 158 | (message "%s" (buffer-string))) |
| @@ -161,7 +161,7 @@ handled properly. BODY shall not contain a timeout." | |||
| 161 | 161 | ||
| 162 | (defsubst tramp--test-message (fmt-string &rest arguments) | 162 | (defsubst tramp--test-message (fmt-string &rest arguments) |
| 163 | "Emit a message into ERT *Messages*." | 163 | "Emit a message into ERT *Messages*." |
| 164 | (tramp--instrument-test-case 0 | 164 | (tramp--test-instrument-test-case 0 |
| 165 | (apply | 165 | (apply |
| 166 | 'tramp-message | 166 | 'tramp-message |
| 167 | (tramp-dissect-file-name tramp-test-temporary-file-directory) 0 | 167 | (tramp-dissect-file-name tramp-test-temporary-file-directory) 0 |
| @@ -169,7 +169,7 @@ handled properly. BODY shall not contain a timeout." | |||
| 169 | 169 | ||
| 170 | (defsubst tramp--test-backtrace () | 170 | (defsubst tramp--test-backtrace () |
| 171 | "Dump a backtrace into ERT *Messages*." | 171 | "Dump a backtrace into ERT *Messages*." |
| 172 | (tramp--instrument-test-case 10 | 172 | (tramp--test-instrument-test-case 10 |
| 173 | (tramp-backtrace | 173 | (tramp-backtrace |
| 174 | (tramp-dissect-file-name tramp-test-temporary-file-directory)))) | 174 | (tramp-dissect-file-name tramp-test-temporary-file-directory)))) |
| 175 | 175 | ||
| @@ -3699,6 +3699,9 @@ process sentinels. They shall not disturb each other." | |||
| 3699 | (process-file-side-effects t) | 3699 | (process-file-side-effects t) |
| 3700 | ;; Suppress nasty messages. | 3700 | ;; Suppress nasty messages. |
| 3701 | (inhibit-message t) | 3701 | (inhibit-message t) |
| 3702 | ;; Do not run delayed timers. | ||
| 3703 | (timer-max-repeats 0) | ||
| 3704 | ;; Number of asynchronous processes for test. | ||
| 3702 | (number-proc 10) | 3705 | (number-proc 10) |
| 3703 | ;; On hydra, timings are bad. | 3706 | ;; On hydra, timings are bad. |
| 3704 | (timer-repeat | 3707 | (timer-repeat |
| @@ -3879,8 +3882,6 @@ process sentinels. They shall not disturb each other." | |||
| 3879 | (ert-deftest tramp-test39-unload () | 3882 | (ert-deftest tramp-test39-unload () |
| 3880 | "Check that Tramp and its subpackages unload completely. | 3883 | "Check that Tramp and its subpackages unload completely. |
| 3881 | Since it unloads Tramp, it shall be the last test to run." | 3884 | Since it unloads Tramp, it shall be the last test to run." |
| 3882 | ;; Mark as failed until all symbols are unbound. | ||
| 3883 | :expected-result (if (featurep 'tramp) :failed :passed) | ||
| 3884 | :tags '(:expensive-test) | 3885 | :tags '(:expensive-test) |
| 3885 | (skip-unless noninteractive) | 3886 | (skip-unless noninteractive) |
| 3886 | 3887 | ||
| @@ -3891,11 +3892,13 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 3891 | (should-not (all-completions "tramp" (delq 'tramp-tests features))) | 3892 | (should-not (all-completions "tramp" (delq 'tramp-tests features))) |
| 3892 | ;; `file-name-handler-alist' must be clean. | 3893 | ;; `file-name-handler-alist' must be clean. |
| 3893 | (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist))) | 3894 | (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist))) |
| 3894 | ;; There shouldn't be left a bound symbol. We do not regard our | 3895 | ;; There shouldn't be left a bound symbol, except buffer-local |
| 3895 | ;; test symbols, and the Tramp unload hooks. | 3896 | ;; variables, and autoload functions. We do not regard our test |
| 3897 | ;; symbols, and the Tramp unload hooks. | ||
| 3896 | (mapatoms | 3898 | (mapatoms |
| 3897 | (lambda (x) | 3899 | (lambda (x) |
| 3898 | (and (or (boundp x) (functionp x)) | 3900 | (and (or (and (boundp x) (null (local-variable-if-set-p x))) |
| 3901 | (and (functionp x) (null (autoloadp (symbol-function x))))) | ||
| 3899 | (string-match "^tramp" (symbol-name x)) | 3902 | (string-match "^tramp" (symbol-name x)) |
| 3900 | (not (string-match "^tramp--?test" (symbol-name x))) | 3903 | (not (string-match "^tramp--?test" (symbol-name x))) |
| 3901 | (not (string-match "unload-hook$" (symbol-name x))) | 3904 | (not (string-match "unload-hook$" (symbol-name x))) |
| @@ -3905,7 +3908,7 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 3905 | (mapatoms | 3908 | (mapatoms |
| 3906 | (lambda (x) | 3909 | (lambda (x) |
| 3907 | (and (boundp x) | 3910 | (and (boundp x) |
| 3908 | (string-match "-hooks?$" (symbol-name x)) | 3911 | (string-match "-\\(hook\\|function\\)s?$" (symbol-name x)) |
| 3909 | (not (string-match "unload-hook$" (symbol-name x))) | 3912 | (not (string-match "unload-hook$" (symbol-name x))) |
| 3910 | (consp (symbol-value x)) | 3913 | (consp (symbol-value x)) |
| 3911 | (ignore-errors (all-completions "tramp" (symbol-value x))) | 3914 | (ignore-errors (all-completions "tramp" (symbol-value x))) |
| @@ -3929,8 +3932,6 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 3929 | ;; * Fix Bug#27009. Set expected error of | 3932 | ;; * Fix Bug#27009. Set expected error of |
| 3930 | ;; `tramp-test29-environment-variables-and-port-numbers'. | 3933 | ;; `tramp-test29-environment-variables-and-port-numbers'. |
| 3931 | ;; * Fix Bug#16928 in `tramp-test36-asynchronous-requests'. | 3934 | ;; * Fix Bug#16928 in `tramp-test36-asynchronous-requests'. |
| 3932 | ;; * Fix `tramp-test39-unload' (Not all symbols are unbound). Set | ||
| 3933 | ;; expected error. | ||
| 3934 | 3935 | ||
| 3935 | (defun tramp-test-all (&optional interactive) | 3936 | (defun tramp-test-all (&optional interactive) |
| 3936 | "Run all tests for \\[tramp]." | 3937 | "Run all tests for \\[tramp]." |