Compare commits

...

26 commits

Author SHA1 Message Date
Michael Albinus
5a4ba486f2 Add lisp/net/tramp-sh.el to .gitlab-ci.yml 2019-01-07 14:17:08 +01:00
Michael Albinus
56a96db98d Remove instrumentation
* lisp/filenotify.el (file-notify-handle-event):
* test/lisp/filenotify-tests.el (file-notify--test-event-handler):
Remove instrumentation.
2019-01-07 14:09:02 +01:00
Michael Albinus
70a6a2e351 ; YAML does not support folded lines 2019-01-07 13:04:00 +01:00
Michael Albinus
1d9f7efef5 ; Some .gitlab-ci.yml corrections 2019-01-07 12:54:32 +01:00
Michael Albinus
179d5ac251 Further work on emba tests
* .gitlab-ci.yml (test-all): Remove after_script.
(test-filenotify-gio): Remove after_script and when.  Add
src/gfilenotify.c as dependent change.  Use filenotify-tests.log
make target.

* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test06-dir-validity)
(file-notify-test07-many-events)
(file-notify-test09-watched-file-in-watched-dir): Check just for
(getenv "EMACS_EMBA_CI").
2019-01-07 12:21:58 +01:00
Michael Albinus
278340f875 ; Further fixes in .gitlab-ci.yml
* .gitlab-ci.yml (stages): Use only test.
(test-filenotify-gio): Install missing libglib2.0 packages.
2019-01-07 11:30:10 +01:00
Michael Albinus
d43d3f6dfd ; Fix syntax error in .gitlab-ci.yml 2019-01-07 10:23:15 +01:00
Michael Albinus
da844d02fd Adapt .gitlab-ci.yml
* .gitlab-ci.yml (variables): Move outside jobs.  Use
"GIT_STRATEGY: fetch".
(stages): Declare test-all and test-filenotify-gio.
(test-all): Rename from "test".  Install and remove inotify-tools.
Call "make check-expensive".
(test-filenotify-gio): New job.
2019-01-07 10:16:39 +01:00
Michael Albinus
054f1c162a Adapt filenotify-tests 2019-01-06 16:35:38 +01:00
Michael Albinus
fb190f8e57 * .gitlab-ci.yml (before_script): Install also inotify-tools. 2019-01-06 15:46:31 +01:00
Michael Albinus
ea9febe2bd * test/lisp/filenotify-tests.el
(file-notify-test09-watched-file-in-watched-dir): Adapt test.
2019-01-06 14:42:07 +01:00
Michael Albinus
108fdaeba6 Adapt filenotify-tests
* test/lisp/filenotify-tests.el (file-notify-test05-file-validity)
(file-notify-test06-dir-validity)
(file-notify-test07-many-events)
(file-notify-test09-watched-file-in-watched-dir): Adapt tests.
2019-01-06 13:45:44 +01:00
Michael Albinus
33e45e81f4 Work on filenotify-tests on emba
* lisp/filenotify.el (file-notify-callback): Revert last change.

