emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113344: * automated/file-notify-tests.el (file-noti


From: Michael Albinus
Subject: [Emacs-diffs] trunk r113344: * automated/file-notify-tests.el (file-notify-test00-availability):
Date: Tue, 09 Jul 2013 07:52:29 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113344
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Tue 2013-07-09 09:52:25 +0200
message:
  * automated/file-notify-tests.el (file-notify-test00-availability):
  Set :expected-result.
  (file-notify-test01-add-watch, file-notify-test01-add-watch-remote)
  (file-notify-test02-events, file-notify-test02-events-remote)
  (file-notify-test03-autorevert, file-notify-test03-autorevert-remote):
  Skip when `file-notify-support' is nil.  (Bug#14823)
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/file-notify-tests.el 
filenotifytests.el-20130702144123-sxglvo6zs3jcj8w1-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2013-07-09 07:43:12 +0000
+++ b/test/ChangeLog    2013-07-09 07:52:25 +0000
@@ -1,3 +1,12 @@
+2013-07-09  Michael Albinus  <address@hidden>
+
+       * automated/file-notify-tests.el (file-notify-test00-availability):
+       Set :expected-result.
+       (file-notify-test01-add-watch, file-notify-test01-add-watch-remote)
+       (file-notify-test02-events, file-notify-test02-events-remote)
+       (file-notify-test03-autorevert, file-notify-test03-autorevert-remote):
+       Skip when `file-notify-support' is nil.  (Bug#14823)
+
 2013-07-09  Glenn Morris  <address@hidden>
 
        * automated/inotify-test.el (inotify-add-watch, inotify-rm-watch):

=== modified file 'test/automated/file-notify-tests.el'
--- a/test/automated/file-notify-tests.el       2013-07-05 14:06:14 +0000
+++ b/test/automated/file-notify-tests.el       2013-07-09 07:52:25 +0000
@@ -77,40 +77,46 @@
 
 (ert-deftest file-notify-test00-availability ()
   "Test availability of `file-notify'."
+  :expected-result (if file-notify-support :passed :failed)
   (should (memq file-notify-support '(gfilenotify inotify w32notify))))
 
-(ert-deftest file-notify-test01-add-watch ()
-  "Check `file-notify-add-watch'."
-  (let (desc)
-    ;; Check, that different valid parameters are accepted.
-    (should (setq desc (file-notify-add-watch
-                       temporary-file-directory '(change) 'ignore)))
-    (file-notify-rm-watch desc)
-    (should (setq desc (file-notify-add-watch
-                       temporary-file-directory '(attribute-change) 'ignore)))
-    (file-notify-rm-watch desc)
-    (should (setq desc (file-notify-add-watch
-                       temporary-file-directory
-                       '(change attribute-change) 'ignore)))
-    (file-notify-rm-watch desc)
-
-    ;; Check error handling.
-    (should
-     (equal (car (should-error (file-notify-add-watch 1 2 3 4)))
-           'wrong-number-of-arguments))
-    (should
-     (equal (should-error (file-notify-add-watch 1 2 3))
-           '(wrong-type-argument 1)))
-    (should
-     (equal (should-error (file-notify-add-watch temporary-file-directory 2 3))
-           '(wrong-type-argument 2)))
-    (should
-     (equal (should-error (file-notify-add-watch
-                          temporary-file-directory '(change) 3))
-           '(wrong-type-argument 3)))))
-
-(file-notify--deftest-remote file-notify-test01-add-watch
-  "Check `file-notify-add-watch' for remote files.")
+(when file-notify-support
+
+  (ert-deftest file-notify-test01-add-watch ()
+    "Check `file-notify-add-watch'."
+    (let (desc)
+      ;; Check, that different valid parameters are accepted.
+      (should (setq desc (file-notify-add-watch
+                         temporary-file-directory '(change) 'ignore)))
+      (file-notify-rm-watch desc)
+      (should (setq desc (file-notify-add-watch
+                         temporary-file-directory
+                         '(attribute-change) 'ignore)))
+      (file-notify-rm-watch desc)
+      (should (setq desc (file-notify-add-watch
+                         temporary-file-directory
+                         '(change attribute-change) 'ignore)))
+      (file-notify-rm-watch desc)
+
+      ;; Check error handling.
+      (should
+       (equal (car (should-error (file-notify-add-watch 1 2 3 4)))
+             'wrong-number-of-arguments))
+      (should
+       (equal (should-error (file-notify-add-watch 1 2 3))
+             '(wrong-type-argument 1)))
+      (should
+       (equal (should-error (file-notify-add-watch
+                            temporary-file-directory 2 3))
+             '(wrong-type-argument 2)))
+      (should
+       (equal (should-error (file-notify-add-watch
+                            temporary-file-directory '(change) 3))
+             '(wrong-type-argument 3)))))
+
+  (file-notify--deftest-remote file-notify-test01-add-watch
+    "Check `file-notify-add-watch' for remote files.")
+  ) ;; file-notify-support
 
 (defun file-notify--test-event-test ()
   "Ert test function to be called by `file-notify--test-event-handler'.
@@ -141,52 +147,55 @@
   (expand-file-name
    (make-temp-name "file-notify-test") temporary-file-directory))
 
-(ert-deftest file-notify-test02-events ()
-  "Check file creation/removal notifications."
-  (let (desc)
-    (unwind-protect
-       (progn
-         (setq file-notify--test-results nil
-               file-notify--test-tmpfile (file-notify--test-make-temp-name)
-               file-notify--test-tmpfile1 (file-notify--test-make-temp-name)
-               desc
-               (file-notify-add-watch
-                file-notify--test-tmpfile
-                '(change) 'file-notify--test-event-handler))
-
-         ;; Check creation and removal.
-         (write-region "any text" nil file-notify--test-tmpfile)
-         (delete-file file-notify--test-tmpfile)
-
-         ;; Check copy and rename.
-         (write-region "any text" nil file-notify--test-tmpfile)
-         (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1)
-         (delete-file file-notify--test-tmpfile)
-         (delete-file file-notify--test-tmpfile1)
-
-         (write-region "any text" nil file-notify--test-tmpfile)
-         (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1)
-         (delete-file file-notify--test-tmpfile1))
-
-      ;; Wait for events, and exit.
-      (sit-for 5 'nodisplay)
-      (file-notify-rm-watch desc)
-      (ignore-errors (delete-file file-notify--test-tmpfile))
-      (ignore-errors (delete-file file-notify--test-tmpfile1))))
-
-  (dolist (result file-notify--test-results)
-    ;(message "%s" (ert-test-result-messages result))
-    (when (ert-test-failed-p result)
-      (ert-fail (cadr (ert-test-result-with-condition-condition result))))))
-
-(file-notify--deftest-remote file-notify-test02-events
-  "Check file creation/removal notifications for remote files.")
+(when file-notify-support
+
+  (ert-deftest file-notify-test02-events ()
+    "Check file creation/removal notifications."
+    (let (desc)
+      (unwind-protect
+         (progn
+           (setq file-notify--test-results nil
+                 file-notify--test-tmpfile (file-notify--test-make-temp-name)
+                 file-notify--test-tmpfile1 (file-notify--test-make-temp-name)
+                 desc
+                 (file-notify-add-watch
+                  file-notify--test-tmpfile
+                  '(change) 'file-notify--test-event-handler))
+
+           ;; Check creation and removal.
+           (write-region "any text" nil file-notify--test-tmpfile)
+           (delete-file file-notify--test-tmpfile)
+
+           ;; Check copy and rename.
+           (write-region "any text" nil file-notify--test-tmpfile)
+           (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1)
+           (delete-file file-notify--test-tmpfile)
+           (delete-file file-notify--test-tmpfile1)
+
+           (write-region "any text" nil file-notify--test-tmpfile)
+           (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1)
+           (delete-file file-notify--test-tmpfile1))
+
+       ;; Wait for events, and exit.
+       (sit-for 5 'nodisplay)
+       (file-notify-rm-watch desc)
+       (ignore-errors (delete-file file-notify--test-tmpfile))
+       (ignore-errors (delete-file file-notify--test-tmpfile1))))
+
+    (dolist (result file-notify--test-results)
+      ;(message "%s" (ert-test-result-messages result))
+      (when (ert-test-failed-p result)
+       (ert-fail (cadr (ert-test-result-with-condition-condition result))))))
+
+  (file-notify--deftest-remote file-notify-test02-events
+    "Check file creation/removal notifications for remote files.")
+  ) ;; file-notify-support
 
 ;; autorevert runs only in interactive mode.
 (defvar auto-revert-remote-files)
 (setq auto-revert-remote-files t)
 (require 'autorevert)
-(when (null noninteractive)
+(when (and file-notify-support (null noninteractive))
 
   (ert-deftest file-notify-test03-autorevert ()
     "Check autorevert via file notification.
@@ -240,7 +249,7 @@
   (file-notify--deftest-remote file-notify-test03-autorevert
     "Check autorevert via file notification for remote files.
 This test is skipped in batch mode.")
-  ) ;; (null noninteractive)
+  ) ;; (and file-notify-support (null noninteractive))
 
 (defun file-notify-test-all (&optional interactive)
   "Run all tests for \\[file-notify]."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]