aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/shadowfile-tests.el25
1 files changed, 15 insertions, 10 deletions
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 @@
56 'tramp-default-host-alist 56 'tramp-default-host-alist
57 `("\\`mock\\'" nil ,(system-name))) 57 `("\\`mock\\'" nil ,(system-name)))
58 ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in 58 ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in
59 ;; batch mode only, therefore. It cannot be 59 ;; batch mode only, therefore. `shadow-homedir' cannot be
60 ;; `temporary-directory', because the tests with "~" would fail. 60 ;; `temporary-directory', because the tests with "~" would fail.
61 (unless (and (null noninteractive) (file-directory-p "~/")) 61 (unless (and (null noninteractive) (file-directory-p "~/"))
62 (setenv "HOME" invocation-directory)) 62 (setenv "HOME" (file-name-unquote temporary-file-directory))
63 (setq shadow-homedir invocation-directory)
64 (add-to-list
65 'tramp-connection-properties
66 `(,(file-remote-p "/mock::%s") "~" ,invocation-directory)))
63 (format "/mock::%s" temporary-file-directory))) 67 (format "/mock::%s" temporary-file-directory)))
64 "Temporary directory for Tramp tests.") 68 "Temporary directory for Tramp tests.")
65 69
66(message
67 "%s %s" temporary-file-directory shadow-test-remote-temporary-file-directory)
68
69(setq password-cache-expiry nil 70(setq password-cache-expiry nil
70 shadow-debug (getenv "EMACS_HYDRA_CI") 71 shadow-debug (getenv "EMACS_HYDRA_CI")
71 tramp-verbose 0 72 tramp-verbose 0
@@ -76,11 +77,6 @@
76 (ignore-errors 77 (ignore-errors
77 (file-truename shadow-test-remote-temporary-file-directory))) 78 (file-truename shadow-test-remote-temporary-file-directory)))
78 79
79(when shadow-debug
80 (message
81 "%s %s"
82 temporary-file-directory shadow-test-remote-temporary-file-directory))
83
84;; This should happen on hydra only. 80;; This should happen on hydra only.
85(when (getenv "EMACS_HYDRA_CI") 81(when (getenv "EMACS_HYDRA_CI")
86 (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) 82 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
@@ -95,6 +91,9 @@
95 91
96(defun shadow--tests-cleanup () 92(defun shadow--tests-cleanup ()
97 "Reset all `shadowfile' internals." 93 "Reset all `shadowfile' internals."
94 ;; Cleanup Tramp.
95 (tramp-cleanup-connection
96 (tramp-dissect-file-name shadow-test-remote-temporary-file-directory) t t)
98 ;; Delete auto-saved files. 97 ;; Delete auto-saved files.
99 (with-current-buffer (find-file-noselect shadow-info-file 'nowarn) 98 (with-current-buffer (find-file-noselect shadow-info-file 'nowarn)
100 (ignore-errors (delete-file (make-auto-save-file-name))) 99 (ignore-errors (delete-file (make-auto-save-file-name)))
@@ -740,6 +739,12 @@ guaranteed by the originator of a cluster definition."
740 ;; Cleanup & initialize. 739 ;; Cleanup & initialize.
741 (shadow--tests-cleanup) 740 (shadow--tests-cleanup)
742 (shadow-initialize) 741 (shadow-initialize)
742 (when shadow-debug
743 (message
744 "%s %s %s %s %s"
745 temporary-file-directory
746 shadow-test-remote-temporary-file-directory
747 shadow-homedir shadow-info-file shadow-todo-file))
743 748
744 ;; Define clusters. 749 ;; Define clusters.
745 (setq cluster1 "cluster1" 750 (setq cluster1 "cluster1"