diff options
| author | Michael Albinus | 2018-07-25 13:18:46 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-07-25 13:18:46 +0200 |
| commit | c67407e7520a97a92737200bf559c48a927db470 (patch) | |
| tree | 555b750976eb7c147061bc4eae0ff410b9202ed2 | |
| parent | 200195e824befa112459c0afbac7c94aea739573 (diff) | |
| download | emacs-c67407e7520a97a92737200bf559c48a927db470.tar.gz emacs-c67407e7520a97a92737200bf559c48a927db470.zip | |
Instrument shadowfile{-tests} for error hunting on hydra.
* lisp/shadowfile.el (shadow-make-fullname): Use changed
`tramp-make-tramp-file-name' from Tramp 2.4.
* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo):
Instrument test. Suppress errors in cleanup.
(shadow-test09-shadow-copy-files): Suppress errors in cleanup.
| -rw-r--r-- | lisp/shadowfile.el | 9 | ||||
| -rw-r--r-- | test/lisp/shadowfile-tests.el | 22 |
2 files changed, 15 insertions, 16 deletions
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 27d934d9fce..180d5026b6e 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el | |||
| @@ -307,14 +307,7 @@ Replace HOST, and NAME when non-nil." | |||
| 307 | (if (null (tramp-file-name-method hup)) | 307 | (if (null (tramp-file-name-method hup)) |
| 308 | (format | 308 | (format |
| 309 | "/%s:%s" (tramp-file-name-host hup) (tramp-file-name-localname hup)) | 309 | "/%s:%s" (tramp-file-name-host hup) (tramp-file-name-localname hup)) |
| 310 | (tramp-make-tramp-file-name | 310 | (tramp-make-tramp-file-name hup)))) |
| 311 | (tramp-file-name-method hup) | ||
| 312 | (tramp-file-name-user hup) | ||
| 313 | (tramp-file-name-domain hup) | ||
| 314 | (tramp-file-name-host hup) | ||
| 315 | (tramp-file-name-port hup) | ||
| 316 | (tramp-file-name-localname hup) | ||
| 317 | (tramp-file-name-hop hup))))) | ||
| 318 | 311 | ||
| 319 | (defun shadow-replace-name-component (fullname newname) | 312 | (defun shadow-replace-name-component (fullname newname) |
| 320 | "Return FULLNAME with the name component changed to NEWNAME." | 313 | "Return FULLNAME with the name component changed to NEWNAME." |
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index 200fb4c58c6..c38d49e61f2 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el | |||
| @@ -696,6 +696,7 @@ guaranteed by the originator of a cluster definition." | |||
| 696 | shadow-files-to-copy | 696 | shadow-files-to-copy |
| 697 | cluster1 cluster2 primary regexp file) | 697 | cluster1 cluster2 primary regexp file) |
| 698 | (unwind-protect | 698 | (unwind-protect |
| 699 | (condition-case err | ||
| 699 | (progn | 700 | (progn |
| 700 | ;; Cleanup. | 701 | ;; Cleanup. |
| 701 | (when (file-exists-p shadow-info-file) | 702 | (when (file-exists-p shadow-info-file) |
| @@ -773,16 +774,19 @@ guaranteed by the originator of a cluster definition." | |||
| 773 | (concat (shadow-site-primary cluster2) file) | 774 | (concat (shadow-site-primary cluster2) file) |
| 774 | (shadow-contract-file-name (concat "/cluster1:" file))) | 775 | (shadow-contract-file-name (concat "/cluster1:" file))) |
| 775 | shadow-files-to-copy))) | 776 | shadow-files-to-copy))) |
| 777 | (error (message "Error: %s" err) (signal (car err) (cdr err)))) | ||
| 776 | 778 | ||
| 777 | ;; Cleanup. | 779 | ;; Cleanup. |
| 778 | (when (file-exists-p shadow-info-file) | 780 | (when (file-exists-p shadow-info-file) |
| 779 | (delete-file shadow-info-file)) | 781 | (delete-file shadow-info-file)) |
| 780 | (when (file-exists-p shadow-todo-file) | 782 | (when (file-exists-p shadow-todo-file) |
| 781 | (delete-file shadow-todo-file)) | 783 | (delete-file shadow-todo-file)) |
| 782 | (when (file-exists-p file) | 784 | (ignore-errors |
| 783 | (delete-file file)) | 785 | (when (file-exists-p file) |
| 784 | (when (file-exists-p (concat (shadow-site-primary cluster2) file)) | 786 | (delete-file file))) |
| 785 | (delete-file (concat (shadow-site-primary cluster2) file)))))) | 787 | (ignore-errors |
| 788 | (when (file-exists-p (concat (shadow-site-primary cluster2) file)) | ||
| 789 | (delete-file (concat (shadow-site-primary cluster2) file))))))) | ||
| 786 | 790 | ||
| 787 | (ert-deftest shadow-test09-shadow-copy-files () | 791 | (ert-deftest shadow-test09-shadow-copy-files () |
| 788 | "Check that needed shadow files are copied." | 792 | "Check that needed shadow files are copied." |
| @@ -864,10 +868,12 @@ guaranteed by the originator of a cluster definition." | |||
| 864 | (delete-file shadow-info-file)) | 868 | (delete-file shadow-info-file)) |
| 865 | (when (file-exists-p shadow-todo-file) | 869 | (when (file-exists-p shadow-todo-file) |
| 866 | (delete-file shadow-todo-file)) | 870 | (delete-file shadow-todo-file)) |
| 867 | (when (file-exists-p file) | 871 | (ignore-errors |
| 868 | (delete-file file)) | 872 | (when (file-exists-p file) |
| 869 | (when (file-exists-p (concat (shadow-site-primary cluster2) file)) | 873 | (delete-file file))) |
| 870 | (delete-file (concat (shadow-site-primary cluster2) file)))))) | 874 | (ignore-errors |
| 875 | (when (file-exists-p (concat (shadow-site-primary cluster2) file)) | ||
| 876 | (delete-file (concat (shadow-site-primary cluster2) file))))))) | ||
| 871 | 877 | ||
| 872 | (defun shadowfile-test-all (&optional interactive) | 878 | (defun shadowfile-test-all (&optional interactive) |
| 873 | "Run all tests for \\[shadowfile]." | 879 | "Run all tests for \\[shadowfile]." |