curl-library
[PATCH 3/3] runtests.pl: use exit code of child for gdb
From: Peter Wu <peter_at_lekensteyn.nl>
Date: Mon, 17 Nov 2014 18:06:26 +0100
Date: Mon, 17 Nov 2014 18:06:26 +0100
test916 would be detect as fail when ran under gdb. Fix this by
returning the child exit code from gdb rather than assuming 0.
Signed-off-by: Peter Wu <peter_at_lekensteyn.nl>
---
tests/runtests.pl | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 3f8d160..ca17138 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -684,9 +684,9 @@ sub torture {
logmsg "*** Alloc number $limit is now set to fail ***\n" if($gdbthis);
- my $ret = 0;
+ my $ret;
if($gdbthis) {
- runclient(%gdbline)
+ $ret = runclient(%gdbline)
}
else {
$ret = runclient(%testcmd);
@@ -3565,6 +3565,7 @@ sub singletest {
cmd => [
$gdb,
"--directory", "libtest",
+ "-return-child-result",
$DBGCURL,
"-x", "$LOGDIR/gdbcmd"
],
@@ -3573,16 +3574,17 @@ sub singletest {
}
elsif($gdbthis) {
my $GDBW = ($gdbxwin) ? "-w" : "";
- runclient(
+ $cmdres = runclient(
cmd => [
$gdb,
"--directory", "libtest",
+ "-return-child-result",
$DBGCURL,
$GDBW,
"-x", "$LOGDIR/gdbcmd",
]
);
- $cmdres=0; # makes it always continue after a debugged run
+ $cmdres >>= 8;
}
else {
$cmdres = runclient(%test_command);
--
2.1.2
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-17