diff options
| author | Michael Albinus | 2019-10-03 10:44:02 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-10-03 10:44:02 +0200 |
| commit | b27c7f3e6083ee8b5d13c2e2103ee6391f2d331f (patch) | |
| tree | d059a380bdf424ecf1bd0f786dff08d710c49890 | |
| parent | 1854511e97843e028a76cd5a6d8fee74cfabd3d1 (diff) | |
| download | emacs-b27c7f3e6083ee8b5d13c2e2103ee6391f2d331f.tar.gz emacs-b27c7f3e6083ee8b5d13c2e2103ee6391f2d331f.zip | |
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.
| -rw-r--r-- | test/lisp/shadowfile-tests.el | 25 |
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" |