summaryrefslogtreecommitdiff
path: root/test-suite/standalone/test-guild-compile
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/standalone/test-guild-compile')
-rwxr-xr-xtest-suite/standalone/test-guild-compile42
1 files changed, 42 insertions, 0 deletions
diff --git a/test-suite/standalone/test-guild-compile b/test-suite/standalone/test-guild-compile
new file mode 100755
index 000000000..525ecc6e0
--- /dev/null
+++ b/test-suite/standalone/test-guild-compile
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# This -*- sh -*- script tests whether 'guild compile' leaves traces
+# behind it upon SIGINT.
+
+source="t-guild-compile-$$"
+target="$source.go"
+
+trap 'rm -f "$source" "$target"' EXIT
+
+cat > "$source"<<EOF
+(eval-when (expand load eval)
+ (sleep 100))
+(define chbouib 42)
+EOF
+
+guild compile -o "$target" "$source" &
+pid="$!"
+
+# Send SIGINT.
+sleep 2 && kill -INT "$pid"
+
+# Wait for 'guild compile' to terminate.
+sleep 2
+
+# Check whether there are any leftovers.
+for file in "$target"*
+do
+ if test "$file" != "${target}*"
+ then
+ echo "error: 'guild compile' failed to remove '$file'" >&2
+ rm "$target"*
+ kill "$pid"
+ exit 1
+ fi
+done
+
+if test -f "$target"
+then
+ echo "error: '$target' produced" >&2
+ exit 1
+fi