diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2022-08-25 11:08:48 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2022-08-25 11:08:48 +0200 |
commit | c5c3f57bd437235d247c1b6ee2e3059413d134b4 (patch) | |
tree | 9cdbb0da66c7c9a427431f886473f5a760f3594a /test/lisp/net/tramp-tests.el | |
parent | ce82300221f270241fdda1f5dfb567bdb1208543 (diff) | |
download | emacs-c5c3f57bd437235d247c1b6ee2e3059413d134b4.tar.gz |
Minor fixes in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp--test-deftest-with-stat)
(tramp--test-deftest-with-perl)
(tramp--test-deftest-with-ls): Skip if underlying test didn't run
or lasted too long.
(tramp--test-shell-file-name): Do not depend on `tramp--test-adb-p'.
Diffstat (limited to 'test/lisp/net/tramp-tests.el')
-rw-r--r-- | test/lisp/net/tramp-tests.el | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 4dcf671f51f..3e318a729d1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3593,12 +3593,16 @@ This tests also `access-file', `file-readable-p', (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) (skip-unless (tramp-get-remote-stat tramp-test-vec)) - (let ((default-directory ert-remote-temporary-file-directory) - (ert-test (ert-get-test ',test)) - (tramp-connection-properties - (cons '(nil "perl" nil) - tramp-connection-properties))) - (funcall (ert-test-body ert-test))))) + (if-let ((default-directory ert-remote-temporary-file-directory) + (ert-test (ert-get-test ',test)) + (result (ert-test-most-recent-result ert-test)) + (tramp-connection-properties + (cons '(nil "perl" nil) + tramp-connection-properties))) + (progn + (skip-unless (< (ert-test-result-duration result) 300)) + (funcall (ert-test-body ert-test))) + (ert-skip (format "Test `%s' must run before" ',test))))) (defmacro tramp--test-deftest-with-perl (test) "Define ert `TEST-with-perl'." @@ -3612,15 +3616,19 @@ This tests also `access-file', `file-readable-p', (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) (skip-unless (tramp-get-remote-perl tramp-test-vec)) - (let ((default-directory ert-remote-temporary-file-directory) - (ert-test (ert-get-test ',test)) - (tramp-connection-properties - (append - '((nil "stat" nil) - ;; See `tramp-sh-handle-file-truename'. - (nil "readlink" nil)) - tramp-connection-properties))) - (funcall (ert-test-body ert-test))))) + (if-let ((default-directory ert-remote-temporary-file-directory) + (ert-test (ert-get-test ',test)) + (result (ert-test-most-recent-result ert-test)) + (tramp-connection-properties + (append + '((nil "stat" nil) + ;; See `tramp-sh-handle-file-truename'. + (nil "readlink" nil)) + tramp-connection-properties))) + (progn + (skip-unless (< (ert-test-result-duration result) 300)) + (funcall (ert-test-body ert-test))) + (ert-skip (format "Test `%s' must run before" ',test))))) (defmacro tramp--test-deftest-with-ls (test) "Define ert `TEST-with-ls'." @@ -3633,16 +3641,20 @@ This tests also `access-file', `file-readable-p', :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) - (let ((default-directory ert-remote-temporary-file-directory) - (ert-test (ert-get-test ',test)) - (tramp-connection-properties - (append - '((nil "perl" nil) - (nil "stat" nil) - ;; See `tramp-sh-handle-file-truename'. - (nil "readlink" nil)) - tramp-connection-properties))) - (funcall (ert-test-body ert-test))))) + (if-let ((default-directory ert-remote-temporary-file-directory) + (ert-test (ert-get-test ',test)) + (result (ert-test-most-recent-result ert-test)) + (tramp-connection-properties + (append + '((nil "perl" nil) + (nil "stat" nil) + ;; See `tramp-sh-handle-file-truename'. + (nil "readlink" nil)) + tramp-connection-properties))) + (progn + (skip-unless (< (ert-test-result-duration result) 300)) + (funcall (ert-test-body ert-test))) + (ert-skip (format "Test `%s' must run before" ',test))))) (tramp--test-deftest-with-stat tramp-test18-file-attributes) @@ -4598,7 +4610,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (defun tramp--test-shell-file-name () "Return default remote shell." - (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh")) + (if (file-exists-p + (concat + (file-remote-p ert-remote-temporary-file-directory) "/system/bin/sh")) + "/system/bin/sh" "/bin/sh")) (ert-deftest tramp-test28-process-file () "Check `process-file'." |