lean4-htt/tests/pkg/signal/run_test.sh
Sebastian Ullrich d33a771ea3
test: always clean full .lake (#13703)
Ensures we don't reuse outdated config oleans
2026-05-12 16:25:00 +00:00

41 lines
930 B
Bash

rm -rf .lake
lake build release
# Create a named pipe for communication
PIPE="$TMP_DIR/pipe"
mkfifo "$PIPE"
# Run release in the background, redirect stdout to the pipe
.lake/build/bin/release > "$PIPE" &
PID=$!
echo "Started process with PID: $PID"
function await_line(){
read -r line < "$PIPE"
echo "Received line: $line"
sleep 1
}
await_line
echo "Sending USR1 signal..."
kill -USR1 "$PID" 2>/dev/null || fail "Failed to send USR1"
await_line
echo "Sending HUP signal..."
kill -HUP "$PID" 2>/dev/null || fail "Failed to send HUP"
await_line
echo "Sending QUIT signal..."
kill -QUIT "$PID" 2>/dev/null || fail "Failed to send QUIT"
await_line
echo "Sending INT signal..."
kill -INT "$PID" 2>/dev/null || fail "Failed to send INT"
# Wait for process to finish
echo "Waiting for process $PID to finish..."
if wait "$PID"; then
echo "Process completed successfully"
else
fail "Process exited with code $?"
fi