summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-trap/catch.tests
diff options
context:
space:
mode:
authorMike Frysinger2009-03-29 09:54:40 +0000
committerMike Frysinger2009-03-29 09:54:40 +0000
commitfd303b11efb2c87ed239b36c432566a36f859c8e (patch)
tree60164cd1e711b2ca49096b3c4e4e2ab961fa2db9 /shell/hush_test/hush-trap/catch.tests
parent038fe447138aa04d1295cde2e597ec3497ce9214 (diff)
downloadbusybox-fd303b11efb2c87ed239b36c432566a36f859c8e.zip
busybox-fd303b11efb2c87ed239b36c432566a36f859c8e.tar.gz
add test cases for `trap` ... but disabled for now until trap support is committed
Diffstat (limited to 'shell/hush_test/hush-trap/catch.tests')
-rw-r--r--shell/hush_test/hush-trap/catch.tests20
1 files changed, 20 insertions, 0 deletions
diff --git a/shell/hush_test/hush-trap/catch.tests b/shell/hush_test/hush-trap/catch.tests
new file mode 100644
index 0000000..b1a4ed9
--- /dev/null
+++ b/shell/hush_test/hush-trap/catch.tests
@@ -0,0 +1,20 @@
+# avoid ugly warnings about signals not being caught
+trap ":" USR1 USR2
+
+hush -c '
+trap "echo caught" USR2
+echo "sending USR2"
+kill -USR2 $$
+
+trap "" USR2
+echo "sending USR2"
+kill -USR2 $$
+
+trap "-" USR2
+echo "sending USR2"
+kill -USR2 $$
+
+echo "not reached"
+'
+
+trap "-" USR1 USR2