commit 9a2363ec04c24a6959902da9b8eff2f1559ab3e0 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sat Nov 28 14:20:28 2015 +0100 ; Pacify byte-compiler in filenotify-tests.el diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index c0991ae..d6322c2 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -296,7 +296,7 @@ longer than timeout seconds for the events to be delivered." `(let* ((,outer file-notify--test-events) (events (if (consp (car ,events)) ,events (list ,events))) (max-length (apply 'max (mapcar 'length events))) - create-lockfiles result) + create-lockfiles result) ;; Flush pending events. (file-notify--wait-for-events (file-notify--test-timeout) @@ -821,7 +821,7 @@ longer than timeout seconds for the events to be delivered." ;; w32notify fires both `deleted' and `renamed' events. ((string-equal (file-notify--test-library) "w32notify") (let (r) - (dotimes (i n r) + (dotimes (_i n r) (setq r (append '(deleted renamed) r))))) (t (make-list n 'renamed))) (let ((source-file-list source-file-list) commit 9f554a1a70c0470af7020537a0da6bf43e74ee79 Author: Michael Albinus Date: Sat Nov 28 13:56:28 2015 +0100 Fix a problem with gfilenotify in filenotify-tests.el * test/lisp/filenotify-tests.el (file-notify--test-expected-events): Remove. (file-notify--test-cleanup): Do not set that variable. (file-notify--test-with-events): EVENTS can also be a list of lists. (file-notify-test02-events, file-notify-test04-file-validity): Adapt expected result. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index b665ddd..c0991ae 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -61,7 +61,6 @@ (defvar file-notify--test-results nil) (defvar file-notify--test-event nil) (defvar file-notify--test-events nil) -(defvar file-notify--test-expected-events nil) (defun file-notify--test-timeout () "Timeout to wait for arriving events, in seconds." @@ -93,8 +92,7 @@ file-notify--test-tmpfile1 nil file-notify--test-desc nil file-notify--test-results nil - file-notify--test-events nil - file-notify--test-expected-events nil) + file-notify--test-events nil) (when file-notify--test-event (error "file-notify--test-event should not be set but bound dynamically"))) @@ -290,13 +288,15 @@ TIMEOUT is the maximum time to wait for, in seconds." (defmacro file-notify--test-with-events (events &rest body) "Run BODY collecting events and then compare with EVENTS. -Don't wait longer than timeout seconds for the events to be delivered." +EVENTS is either a simple list of events, or a list of lists of +events, which represent different possible results. Don't wait +longer than timeout seconds for the events to be delivered." (declare (indent 1)) (let ((outer (make-symbol "outer"))) - `(let ((,outer file-notify--test-events) - create-lockfiles) - (setq file-notify--test-expected-events - (append file-notify--test-expected-events ,events)) + `(let* ((,outer file-notify--test-events) + (events (if (consp (car ,events)) ,events (list ,events))) + (max-length (apply 'max (mapcar 'length events))) + create-lockfiles result) ;; Flush pending events. (file-notify--wait-for-events (file-notify--test-timeout) @@ -305,9 +305,14 @@ Don't wait longer than timeout seconds for the events to be delivered." ,@body (file-notify--wait-for-events ;; More events need more time. Use some fudge factor. - (* (ceiling (length ,events) 100) (file-notify--test-timeout)) - (= (length ,events) (length file-notify--test-events))) - (should (equal ,events (mapcar #'cadr file-notify--test-events))) + (* (ceiling max-length 100) (file-notify--test-timeout)) + (= max-length (length file-notify--test-events))) + ;; One of the possible results shall match. + (should + (dolist (elt events result) + (setq result + (or result + (equal elt (mapcar #'cadr file-notify--test-events)))))) (setq ,outer (append ,outer file-notify--test-events))) (setq file-notify--test-events ,outer)))) @@ -355,13 +360,15 @@ Don't wait longer than timeout seconds for the events to be delivered." ;; cygwin recognizes only `deleted' and `stopped' events. ((eq system-type 'cygwin) '(deleted stopped)) - ;; inotify, kqueueg and gfilenotify raise just one - ;; `changed' event, the other backends show us two of - ;; them. + ;; inotify and kqueue raise just one `changed' event. ((or (string-equal "inotify" (file-notify--test-library)) - (string-equal "kqueue" (file-notify--test-library)) - (string-equal "gfilenotify" (file-notify--test-library))) + (string-equal "kqueue" (file-notify--test-library))) '(changed deleted stopped)) + ;; gfilenotify raises one or two `changed' events + ;; randomly, no chance to test. So we accept both cases. + ((string-equal "gfilenotify" (file-notify--test-library)) + '((changed deleted stopped) + (changed changed deleted stopped))) (t '(changed changed deleted stopped))) (read-event nil nil 0.1) (write-region @@ -521,8 +528,6 @@ Don't wait longer than timeout seconds for the events to be delivered." ;; Check the global sequence again just to make sure that ;; `file-notify--test-events' has been set correctly. - (should (equal (mapcar #'cadr file-notify--test-events) - file-notify--test-expected-events)) (should file-notify--test-results) (dolist (result file-notify--test-results) (when (ert-test-failed-p result) @@ -661,16 +666,18 @@ Don't wait longer than timeout seconds for the events to be delivered." ;; cygwin recognizes only `deleted' and `stopped' events. ((eq system-type 'cygwin) '(deleted stopped)) - ;; inotify, kqueueg and gfilenotify raise just one - ;; `changed' event, the other backends show us two of - ;; them. + ;; inotify and kqueue raise just one `changed' event. ((or (string-equal "inotify" (file-notify--test-library)) - (string-equal "kqueue" (file-notify--test-library)) - (string-equal "gfilenotify" (file-notify--test-library))) + (string-equal "kqueue" (file-notify--test-library))) '(changed deleted stopped)) + ;; gfilenotify raises one or two `changed' events + ;; randomly, no chance to test. So we accept both cases. + ((string-equal "gfilenotify" (file-notify--test-library)) + '((changed deleted stopped) + (changed changed deleted stopped))) (t '(changed changed deleted stopped))) - (read-event nil nil 0.1) (should (file-notify-valid-p file-notify--test-desc)) + (read-event nil nil 0.1) (write-region "another text" nil file-notify--test-tmpfile nil 'no-message) (read-event nil nil 0.1) commit c42ccd615081e12c97a55e778b488b3f4f5b22b7 Author: Eli Zaretskii Date: Sat Nov 28 13:00:24 2015 +0200 * .gitignore: Adjust to changes in 'test' directory structure. diff --git a/.gitignore b/.gitignore index cad1684..e83760b 100644 --- a/.gitignore +++ b/.gitignore @@ -149,10 +149,10 @@ src/*.map # Tests. test/indent/*.new test/biditest.txt -test/etags/srclist -test/etags/regexfile -test/etags/ETAGS -test/etags/CTAGS +test/manual/etags/srclist +test/manual/etags/regexfile +test/manual/etags/ETAGS +test/manual/etags/CTAGS # ctags, etags. TAGS commit 11aee0775e70ec4ebf0b42fdf03742e6c811ab19 Author: Eli Zaretskii Date: Sat Nov 28 12:58:15 2015 +0200 Fix test/manual/etags/Makefile * test/manual/etags/Makefile (ETAGS_PROG, CTAGS_PROG): Adjust to changes in 'test' directory structure. diff --git a/test/manual/etags/Makefile b/test/manual/etags/Makefile index f326c90..f5cf2ae 100644 --- a/test/manual/etags/Makefile +++ b/test/manual/etags/Makefile @@ -31,8 +31,8 @@ SRCS=${ADASRC} ${ASRC} ${CSRC} ${CPSRC} ${ELSRC} ${ERLSRC} ${FSRC}\ ${TEXSRC} ${YSRC} NONSRCS=./f-src/entry.strange ./erl-src/lists.erl ./cp-src/clheir.hpp.gz -ETAGS_PROG=../../lib-src/etags -CTAGS_PROG=../../lib-src/ctags +ETAGS_PROG=../../../lib-src/etags +CTAGS_PROG=../../../lib-src/ctags REGEX=/[ \t]*DEFVAR_[A-Z_ \t\n(]+"\([^"]+\)"/ xx="this line is here because of a fontlock bug