Adapt vc-test-misc to MS-Windows

* test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-exec-after-1)
(vc-test-exec-after-2, vc-test-exec-after-3)
(vc-test-exec-after-4, vc-test-exec-after-5): Fix shell commands
for MS-Windows: use "&" instead of ";" and don't use fractional
times for 'sleep', as some Windows ports of 'sleep' don't support
that.
This commit is contained in:
Eli Zaretskii 2025-11-08 14:02:44 +02:00
parent 2aff4fed69
commit 64fea996f3

View file

@ -76,7 +76,9 @@
"Test `vc-exec-after' adding a sentinel."
(with-temp-buffer
(let ((proc (start-process-shell-command "test" (current-buffer)
"sleep 0.2; echo hello"))
(if (eq system-type 'windows-nt)
"sleep 1 & echo hello"
"sleep 0.2; echo hello")))
success)
(vc-exec-after (lambda () (setq success t)))
(should-not (eq (process-sentinel proc)
@ -88,7 +90,9 @@
"Test `vc-exec-after' executing the code immediately."
(with-temp-buffer
(let ((proc (start-process-shell-command "test" (current-buffer)
"sleep 0.2; echo hello"))
(if (eq system-type 'windows-nt)
"sleep 1 & echo hello"
"sleep 0.2; echo hello")))
success)
(vc-test--exec-after-wait)
(vc-exec-after (lambda () (setq success t)))
@ -100,7 +104,9 @@
"Test SUCCESS argument to `vc-exec-after'."
(with-temp-buffer
(let ((proc (start-process-shell-command "test" (current-buffer)
"sleep 0.2; echo hello"))
(if (eq system-type 'windows-nt)
"sleep 1 & echo hello"
"sleep 0.2; echo hello")))
(passes (start-process "test2" nil "true"))
success)
(vc-exec-after (lambda () (setq success t)) passes)
@ -109,7 +115,9 @@
(with-temp-buffer
(let ((proc (start-process-shell-command "test" (current-buffer)
"sleep 0.2; echo hello"))
(if (eq system-type 'windows-nt)
"sleep 1 & echo hello"
"sleep 0.2; echo hello")))
(fails (start-process "test2" nil "false"))
success)
(vc-exec-after (lambda () (setq success t)) fails)
@ -120,7 +128,9 @@
"Test `vc-exec-after' handling the process mark."
(with-temp-buffer
(let ((proc (start-process-shell-command "test" (current-buffer)
"echo hello there; sleep 0.2"))
(if (eq system-type 'windows-nt)
"echo hello there & sleep 1"
"echo hello there; sleep 0.2")))
success)
;; Disable the default output, which further moves point.
(set-process-sentinel proc #'ignore)
@ -140,7 +150,9 @@
"Test `vc-exec-after' with `vc-sentinel-movepoint' variable."
(with-temp-buffer
(let ((proc (start-process-shell-command "test" (current-buffer)
"echo hello there; sleep 0.2"))
(if (eq system-type 'windows-nt)
"echo hello there & sleep 1"
"echo hello there; sleep 0.2")))
success)
;; Disable the default output, which further moves point.
(set-process-sentinel proc #'ignore)