From 64fea996f3d0338bb9ecdf93a42934f1b3dd8c8e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 8 Nov 2025 14:02:44 +0200 Subject: [PATCH] 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. --- test/lisp/vc/vc-tests/vc-test-misc.el | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/lisp/vc/vc-tests/vc-test-misc.el b/test/lisp/vc/vc-tests/vc-test-misc.el index 33aebbdb895..0bbcefd16fd 100644 --- a/test/lisp/vc/vc-tests/vc-test-misc.el +++ b/test/lisp/vc/vc-tests/vc-test-misc.el @@ -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)