aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash_test/ash-signals/return_in_trap1.right (renamed from shell/hush_test/hush-trap/return_in_trap1.right)0
-rwxr-xr-xshell/ash_test/ash-signals/return_in_trap1.tests (renamed from shell/hush_test/hush-trap/return_in_trap1.tests)0
-rw-r--r--shell/hush_test/hush-signals/catch.right (renamed from shell/hush_test/hush-trap/catch.right)0
-rwxr-xr-xshell/hush_test/hush-signals/catch.tests (renamed from shell/hush_test/hush-trap/catch.tests)0
-rw-r--r--shell/hush_test/hush-signals/exit.right (renamed from shell/hush_test/hush-trap/exit.right)0
-rwxr-xr-xshell/hush_test/hush-signals/exit.tests (renamed from shell/hush_test/hush-trap/exit.tests)0
-rw-r--r--shell/hush_test/hush-signals/return_in_trap1.right4
-rwxr-xr-xshell/hush_test/hush-signals/return_in_trap1.tests18
-rw-r--r--shell/hush_test/hush-signals/save-ret.right (renamed from shell/hush_test/hush-trap/save-ret.right)0
-rwxr-xr-xshell/hush_test/hush-signals/save-ret.tests (renamed from shell/hush_test/hush-trap/save-ret.tests)0
-rw-r--r--shell/hush_test/hush-signals/savetrap.right (renamed from shell/hush_test/hush-trap/savetrap.right)0
-rwxr-xr-xshell/hush_test/hush-signals/savetrap.tests (renamed from shell/hush_test/hush-trap/savetrap.tests)0
-rw-r--r--shell/hush_test/hush-signals/signal7.right (renamed from shell/hush_test/hush-trap/signal7.right)0
-rwxr-xr-xshell/hush_test/hush-signals/signal7.tests (renamed from shell/hush_test/hush-trap/signal7.tests)0
-rw-r--r--shell/hush_test/hush-signals/signal_read1.right (renamed from shell/hush_test/hush-trap/signal_read1.right)0
-rwxr-xr-xshell/hush_test/hush-signals/signal_read1.tests (renamed from shell/hush_test/hush-trap/signal_read1.tests)0
-rw-r--r--shell/hush_test/hush-signals/signal_read2.right (renamed from shell/hush_test/hush-trap/signal_read2.right)0
-rwxr-xr-xshell/hush_test/hush-signals/signal_read2.tests (renamed from shell/hush_test/hush-trap/signal_read2.tests)0
-rw-r--r--shell/hush_test/hush-signals/subshell.right (renamed from shell/hush_test/hush-trap/subshell.right)0
-rwxr-xr-xshell/hush_test/hush-signals/subshell.tests (renamed from shell/hush_test/hush-trap/subshell.tests)0
-rw-r--r--shell/hush_test/hush-signals/usage.right (renamed from shell/hush_test/hush-trap/usage.right)0
-rwxr-xr-xshell/hush_test/hush-signals/usage.tests (renamed from shell/hush_test/hush-trap/usage.tests)0
22 files changed, 22 insertions, 0 deletions
diff --git a/shell/hush_test/hush-trap/return_in_trap1.right b/shell/ash_test/ash-signals/return_in_trap1.right
index a6e637885..a6e637885 100644
--- a/shell/hush_test/hush-trap/return_in_trap1.right
+++ b/shell/ash_test/ash-signals/return_in_trap1.right
diff --git a/shell/hush_test/hush-trap/return_in_trap1.tests b/shell/ash_test/ash-signals/return_in_trap1.tests
index f2498024f..f2498024f 100755
--- a/shell/hush_test/hush-trap/return_in_trap1.tests
+++ b/shell/ash_test/ash-signals/return_in_trap1.tests
diff --git a/shell/hush_test/hush-trap/catch.right b/shell/hush_test/hush-signals/catch.right
index 80a062c4b..80a062c4b 100644
--- a/shell/hush_test/hush-trap/catch.right
+++ b/shell/hush_test/hush-signals/catch.right
diff --git a/shell/hush_test/hush-trap/catch.tests b/shell/hush_test/hush-signals/catch.tests
index d2a21d17e..d2a21d17e 100755
--- a/shell/hush_test/hush-trap/catch.tests
+++ b/shell/hush_test/hush-signals/catch.tests
diff --git a/shell/hush_test/hush-trap/exit.right b/shell/hush_test/hush-signals/exit.right
index 3d0072564..3d0072564 100644
--- a/shell/hush_test/hush-trap/exit.right
+++ b/shell/hush_test/hush-signals/exit.right
diff --git a/shell/hush_test/hush-trap/exit.tests b/shell/hush_test/hush-signals/exit.tests
index 2061105dd..2061105dd 100755
--- a/shell/hush_test/hush-trap/exit.tests
+++ b/shell/hush_test/hush-signals/exit.tests
diff --git a/shell/hush_test/hush-signals/return_in_trap1.right b/shell/hush_test/hush-signals/return_in_trap1.right
new file mode 100644
index 000000000..a6e637885
--- /dev/null
+++ b/shell/hush_test/hush-signals/return_in_trap1.right
@@ -0,0 +1,4 @@
+a:2
+b:0
+Trap
+d:3
diff --git a/shell/hush_test/hush-signals/return_in_trap1.tests b/shell/hush_test/hush-signals/return_in_trap1.tests
new file mode 100755
index 000000000..f2498024f
--- /dev/null
+++ b/shell/hush_test/hush-signals/return_in_trap1.tests
@@ -0,0 +1,18 @@
+a() {
+ (exit 2)
+ echo a:$?
+ (kill -s USR1 $$; echo b:$?; exit 3)
+ echo c:$? # does not execute
+ (exit 4)
+}
+
+trap "echo Trap; return" USR1
+a
+
+echo d:$?
+# It's debatable what is the correct value above.
+# Does 'return' in trap sees $? == 2 or $? == 3?
+# IOW: after (kill..), does shell first wait for its completion
+# and sets $?, then checks pending signals and runs a trap handler,
+# or does it first checks pending signals and runs handler?
+# hush does the former, and prints 3.
diff --git a/shell/hush_test/hush-trap/save-ret.right b/shell/hush_test/hush-signals/save-ret.right
index a3e12ce5e..a3e12ce5e 100644
--- a/shell/hush_test/hush-trap/save-ret.right
+++ b/shell/hush_test/hush-signals/save-ret.right
diff --git a/shell/hush_test/hush-trap/save-ret.tests b/shell/hush_test/hush-signals/save-ret.tests
index 0786b6d96..0786b6d96 100755
--- a/shell/hush_test/hush-trap/save-ret.tests
+++ b/shell/hush_test/hush-signals/save-ret.tests
diff --git a/shell/hush_test/hush-trap/savetrap.right b/shell/hush_test/hush-signals/savetrap.right
index a59225be3..a59225be3 100644
--- a/shell/hush_test/hush-trap/savetrap.right
+++ b/shell/hush_test/hush-signals/savetrap.right
diff --git a/shell/hush_test/hush-trap/savetrap.tests b/shell/hush_test/hush-signals/savetrap.tests
index c2b312fb8..c2b312fb8 100755
--- a/shell/hush_test/hush-trap/savetrap.tests
+++ b/shell/hush_test/hush-signals/savetrap.tests
diff --git a/shell/hush_test/hush-trap/signal7.right b/shell/hush_test/hush-signals/signal7.right
index ba7453e42..ba7453e42 100644
--- a/shell/hush_test/hush-trap/signal7.right
+++ b/shell/hush_test/hush-signals/signal7.right
diff --git a/shell/hush_test/hush-trap/signal7.tests b/shell/hush_test/hush-signals/signal7.tests
index c2b1381f9..c2b1381f9 100755
--- a/shell/hush_test/hush-trap/signal7.tests
+++ b/shell/hush_test/hush-signals/signal7.tests
diff --git a/shell/hush_test/hush-trap/signal_read1.right b/shell/hush_test/hush-signals/signal_read1.right
index 2870a8e70..2870a8e70 100644
--- a/shell/hush_test/hush-trap/signal_read1.right
+++ b/shell/hush_test/hush-signals/signal_read1.right
diff --git a/shell/hush_test/hush-trap/signal_read1.tests b/shell/hush_test/hush-signals/signal_read1.tests
index 1105479a3..1105479a3 100755
--- a/shell/hush_test/hush-trap/signal_read1.tests
+++ b/shell/hush_test/hush-signals/signal_read1.tests
diff --git a/shell/hush_test/hush-trap/signal_read2.right b/shell/hush_test/hush-signals/signal_read2.right
index 71a6bc16d..71a6bc16d 100644
--- a/shell/hush_test/hush-trap/signal_read2.right
+++ b/shell/hush_test/hush-signals/signal_read2.right
diff --git a/shell/hush_test/hush-trap/signal_read2.tests b/shell/hush_test/hush-signals/signal_read2.tests
index eab5b9b5b..eab5b9b5b 100755
--- a/shell/hush_test/hush-trap/signal_read2.tests
+++ b/shell/hush_test/hush-signals/signal_read2.tests
diff --git a/shell/hush_test/hush-trap/subshell.right b/shell/hush_test/hush-signals/subshell.right
index f865b932b..f865b932b 100644
--- a/shell/hush_test/hush-trap/subshell.right
+++ b/shell/hush_test/hush-signals/subshell.right
diff --git a/shell/hush_test/hush-trap/subshell.tests b/shell/hush_test/hush-signals/subshell.tests
index d877f2b82..d877f2b82 100755
--- a/shell/hush_test/hush-trap/subshell.tests
+++ b/shell/hush_test/hush-signals/subshell.tests
diff --git a/shell/hush_test/hush-trap/usage.right b/shell/hush_test/hush-signals/usage.right
index c0dbd6c3c..c0dbd6c3c 100644
--- a/shell/hush_test/hush-trap/usage.right
+++ b/shell/hush_test/hush-signals/usage.right
diff --git a/shell/hush_test/hush-trap/usage.tests b/shell/hush_test/hush-signals/usage.tests
index d29c6e74a..d29c6e74a 100755
--- a/shell/hush_test/hush-trap/usage.tests
+++ b/shell/hush_test/hush-signals/usage.tests