From 135a43a027cd084de1297832a0025ce8eb982a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 20 Mar 2017 21:05:13 +0100 Subject: [PATCH] tests: run-program: add status-hook tests --- src/tests/normal-tests/run-program.lsp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tests/normal-tests/run-program.lsp b/src/tests/normal-tests/run-program.lsp index efa547fdf..7771701aa 100644 --- a/src/tests/normal-tests/run-program.lsp +++ b/src/tests/normal-tests/run-program.lsp @@ -134,3 +134,18 @@ (is-not (zerop (length (get-output-stream-string output-stream)))) (is-not (zerop (length (get-output-stream-string error-stream)))) (mapc #'close (list output-stream error-stream)))) + + +#-windows +(test sigchld-handler + (let ((x 0)) + (flet ((status-hook (process) + (incf x))) + (with-run-program (heartbeat nil :status-hook #'status-hook) + (si:killpid (ext:external-process-pid process) ext:+sigstop+) + (sleep 1) + (si:killpid (ext:external-process-pid process) ext:+sigcont+) + (sleep 1) + (ext:terminate-process process) + (sleep 1)) + (is (= x 3) "X is ~s, should be 3." x))))