(make-temp-name "tramp-test")
(if local temporary-file-directory tramp-test-temporary-file-directory))))
-;; Don't print messages in nested `tramp--instrument-test-case' calls.
-(defvar tramp--instrument-test-case-p nil
- "Whether `tramp--instrument-test-case' run.
+;; Don't print messages in nested `tramp--test-instrument-test-case' calls.
+(defvar tramp--test-instrument-test-case-p nil
+ "Whether `tramp--test-instrument-test-case' run.
This shall used dynamically bound only.")
-(defmacro tramp--instrument-test-case (verbose &rest body)
+(defmacro tramp--test-instrument-test-case (verbose &rest body)
"Run BODY with `tramp-verbose' equal VERBOSE.
Print the the content of the Tramp debug buffer, if BODY does not
eval properly in `should' or `should-not'. `should-error' is not
(cons "^make-symbolic-link not supported$" debug-ignored-errors))
inhibit-message)
(unwind-protect
- (let ((tramp--instrument-test-case-p t)) ,@body)
+ (let ((tramp--test-instrument-test-case-p t)) ,@body)
;; Unwind forms.
- (when (and (null tramp--instrument-test-case-p) (> tramp-verbose 3))
+ (when (and (null tramp--test-instrument-test-case-p) (> tramp-verbose 3))
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(with-current-buffer (tramp-get-connection-buffer v)
(message "%s" (buffer-string)))
(defsubst tramp--test-message (fmt-string &rest arguments)
"Emit a message into ERT *Messages*."
- (tramp--instrument-test-case 0
+ (tramp--test-instrument-test-case 0
(apply
'tramp-message
(tramp-dissect-file-name tramp-test-temporary-file-directory) 0
(defsubst tramp--test-backtrace ()
"Dump a backtrace into ERT *Messages*."
- (tramp--instrument-test-case 10
+ (tramp--test-instrument-test-case 10
(tramp-backtrace
(tramp-dissect-file-name tramp-test-temporary-file-directory))))
(process-file-side-effects t)
;; Suppress nasty messages.
(inhibit-message t)
+ ;; Do not run delayed timers.
+ (timer-max-repeats 0)
+ ;; Number of asynchronous processes for test.
(number-proc 10)
;; On hydra, timings are bad.
(timer-repeat
(ert-deftest tramp-test39-unload ()
"Check that Tramp and its subpackages unload completely.
Since it unloads Tramp, it shall be the last test to run."
- ;; Mark as failed until all symbols are unbound.
- :expected-result (if (featurep 'tramp) :failed :passed)
:tags '(:expensive-test)
(skip-unless noninteractive)
(should-not (all-completions "tramp" (delq 'tramp-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. We do not regard our
- ;; test symbols, and the Tramp unload hooks.
+ ;; 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 (boundp x) (functionp 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--?test" (symbol-name x)))
(not (string-match "unload-hook$" (symbol-name x)))
(mapatoms
(lambda (x)
(and (boundp x)
- (string-match "-hooks?$" (symbol-name 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)))
;; * Fix Bug#27009. Set expected error of
;; `tramp-test29-environment-variables-and-port-numbers'.
;; * Fix Bug#16928 in `tramp-test36-asynchronous-requests'.
-;; * Fix `tramp-test39-unload' (Not all symbols are unbound). Set
-;; expected error.
(defun tramp-test-all (&optional interactive)
"Run all tests for \\[tramp]."