* test/lisp/filenotify-tests.el (file-notify-test05-file-validity):
Adapt test.
2019-01-06 10:12:08 +01:00
Michael Albinus
e56af099fb * lisp/filenotify.el (file-notify-callback): Adapt check. 2019-01-05 19:39:07 +01:00
Michael Albinus
ee52a62e6b * lisp/filenotify.el (file-notify-callback): Instrument. 2019-01-05 17:17:07 +01:00
Michael Albinus
9d5e694337 * test/lisp/filenotify-tests.el (file-notify-test03-events): Adapt test. 2019-01-05 16:02:29 +01:00
Michael Albinus
4be6b83a7a Improve file-notify-callback.
* lisp/filenotify.el (file-notify-callback): Improve check for
`stopped' event.
2019-01-05 16:01:02 +01:00
Michael Albinus
fa292c6c46 * test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity): Adapt tests.
2019-01-05 12:21:43 +01:00
Michael Albinus
e906266874 * test/lisp/filenotify-tests.el (file-notify-test03-events): Adapt test. 2019-01-05 10:46:49 +01:00
Michael Albinus
7b1fbcd6ba * .gitlab-ci.yml (test): Instrument. 2019-01-04 18:08:03 +01:00
Michael Albinus
0b859d3e7d * lisp/filenotify.el (file-notify-handle-event): Instrument. 2019-01-04 17:16:14 +01:00
Michael Albinus
99964e240f * test/lisp/filenotify-tests.el (file-notify-test03-events): Adapt test. 2019-01-04 12:46:27 +01:00
Michael Albinus
d5928dad79 Instrument filenotify tests
* .gitlab-ci.yml (test): Run only filenotify-tests.

* test/lisp/filenotify-tests.el (file-notify--test-event-handler):
Print test messages on EMBA.
2019-01-03 12:08:56 +01:00
Ted Zlatanov
77c2d85b98
.gitlab-ci.yml: add EMACS_EMBA_CI=1 in test 2019-01-02 12:09:17 -05:00
Ted Zlatanov
9aec79652e
.gitlab-ci.yml: unsplit stages 2018-12-31 10:05:25 -05:00
Ted Zlatanov
4a2ef754f1
.gitlab-ci.yml: split stages and add git 2018-12-31 08:36:07 -05:00
3 changed files with 133 additions and 85 deletions

View file

@ -22,20 +22,44 @@
# evaluation purposes, thus possibly temporary.
# Maintainer: tzz@lifelogs.com
# URL: https://gitlab.com/emacs-ci/emacs
# URL: https://emba.gnu.org/emacs/emacs
image: debian:stretch
variables:
GIT_STRATEGY: fetch
EMACS_EMBA_CI: 1
before_script:
- apt update -qq
- DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libc-dev gcc make autoconf automake libncurses-dev gnutls-dev
- DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libc-dev gcc make autoconf automake libncurses-dev gnutls-dev git
stages:
- test
test:
test-all:
# This tests also file monitor libraries inotify and inotifywatch.
stage: test
script:
- DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 inotify-tools
- ./autogen.sh autoconf
- ./configure --without-makeinfo
- make check
- make bootstrap
- make check-expensive
test-filenotify-gio:
stage: test
# This tests file monitor libraries gfilemonitor and gio.
only:
changes:
- .gitlab-ci.yml
- lisp/filenotify.el
- lisp/net/tramp-sh.el
- src/gfilenotify.c
- test/lisp/filenotify-tests.el
script:
- DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libglib2.0-dev libglib2.0-bin libglib2.0-0
- ./autogen.sh autoconf
- ./configure --without-makeinfo --with-file-notification=gfile
- make bootstrap
- make -C test filenotify-tests

View file

@ -114,7 +114,7 @@ Could be different from the directory watched by the backend library."
(when-let* ((watch (gethash (car event) file-notify-descriptors)))
(directory-file-name
(expand-file-name
(or (and (stringp (nth 2 event)) (nth 2 event)) "")
(or (and (stringp (nth 2 event)) (nth 2 event)) "")
(file-notify--watch-directory watch)))))
;; Only `gfilenotify' could return two file names.
@ -240,8 +240,10 @@ EVENT is the cadr of the event in `file-notify-handle-event'
(file-notify--watch-filename watch)
(file-name-nondirectory file1)))))
;;(message
;;"file-notify-callback %S %S %S %S %S"
;;desc action file file1 watch)
;;"file-notify-callback %S %S %S %S %S %S %S"
;;desc action file file1 watch
;;(file-notify--event-watched-file event)
;;(file-notify--watch-directory watch))
(funcall (file-notify--watch-callback watch)
(if file1
`(,desc ,action ,file ,file1)
@ -419,11 +421,9 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
descriptor))
t))))
;; TODO:
;; * Watching a /dir/file may receive events for dir.
;; (This may be the desired behavior.)
;; * Watching a file in an already watched directory
;; * Watching a file in an already watched directory.
;; If the file is created and *then* a watch is added to that file, the
;; watch might receive events which occurred prior to it being created,
;; due to the way events are propagated during idle time. Note: This

