aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-11-08 10:31:15 +0100
committerMichael Albinus2013-11-08 10:31:15 +0100
commit1c49d6c2fec75f4e205c32df04d4672dd75bb58e (patch)
treecd5ef788e0d1ac87c6730011daa4e9de8c90025d
parentf358e6e5d3518dac27f2ace7544247877783305e (diff)
downloademacs-1c49d6c2fec75f4e205c32df04d4672dd75bb58e.tar.gz
emacs-1c49d6c2fec75f4e205c32df04d4672dd75bb58e.zip
* automated/file-notify-tests.el:
* automated/tramp-tests.el: Add `tramp-own-remote-path' to `tramp-remote-path' when running on hydra. (tramp-test07-file-exists-p): Remove instrumentation code. (tramp-test26-process-file): Don't use "/bin/true" and "/bin/false", these paths do not exist on hydra.
-rw-r--r--test/ChangeLog6
-rw-r--r--test/automated/file-notify-tests.el3
-rw-r--r--test/automated/tramp-tests.el47
3 files changed, 27 insertions, 29 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 317789f0747..95827d65cf6 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,7 +1,11 @@
12013-11-08 Michael Albinus <michael.albinus@gmx.de> 12013-11-08 Michael Albinus <michael.albinus@gmx.de>
2 2
3 * automated/file-notify-tests.el:
3 * automated/tramp-tests.el: Add `tramp-own-remote-path' to 4 * automated/tramp-tests.el: Add `tramp-own-remote-path' to
4 `tramp-remote-path'. 5 `tramp-remote-path' when running on hydra.
6 (tramp-test07-file-exists-p): Remove instrumentation code.
7 (tramp-test26-process-file): Don't use "/bin/true" and
8 "/bin/false", these paths do not exist on hydra.
5 9
62013-11-08 Helmut Eller <eller.helmut@gmail.com> 102013-11-08 Helmut Eller <eller.helmut@gmail.com>
7 11
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index 627333bffd7..b0cd7ce95f6 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -46,6 +46,9 @@
46(setq tramp-verbose 0 46(setq tramp-verbose 0
47 tramp-message-show-message nil) 47 tramp-message-show-message nil)
48(when noninteractive (defalias 'tramp-read-passwd 'ignore)) 48(when noninteractive (defalias 'tramp-read-passwd 'ignore))
49;; This shall happen on hydra only.
50(when (getenv "NIX_STORE")
51 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
49 52
50;; We do not want to try and fail `file-notify-add-watch'. 53;; We do not want to try and fail `file-notify-add-watch'.
51(defun file-notify--test-local-enabled () 54(defun file-notify--test-local-enabled ()
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index 57544bfaefc..538def94a80 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -19,13 +19,17 @@
19 19
20;;; Commentary: 20;;; Commentary:
21 21
22;; Some of the tests are intended to run over remote files. Set 22;; The tests require a recent ert.el from Emacs 24.4.
23
24;; Some of the tests require access to a remote host files. Set
23;; `tramp-test-temporary-file-directory' to a suitable value. It must 25;; `tramp-test-temporary-file-directory' to a suitable value. It must
24;; NOT require an interactive password prompt, when running the tests 26;; NOT require an interactive password prompt, when running the tests
25;; in batch mode. 27;; in batch mode.
26 28
27;; If you want to skip tests for remote files, set this variable to 29;; If you want to skip tests accessing a remote host, set this
28;; `null-device'. 30;; variable to `null-device'.
31
32;; A whole test run can be performed calling the command `tramp-test-all'.
29 33
30;;; Code: 34;;; Code:
31 35
@@ -40,10 +44,9 @@
40(setq tramp-verbose 0 44(setq tramp-verbose 0
41 tramp-message-show-message nil) 45 tramp-message-show-message nil)
42(when noninteractive (defalias 'tramp-read-passwd 'ignore)) 46(when noninteractive (defalias 'tramp-read-passwd 'ignore))
43;; This shall happen on hydra only; we need a proper test. Check 47;; This shall happen on hydra only.
44;; `process-environment' for a hint. 48(when (getenv "NIX_STORE")
45(add-to-list 'tramp-remote-path 'tramp-own-remote-path) 49 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
46(message "%s" process-environment)
47 50
48(defvar tramp--test-enabled-checked nil 51(defvar tramp--test-enabled-checked nil
49 "Cached result of `tramp--test-enabled'. 52 "Cached result of `tramp--test-enabled'.
@@ -506,25 +509,13 @@ and `file-name-nondirectory'."
506 509
507(ert-deftest tramp-test07-file-exists-p () 510(ert-deftest tramp-test07-file-exists-p ()
508 "Check `file-exist-p', `write-region' and `delete-file'." 511 "Check `file-exist-p', `write-region' and `delete-file'."
509 (condition-case err 512 (skip-unless (tramp--test-enabled))
510 (with-timeout (20 (should-not 'timeout)) 513 (let ((tmp-name (tramp--test-make-temp-name)))
511 (message "tramp--test-enabled") 514 (should-not (file-exists-p tmp-name))
512 (message "%S" (tramp--test-enabled)) 515 (write-region "foo" nil tmp-name)
513 (skip-unless (tramp--test-enabled)) 516 (should (file-exists-p tmp-name))
514 (let ((tmp-name (tramp--test-make-temp-name))) 517 (delete-file tmp-name)
515 (message "file-exists-p") 518 (should-not (file-exists-p tmp-name))))
516 (should-not (file-exists-p tmp-name))
517 (message "write-region")
518 (write-region "foo" nil tmp-name)
519 (message "file-exists-p")
520 (should (file-exists-p tmp-name))
521 (message "delete-file")
522 (delete-file tmp-name)
523 (message "file-exists-p")
524 (should-not (file-exists-p tmp-name))))
525 ((error quit)
526 (message "%S" err)
527 (signal (car err) (cdr err)))))
528 519
529(ert-deftest tramp-test08-file-local-copy () 520(ert-deftest tramp-test08-file-local-copy ()
530 "Check `file-local-copy'." 521 "Check `file-local-copy'."
@@ -930,8 +921,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
930 "Check `process-file'." 921 "Check `process-file'."
931 (skip-unless (tramp--test-enabled)) 922 (skip-unless (tramp--test-enabled))
932 (let ((default-directory tramp-test-temporary-file-directory)) 923 (let ((default-directory tramp-test-temporary-file-directory))
933 (should (zerop (process-file "/bin/true"))) 924 (should (zerop (process-file "true")))
934 (should-not (zerop (process-file "/bin/false"))) 925 (should-not (zerop (process-file "false")))
935 (with-temp-buffer 926 (with-temp-buffer
936 (should (zerop (process-file "ls" nil t))) 927 (should (zerop (process-file "ls" nil t)))
937 (should (> (point-max) (point-min)))))) 928 (should (> (point-max) (point-min))))))