From 3ed7e2749a3f9fd315d8f46a3b0a25ff10caf726 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 1 Oct 2016 22:36:14 +0200 Subject: [PATCH] ash testsuite: add return_in_trap1.tests Currently it fails Signed-off-by: Denys Vlasenko --- .../ash-signals}/return_in_trap1.right | 0 .../ash-signals}/return_in_trap1.tests | 0 .../{hush-trap => hush-signals}/catch.right | 0 .../{hush-trap => hush-signals}/catch.tests | 0 .../{hush-trap => hush-signals}/exit.right | 0 .../{hush-trap => hush-signals}/exit.tests | 0 .../hush-signals/return_in_trap1.right | 4 ++++ .../hush-signals/return_in_trap1.tests | 18 ++++++++++++++++++ .../{hush-trap => hush-signals}/save-ret.right | 0 .../{hush-trap => hush-signals}/save-ret.tests | 0 .../{hush-trap => hush-signals}/savetrap.right | 0 .../{hush-trap => hush-signals}/savetrap.tests | 0 .../{hush-trap => hush-signals}/signal7.right | 0 .../{hush-trap => hush-signals}/signal7.tests | 0 .../signal_read1.right | 0 .../signal_read1.tests | 0 .../signal_read2.right | 0 .../signal_read2.tests | 0 .../{hush-trap => hush-signals}/subshell.right | 0 .../{hush-trap => hush-signals}/subshell.tests | 0 .../{hush-trap => hush-signals}/usage.right | 0 .../{hush-trap => hush-signals}/usage.tests | 0 22 files changed, 22 insertions(+) rename shell/{hush_test/hush-trap => ash_test/ash-signals}/return_in_trap1.right (100%) rename shell/{hush_test/hush-trap => ash_test/ash-signals}/return_in_trap1.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/catch.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/catch.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/exit.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/exit.tests (100%) create mode 100644 shell/hush_test/hush-signals/return_in_trap1.right create mode 100755 shell/hush_test/hush-signals/return_in_trap1.tests rename shell/hush_test/{hush-trap => hush-signals}/save-ret.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/save-ret.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/savetrap.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/savetrap.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/signal7.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/signal7.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/signal_read1.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/signal_read1.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/signal_read2.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/signal_read2.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/subshell.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/subshell.tests (100%) rename shell/hush_test/{hush-trap => hush-signals}/usage.right (100%) rename shell/hush_test/{hush-trap => hush-signals}/usage.tests (100%) diff --git a/shell/hush_test/hush-trap/return_in_trap1.right b/shell/ash_test/ash-signals/return_in_trap1.right similarity index 100% rename from shell/hush_test/hush-trap/return_in_trap1.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/return_in_trap1.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/catch.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/catch.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/exit.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/exit.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/save-ret.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/save-ret.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/savetrap.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/savetrap.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/signal7.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/signal7.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/signal_read1.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/signal_read1.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/signal_read2.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/signal_read2.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/subshell.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/subshell.tests rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/usage.right rename to 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 similarity index 100% rename from shell/hush_test/hush-trap/usage.tests rename to shell/hush_test/hush-signals/usage.tests