emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f1a385d: Fix Bug#32304


From: Michael Albinus
Subject: [Emacs-diffs] master f1a385d: Fix Bug#32304
Date: Thu, 9 Aug 2018 08:08:42 -0400 (EDT)

branch: master
commit f1a385ded23c22edc3f5005bcaa2129eb1d87448
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Bug#32304
    
    * test/lisp/net/tramp-tests.el (tramp-test45-unload):
    Handle tramp-archive autoloaded objects.  Remove tag :unstable.
---
 test/lisp/net/tramp-tests.el | 89 +++++++++++++++++++++++---------------------
 1 file changed, 47 insertions(+), 42 deletions(-)

diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 7ca6800..293a005 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."
 (ert-deftest tramp-test44-unload ()
   "Check that Tramp and its subpackages unload completely.
 Since it unloads Tramp, it shall be the last test to run."
-  :tags '(:expensive-test :unstable)
+  :tags '(:expensive-test)
   (skip-unless noninteractive)
   ;; The autoloaded Tramp objects are different since Emacs 26.1.  We
   ;; cannot test older Emacsen, therefore.
   (skip-unless (tramp--test-emacs26-p))
 
-  (when (featurep 'tramp)
-    ;; This unloads also tramp-archive.el if needed.
-    (unload-feature 'tramp 'force)
-    ;; No Tramp feature must be left.
-    (should-not (featurep 'tramp))
-    (should-not (featurep 'tramp-archive))
-    (should-not
-     (all-completions
-      "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features))))
-    ;; `file-name-handler-alist' must be clean.
-    (should-not (all-completions "tramp" (mapcar 'cdr 
file-name-handler-alist)))
-    ;; There shouldn't be left a bound symbol, except buffer-local
-    ;; variables, and autoload functions.  We do not regard our test
-    ;; symbols, and the Tramp unload hooks.
-    (mapatoms
-     (lambda (x)
-       (and (or (and (boundp x) (null (local-variable-if-set-p x)))
-               (and (functionp x) (null (autoloadp (symbol-function x)))))
-           (string-match "^tramp" (symbol-name x))
-           (not (string-match "^tramp\\(-archive\\)?--?test" (symbol-name x)))
-           (not (string-match "unload-hook$" (symbol-name x)))
-           (ert-fail (format "`%s' still bound" x)))))
-    ;; The defstruct `tramp-file-name' and all its internal functions
-    ;; shall be purged.
-    (should-not (cl--find-class 'tramp-file-name))
-    (mapatoms
-     (lambda (x)
-       (and (functionp x)
-            (string-match "tramp-file-name" (symbol-name x))
-            (ert-fail (format "Structure function `%s' still exists" x)))))
-    ;; There shouldn't be left a hook function containing a Tramp
-    ;; function.  We do not regard the Tramp unload hooks.
-    (mapatoms
-     (lambda (x)
-       (and (boundp x)
-           (string-match "-\\(hook\\|function\\)s?$" (symbol-name x))
-           (not (string-match "unload-hook$" (symbol-name x)))
-           (consp (symbol-value x))
-           (ignore-errors (all-completions "tramp" (symbol-value x)))
-           (ert-fail (format "Hook `%s' still contains Tramp function" x)))))))
+  ;; We have autoloaded objects from tramp.el and tramp-archive.el.
+  ;; In order to remove them, we first need to load both packages.
+  (require 'tramp)
+  (require 'tramp-archive)
+  (should (featurep 'tramp))
+  (should (featurep 'tramp-archive))
+  ;; This unloads also tramp-archive.el and tramp-theme.el if needed.
+  (unload-feature 'tramp 'force)
+  ;; No Tramp feature must be left.
+  (should-not (featurep 'tramp))
+  (should-not (featurep 'tramp-archive))
+  (should-not (featurep 'tramp-theme))
+  (should-not
+   (all-completions
+    "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features))))
+  ;; `file-name-handler-alist' must be clean.
+  (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist)))
+  ;; There shouldn't be left a bound symbol, except buffer-local
+  ;; variables, and autoload functions.  We do not regard our test
+  ;; symbols, and the Tramp unload hooks.
+  (mapatoms
+   (lambda (x)
+     (and (or (and (boundp x) (null (local-variable-if-set-p x)))
+             (and (functionp x) (null (autoloadp (symbol-function x)))))
+         (string-match "^tramp" (symbol-name x))
+         (not (string-match "^tramp\\(-archive\\)?--?test" (symbol-name x)))
+         (not (string-match "unload-hook$" (symbol-name x)))
+         (ert-fail (format "`%s' still bound" x)))))
+  ;; The defstruct `tramp-file-name' and all its internal functions
+  ;; shall be purged.
+  (should-not (cl--find-class 'tramp-file-name))
+  (mapatoms
+   (lambda (x)
+     (and (functionp x)
+          (string-match "tramp-file-name" (symbol-name x))
+          (ert-fail (format "Structure function `%s' still exists" x)))))
+  ;; There shouldn't be left a hook function containing a Tramp
+  ;; function.  We do not regard the Tramp unload hooks.
+  (mapatoms
+   (lambda (x)
+     (and (boundp x)
+         (string-match "-\\(hook\\|function\\)s?$" (symbol-name x))
+         (not (string-match "unload-hook$" (symbol-name x)))
+         (consp (symbol-value x))
+         (ignore-errors (all-completions "tramp" (symbol-value x)))
+         (ert-fail (format "Hook `%s' still contains Tramp function" x))))))
 
 (defun tramp-test-all (&optional interactive)
   "Run all tests for \\[tramp]."
@@ -5232,7 +5238,6 @@ Since it unloads Tramp, it shall be the last test to run."
 ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?).
 ;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably.
 ;; * Fix Bug#16928 in `tramp-test42-asynchronous-requests'.
-;; * Check why `tramp-test44-unload' fails when running as only test.
 
 (provide 'tramp-tests)
 ;;; tramp-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]