test-guild-compile: Increase sleep time before sending SIGINT.
[bpt/guile.git] / test-suite / standalone / test-guild-compile
CommitLineData
2da97f1c
LC
1#!/bin/sh
2#
3# This -*- sh -*- script tests whether 'guild compile' leaves traces
4# behind it upon SIGINT.
5
6source="t-guild-compile-$$"
7target="$source.go"
8
9trap 'rm -f "$source" "$target"' EXIT
10
11cat > "$source"<<EOF
12(eval-when (expand load eval)
13 (sleep 100))
14(define chbouib 42)
15EOF
16
17guild compile -o "$target" "$source" &
18pid="$!"
19
20# Send SIGINT.
4afca1a0 21sleep 2 && kill -INT "$pid"
2da97f1c
LC
22
23# Wait for 'guild compile' to terminate.
24sleep 2
25
26# Check whether there are any leftovers.
27for file in "$target"*
28do
29 if test "$file" != "${target}*"
30 then
31 echo "error: 'guild compile' failed to remove '$file'" >&2
32 rm "$target"*
33 kill "$pid"
34 exit 1
35 fi
36done
37
38if test -f "$target"
39then
40 echo "error: '$target' produced" >&2
41 exit 1
42fi