aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/process-tests.el
diff options
context:
space:
mode:
authorAndrea Corallo2021-02-10 21:56:55 +0100
committerAndrea Corallo2021-02-10 21:56:55 +0100
commit2fcb85c3e780f1f2871ce0f300cfaffce9836eb0 (patch)
treea8857ccad8bff12080062a3edaad1a55a3eb8171 /test/src/process-tests.el
parent1f626e9662d8120acd5a937f847123cc2b8c6e31 (diff)
parent6bfdfeed36fab4680c8db90c22da8f6611694186 (diff)
downloademacs-2fcb85c3e780f1f2871ce0f300cfaffce9836eb0.tar.gz
emacs-2fcb85c3e780f1f2871ce0f300cfaffce9836eb0.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/src/process-tests.el')
-rw-r--r--test/src/process-tests.el28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index a3fba8d328b..e62bcb3f7c0 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -879,5 +879,33 @@ Return nil if FILENAME doesn't exist."
879 (file-regular-p filename) 879 (file-regular-p filename)
880 filename))) 880 filename)))
881 881
882;; Bug#46284
883(ert-deftest process-sentinel-interrupt-event ()
884 "Test that interrupting a process on Windows sends \"interrupt\" to sentinel."
885 (skip-unless (eq system-type 'windows-nt))
886 (with-temp-buffer
887 (let* ((proc-buf (current-buffer))
888 ;; Start a new emacs process to wait idly until interrupted.
889 (cmd "emacs -batch --eval=\"(sit-for 50000)\"")
890 (proc (start-file-process-shell-command
891 "test/process-sentinel-signal-event" proc-buf cmd))
892 (events '()))
893
894 ;; Capture any incoming events.
895 (set-process-sentinel proc
896 (lambda (_prc event)
897 (push event events)))
898 ;; Wait for the process to start.
899 (sleep-for 2)
900 (should (equal 'run (process-status proc)))
901 ;; Interrupt the sub-process and wait for it to die.
902 (interrupt-process proc)
903 (sleep-for 2)
904 ;; Should have received SIGINT...
905 (should (equal 'signal (process-status proc)))
906 (should (equal 2 (process-exit-status proc)))
907 ;; ...and the change description should be "interrupt".
908 (should (equal '("interrupt\n") events)))))
909
882(provide 'process-tests) 910(provide 'process-tests)
883;;; process-tests.el ends here 911;;; process-tests.el ends here