View file

@ -688,6 +688,10 @@ delivered."
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed deleted stopped))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed deleted))
(t '(created changed deleted deleted stopped)))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
@ -733,6 +737,10 @@ delivered."
'(created created changed changed deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed created changed deleted stopped))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed created changed deleted deleted))
(t '(created changed created changed
deleted deleted deleted stopped)))
(write-region
@ -785,6 +793,10 @@ delivered."
'(created created deleted deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed renamed deleted stopped))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed renamed deleted))
(t '(created changed renamed deleted deleted stopped)))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
@ -1002,55 +1014,58 @@ delivered."
;; Cleanup.
(file-notify--test-cleanup))
(unwind-protect
(let ((file-notify--test-tmpdir
(make-temp-file "file-notify-test-parent" t)))
(should
(setq file-notify--test-tmpfile (file-notify--test-make-temp-name)
file-notify--test-desc
(file-notify-add-watch
file-notify--test-tmpdir
'(change) #'file-notify--test-event-handler)))
(should (file-notify-valid-p file-notify--test-desc))
(file-notify--test-with-events
(cond
;; w32notify does not raise `deleted' and `stopped' events
;; for the watched directory.
((string-equal (file-notify--test-library) "w32notify")
'(created changed deleted))
;; gvfs-monitor-dir on cygwin does not detect the `created'
;; event reliably.
((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
'((deleted stopped)
(created deleted stopped)))
;; There are two `deleted' events, for the file and for the
;; directory. Except for cygwin and kqueue. And cygwin
;; does not raise a `changed' event.
((eq system-type 'cygwin)
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed deleted stopped))
(t '(created changed deleted deleted stopped)))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
(file-notify--test-read-event)
(delete-directory file-notify--test-tmpdir 'recursive))
;; After deleting the parent directory, the descriptor must
;; not be valid anymore.
(should-not (file-notify-valid-p file-notify--test-desc))
;; w32notify doesn't generate `stopped' events when the parent
;; directory is deleted, which doesn't provide a chance for
;; filenotify.el to remove the descriptor from the internal
;; hash table it maintains. So we must remove the descriptor
;; manually.
(if (string-equal (file-notify--test-library) "w32notify")
(file-notify--rm-descriptor file-notify--test-desc))
;; On emba, `deleted' and `stopped' events of the directory are not detected.
(unless (getenv "EMACS_EMBA_CI")
(unwind-protect
(let ((file-notify--test-tmpdir
(make-temp-file "file-notify-test-parent" t)))
(should
(setq file-notify--test-tmpfile (file-notify--test-make-temp-name)
file-notify--test-desc
(file-notify-add-watch
file-notify--test-tmpdir
'(change) #'file-notify--test-event-handler)))
(should (file-notify-valid-p file-notify--test-desc))
(file-notify--test-with-events
(cond
;; w32notify does not raise `deleted' and `stopped'
;; events for the watched directory.
((string-equal (file-notify--test-library) "w32notify")
'(created changed deleted))
;; gvfs-monitor-dir on cygwin does not detect the
;; `created' event reliably.
((string-equal
(file-notify--test-library) "gvfs-monitor-dir.exe")
'((deleted stopped)
(created deleted stopped)))
;; There are two `deleted' events, for the file and for
;; the directory. Except for cygwin and kqueue. And
;; cygwin does not raise a `changed' event.
((eq system-type 'cygwin)
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed deleted stopped))
(t '(created changed deleted deleted stopped)))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
(file-notify--test-read-event)
(delete-directory file-notify--test-tmpdir 'recursive))
;; After deleting the parent directory, the descriptor must
;; not be valid anymore.
(should-not (file-notify-valid-p file-notify--test-desc))
;; w32notify doesn't generate `stopped' events when the
;; parent directory is deleted, which doesn't provide a
;; chance for filenotify.el to remove the descriptor from
;; the internal hash table it maintains. So we must remove
;; the descriptor manually.
(if (string-equal (file-notify--test-library) "w32notify")
(file-notify--rm-descriptor file-notify--test-desc))
;; The environment shall be cleaned up.
(file-notify--test-cleanup-p))
;; The environment shall be cleaned up.
(file-notify--test-cleanup-p))
;; Cleanup.
(file-notify--test-cleanup)))
;; Cleanup.
(file-notify--test-cleanup))))
(file-notify--deftest-remote file-notify-test05-file-validity
"Check `file-notify-valid-p' via file notification for remote files.")
@ -1084,31 +1099,33 @@ delivered."
;; Cleanup.
(file-notify--test-cleanup))
(unwind-protect
(progn
(should
(setq file-notify--test-tmpfile
(make-temp-file "file-notify-test-parent" t)))
(should
(setq file-notify--test-desc
(file-notify-add-watch
file-notify--test-tmpfile '(change) #'ignore)))
(should (file-notify-valid-p file-notify--test-desc))
;; After deleting the directory, the descriptor must not be
;; valid anymore.
(delete-directory file-notify--test-tmpfile 'recursive)
(file-notify--wait-for-events
(file-notify--test-timeout)
(not (file-notify-valid-p file-notify--test-desc)))
(should-not (file-notify-valid-p file-notify--test-desc))
(if (string-equal (file-notify--test-library) "w32notify")
(file-notify--rm-descriptor file-notify--test-desc))
;; On emba, `deleted' and `stopped' events of the directory are not detected.
(unless (getenv "EMACS_EMBA_CI")
(unwind-protect
(progn
(should
(setq file-notify--test-tmpfile
(make-temp-file "file-notify-test-parent" t)))
(should
(setq file-notify--test-desc
(file-notify-add-watch
file-notify--test-tmpfile '(change) #'ignore)))
(should (file-notify-valid-p file-notify--test-desc))
;; After deleting the directory, the descriptor must not be
;; valid anymore.
(delete-directory file-notify--test-tmpfile 'recursive)
(file-notify--wait-for-events
(file-notify--test-timeout)
(not (file-notify-valid-p file-notify--test-desc)))
(should-not (file-notify-valid-p file-notify--test-desc))
(if (string-equal (file-notify--test-library) "w32notify")
(file-notify--rm-descriptor file-notify--test-desc))
;; The environment shall be cleaned up.
(file-notify--test-cleanup-p))
;; The environment shall be cleaned up.
(file-notify--test-cleanup-p))
;; Cleanup.
(file-notify--test-cleanup)))
;; Cleanup.
(file-notify--test-cleanup))))
(file-notify--deftest-remote file-notify-test06-dir-validity
"Check `file-notify-valid-p' via file notification for remote directories.")
@ -1174,7 +1191,8 @@ delivered."
(file-notify--test-read-event)
(delete-file file)))
(delete-directory file-notify--test-tmpfile)
(if (string-equal (file-notify--test-library) "w32notify")
(if (or (string-equal (file-notify--test-library) "w32notify")
(getenv "EMACS_EMBA_CI"))
(file-notify--rm-descriptor file-notify--test-desc))
;; The environment shall be cleaned up.
@ -1383,11 +1401,17 @@ the file watch."
;; w32notify does not raise `deleted' and `stopped'
;; events for the watched directory.
((string-equal (file-notify--test-library) "w32notify") '())
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'())
(t '(deleted stopped))))))
(delete-directory file-notify--test-tmpfile 'recursive))
(should-not (file-notify-valid-p file-notify--test-desc1))
(should-not (file-notify-valid-p file-notify--test-desc2))
(when (string-equal (file-notify--test-library) "w32notify")
(unless (getenv "EMACS_EMBA_CI")
(should-not (file-notify-valid-p file-notify--test-desc1))
(should-not (file-notify-valid-p file-notify--test-desc2)))
(when (or (string-equal (file-notify--test-library) "w32notify")
(getenv "EMACS_EMBA_CI"))
(file-notify--rm-descriptor file-notify--test-desc1)
(file-notify--rm-descriptor file-notify--test-desc2))