Patches attached. They will of course be forwarded upstream once they
have got through the build server adequately.
Description: In tests check exit status of debugger
The test scripts run bashdb against a script
and feed commands to the bashdb process, and compare
the output against the expected output. What the upstream
test code does not do is check the exit status of the bashdb
process. If it is not 0 that should be a test failure.
This patch fixes that by parsing the exit code and appending that
to the test output, which will cause the output to not match
against the expected output.
Author: Nicholas Bamber <nicho...@periapt.co.uk>
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801175
Forwarded: no
Last-Update: 2015-10-07
Index: bashdb/test/integration/check-common.sh.in
===================================================================
--- bashdb.orig/test/integration/check-common.sh.in
+++ bashdb/test/integration/check-common.sh.in
@@ -19,6 +19,27 @@ check_output() {
return $?
}
+# http://stackoverflow.com/questions/5451297/exit-code-when-crashed
+check_exit_status ()
+{
+ local status="$?";
+ local msg="";
+ local signal="";
+ if [ ${status} -ne 0 ]; then
+ if [ $((${status} < 128)) -ne 0 ]; then
+ msg="exit (${status})";
+ else
+ signal="$(builtin kill -l $((${status} - 128)) 2>/dev/null)";
+ if [ "$signal" ]; then
+ msg="kill -$signal$msg";
+ fi;
+ fi;
+ # want this to go to stdout to be captured
+ echo "INVESTIGATE EXIT FAILURE: [${status} => ${msg}]";
+ fi;
+ return 0
+}
+
run_debugger_opts="-B -q --no-init --no-highlight"
# Run the debugger on test program $1 with (optional) debugger options $2
# using commandfile $3. We assume $TOP_BUILDDIR, $TOP_SRCDIR and
@@ -29,6 +50,7 @@ run_debugger() {
[[ -z $short_test_name ]] && short_test_name=$TEST_NAME
typeset cmdfile=${3:-"${top_srcdir}/test/data/${short_test_name}.cmd"}
$SH -- ${top_builddir}/@PACKAGE@ $dbg_opts -x "$cmdfile" "$debugged_script" $ARGS
+ check_exit_status
}
ARGS=''
Description: Don't send commands to debgger it does not like
They cause it to SEGV. Presumably this is because the subject
script has gone away, but it is not entirely clear.
This patch is just intended to get the package to build reliably
on Debian and is not intended to address the underlying issue.
Also since we only updated sig-43.right it introduces a
dependency on bash version 4.3.
Author: Nicholas Bamber <nicho...@periapt.co.uk>
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801175
Forwarded: no
Last-Update: 2015-10-07
Index: bashdb/test/data/sig.cmd
===================================================================
--- bashdb.orig/test/data/sig.cmd
+++ bashdb/test/data/sig.cmd
@@ -15,9 +15,9 @@ handle TERM stack
handle INT nostop
eval kill -TERM $$
info signals
-continue
+quit
+#continue
### Should have printed a stack trace above...
-where 1
-kill
-y
-
+#where 1
+#kill
+#y
Index: bashdb/test/data/sig-43.right
===================================================================
--- bashdb.orig/test/data/sig-43.right
+++ bashdb/test/data/sig-43.right
@@ -52,8 +52,5 @@ SIGQUIT stop print showstack tr
SIGILL stop print showstack trap -- '_Dbg_sig_handler 4 "$BASH_COMMAND" "$@"' SIGILL
SIGTRAP stop print showstack trap -- '_Dbg_sig_handler 5 "$BASH_COMMAND" "$@"' SIGTRAP
SIGTERM stop noprint showstack trap -- '_Dbg_sig_handler 15 "$BASH_COMMAND" "$@"' SIGTERM
-+continue
-$? is 0
-$? is 0
-Debugged program terminated normally. Use q to quit or R to restart.
-+### Should have printed a stack trace above...
++quit
+bashdb: That's all, folks...