summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2016-10-01 22:36:14 +0200
committerDenys Vlasenko2016-10-01 22:36:14 +0200
commit3ed7e2749a3f9fd315d8f46a3b0a25ff10caf726 (patch)
treefccfb21b43b61d48da4832a6dc319e366e6127e7 /shell
parent04b46bced991f802a17c0fc43c8f8448e4eb2c8f (diff)
downloadbusybox-3ed7e2749a3f9fd315d8f46a3b0a25ff10caf726.zip
busybox-3ed7e2749a3f9fd315d8f46a3b0a25ff10caf726.tar.gz
ash testsuite: add return_in_trap1.tests
Currently it fails Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-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 a6e6378..a6e6378 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 f249802..f249802 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 80a062c..80a062c 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 d2a21d1..d2a21d1 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 3d00725..3d00725 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 2061105..2061105 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 0000000..a6e6378
--- /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 0000000..f249802
--- /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 a3e12ce..a3e12ce 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 0786b6d..0786b6d 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 a59225b..a59225b 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 c2b312f..c2b312f 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 ba7453e..ba7453e 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 c2b1381..c2b1381 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 2870a8e..2870a8e 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 1105479..1105479 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 71a6bc1..71a6bc1 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 eab5b9b..eab5b9b 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 f865b93..f865b93 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 d877f2b..d877f2b 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 c0dbd6c..c0dbd6c 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 d29c6e7..d29c6e7 100755
--- a/shell/hush_test/hush-trap/usage.tests
+++ b/shell/hush_test/hush-signals/usage.tests