From: Michael Albinus Date: Thu, 3 Oct 2019 08:44:02 +0000 (+0200) Subject: Further adaptions for shadowfile-tests.el X-Git-Tag: emacs-27.0.90~1318 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b27c7f3e6083ee8b5d13c2e2103ee6391f2d331f;p=emacs.git Further adaptions for shadowfile-tests.el * test/lisp/shadowfile-tests.el: Change some traces. (shadow-test-remote-temporary-file-directory): Adapt also remote home directory. (shadow--tests-cleanup): Cleanup Tramp. --- diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index c60767c27c5..4d5dc21bd77 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -56,16 +56,17 @@ 'tramp-default-host-alist `("\\`mock\\'" nil ,(system-name))) ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in - ;; batch mode only, therefore. It cannot be + ;; batch mode only, therefore. `shadow-homedir' cannot be ;; `temporary-directory', because the tests with "~" would fail. (unless (and (null noninteractive) (file-directory-p "~/")) - (setenv "HOME" invocation-directory)) + (setenv "HOME" (file-name-unquote temporary-file-directory)) + (setq shadow-homedir invocation-directory) + (add-to-list + 'tramp-connection-properties + `(,(file-remote-p "/mock::%s") "~" ,invocation-directory))) (format "/mock::%s" temporary-file-directory))) "Temporary directory for Tramp tests.") -(message - "%s %s" temporary-file-directory shadow-test-remote-temporary-file-directory) - (setq password-cache-expiry nil shadow-debug (getenv "EMACS_HYDRA_CI") tramp-verbose 0 @@ -76,11 +77,6 @@ (ignore-errors (file-truename shadow-test-remote-temporary-file-directory))) -(when shadow-debug - (message - "%s %s" - temporary-file-directory shadow-test-remote-temporary-file-directory)) - ;; This should happen on hydra only. (when (getenv "EMACS_HYDRA_CI") (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) @@ -95,6 +91,9 @@ (defun shadow--tests-cleanup () "Reset all `shadowfile' internals." + ;; Cleanup Tramp. + (tramp-cleanup-connection + (tramp-dissect-file-name shadow-test-remote-temporary-file-directory) t t) ;; Delete auto-saved files. (with-current-buffer (find-file-noselect shadow-info-file 'nowarn) (ignore-errors (delete-file (make-auto-save-file-name))) @@ -740,6 +739,12 @@ guaranteed by the originator of a cluster definition." ;; Cleanup & initialize. (shadow--tests-cleanup) (shadow-initialize) + (when shadow-debug + (message + "%s %s %s %s %s" + temporary-file-directory + shadow-test-remote-temporary-file-directory + shadow-homedir shadow-info-file shadow-todo-file)) ;; Define clusters. (setq cluster1 "cluster1"