diff options
| author | Michael Albinus | 2018-08-09 14:08:25 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-08-09 14:08:25 +0200 |
| commit | f1a385ded23c22edc3f5005bcaa2129eb1d87448 (patch) | |
| tree | 21826768e7055768724b6fb3d5015b543902b23f | |
| parent | 449954dda84aa392312ab714f918a756c12adb32 (diff) | |
| download | emacs-f1a385ded23c22edc3f5005bcaa2129eb1d87448.tar.gz emacs-f1a385ded23c22edc3f5005bcaa2129eb1d87448.zip | |
Fix Bug#32304
* test/lisp/net/tramp-tests.el (tramp-test45-unload):
Handle tramp-archive autoloaded objects. Remove tag :unstable.
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 89 |
1 files changed, 47 insertions, 42 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 7ca680087a9..293a0054560 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -5162,52 +5162,58 @@ process sentinels. They shall not disturb each other." | |||
| 5162 | (ert-deftest tramp-test44-unload () | 5162 | (ert-deftest tramp-test44-unload () |
| 5163 | "Check that Tramp and its subpackages unload completely. | 5163 | "Check that Tramp and its subpackages unload completely. |
| 5164 | Since it unloads Tramp, it shall be the last test to run." | 5164 | Since it unloads Tramp, it shall be the last test to run." |
| 5165 | :tags '(:expensive-test :unstable) | 5165 | :tags '(:expensive-test) |
| 5166 | (skip-unless noninteractive) | 5166 | (skip-unless noninteractive) |
| 5167 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We | 5167 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We |
| 5168 | ;; cannot test older Emacsen, therefore. | 5168 | ;; cannot test older Emacsen, therefore. |
| 5169 | (skip-unless (tramp--test-emacs26-p)) | 5169 | (skip-unless (tramp--test-emacs26-p)) |
| 5170 | 5170 | ||
| 5171 | (when (featurep 'tramp) | 5171 | ;; We have autoloaded objects from tramp.el and tramp-archive.el. |
| 5172 | ;; This unloads also tramp-archive.el if needed. | 5172 | ;; In order to remove them, we first need to load both packages. |
| 5173 | (unload-feature 'tramp 'force) | 5173 | (require 'tramp) |
| 5174 | ;; No Tramp feature must be left. | 5174 | (require 'tramp-archive) |
| 5175 | (should-not (featurep 'tramp)) | 5175 | (should (featurep 'tramp)) |
| 5176 | (should-not (featurep 'tramp-archive)) | 5176 | (should (featurep 'tramp-archive)) |
| 5177 | (should-not | 5177 | ;; This unloads also tramp-archive.el and tramp-theme.el if needed. |
| 5178 | (all-completions | 5178 | (unload-feature 'tramp 'force) |
| 5179 | "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features)))) | 5179 | ;; No Tramp feature must be left. |
| 5180 | ;; `file-name-handler-alist' must be clean. | 5180 | (should-not (featurep 'tramp)) |
| 5181 | (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist))) | 5181 | (should-not (featurep 'tramp-archive)) |
| 5182 | ;; There shouldn't be left a bound symbol, except buffer-local | 5182 | (should-not (featurep 'tramp-theme)) |
| 5183 | ;; variables, and autoload functions. We do not regard our test | 5183 | (should-not |
| 5184 | ;; symbols, and the Tramp unload hooks. | 5184 | (all-completions |
| 5185 | (mapatoms | 5185 | "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features)))) |
| 5186 | (lambda (x) | 5186 | ;; `file-name-handler-alist' must be clean. |
| 5187 | (and (or (and (boundp x) (null (local-variable-if-set-p x))) | 5187 | (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist))) |
| 5188 | (and (functionp x) (null (autoloadp (symbol-function x))))) | 5188 | ;; There shouldn't be left a bound symbol, except buffer-local |
| 5189 | (string-match "^tramp" (symbol-name x)) | 5189 | ;; variables, and autoload functions. We do not regard our test |
| 5190 | (not (string-match "^tramp\\(-archive\\)?--?test" (symbol-name x))) | 5190 | ;; symbols, and the Tramp unload hooks. |
| 5191 | (not (string-match "unload-hook$" (symbol-name x))) | 5191 | (mapatoms |
| 5192 | (ert-fail (format "`%s' still bound" x))))) | 5192 | (lambda (x) |
| 5193 | ;; The defstruct `tramp-file-name' and all its internal functions | 5193 | (and (or (and (boundp x) (null (local-variable-if-set-p x))) |
| 5194 | ;; shall be purged. | 5194 | (and (functionp x) (null (autoloadp (symbol-function x))))) |
| 5195 | (should-not (cl--find-class 'tramp-file-name)) | 5195 | (string-match "^tramp" (symbol-name x)) |
| 5196 | (mapatoms | 5196 | (not (string-match "^tramp\\(-archive\\)?--?test" (symbol-name x))) |
| 5197 | (lambda (x) | 5197 | (not (string-match "unload-hook$" (symbol-name x))) |
| 5198 | (and (functionp x) | 5198 | (ert-fail (format "`%s' still bound" x))))) |
| 5199 | (string-match "tramp-file-name" (symbol-name x)) | 5199 | ;; The defstruct `tramp-file-name' and all its internal functions |
| 5200 | (ert-fail (format "Structure function `%s' still exists" x))))) | 5200 | ;; shall be purged. |
| 5201 | ;; There shouldn't be left a hook function containing a Tramp | 5201 | (should-not (cl--find-class 'tramp-file-name)) |
| 5202 | ;; function. We do not regard the Tramp unload hooks. | 5202 | (mapatoms |
| 5203 | (mapatoms | 5203 | (lambda (x) |
| 5204 | (lambda (x) | 5204 | (and (functionp x) |
| 5205 | (and (boundp x) | 5205 | (string-match "tramp-file-name" (symbol-name x)) |
| 5206 | (string-match "-\\(hook\\|function\\)s?$" (symbol-name x)) | 5206 | (ert-fail (format "Structure function `%s' still exists" x))))) |
| 5207 | (not (string-match "unload-hook$" (symbol-name x))) | 5207 | ;; There shouldn't be left a hook function containing a Tramp |
| 5208 | (consp (symbol-value x)) | 5208 | ;; function. We do not regard the Tramp unload hooks. |
| 5209 | (ignore-errors (all-completions "tramp" (symbol-value x))) | 5209 | (mapatoms |
| 5210 | (ert-fail (format "Hook `%s' still contains Tramp function" x))))))) | 5210 | (lambda (x) |
| 5211 | (and (boundp x) | ||
| 5212 | (string-match "-\\(hook\\|function\\)s?$" (symbol-name x)) | ||
| 5213 | (not (string-match "unload-hook$" (symbol-name x))) | ||
| 5214 | (consp (symbol-value x)) | ||
| 5215 | (ignore-errors (all-completions "tramp" (symbol-value x))) | ||
| 5216 | (ert-fail (format "Hook `%s' still contains Tramp function" x)))))) | ||
| 5211 | 5217 | ||
| 5212 | (defun tramp-test-all (&optional interactive) | 5218 | (defun tramp-test-all (&optional interactive) |
| 5213 | "Run all tests for \\[tramp]." | 5219 | "Run all tests for \\[tramp]." |
| @@ -5232,7 +5238,6 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 5232 | ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). | 5238 | ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). |
| 5233 | ;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably. | 5239 | ;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably. |
| 5234 | ;; * Fix Bug#16928 in `tramp-test42-asynchronous-requests'. | 5240 | ;; * Fix Bug#16928 in `tramp-test42-asynchronous-requests'. |
| 5235 | ;; * Check why `tramp-test44-unload' fails when running as only test. | ||
| 5236 | 5241 | ||
| 5237 | (provide 'tramp-tests) | 5242 | (provide 'tramp-tests) |
| 5238 | ;;; tramp-tests.el ends here | 5243 | ;;; tramp-tests.el ends here |