* [PATCH] test: gdb insert: redirect input inside gdb script
@ 2016-11-28 21:07 Tomi Ollila
0 siblings, 0 replies; only message in thread
From: Tomi Ollila @ 2016-11-28 21:07 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
Running `gdb command < input` is not as reliable way to give input
to the command (some installations of gdb consume it). Use "set args"
gdb command to have input redirected at gdb 'run' time.
---
With this change, these tests work on FreeBSD-11.0-RELEASE-amd64[.qcow2]
when adding gdb 7.11.1 using pkg install (and having /usr/local/bin in
front of path) -- before this gdb just hang -- and it took a while...
On Linux this test keeps working.
After commit and before amend(*) I dropped '-nx' command line option
(to not read any gdbinit files). Perhaps all gdb invocations should
have that (currently none has).
(*) git commit -a --amend -C HEAD ;: let the virus spread :)
test/T070-insert.sh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/test/T070-insert.sh b/test/T070-insert.sh
index c2485bb..43b3abc 100755
--- a/test/T070-insert.sh
+++ b/test/T070-insert.sh
@@ -202,13 +202,15 @@ end
run
EOF
test_begin_subtest "error exit when add_message returns $code"
-gdb --batch-silent --return-child-result -x index-file-$code.gdb \
- --args notmuch insert < $gen_msg_filename
+gdb --batch-silent --return-child-result \
+ -ex "set args insert < $gen_msg_filename" \
+ -x index-file-$code.gdb notmuch
test_expect_equal $? 1
test_begin_subtest "success exit with --keep when add_message returns $code"
-gdb --batch-silent --return-child-result -x index-file-$code.gdb \
- --args notmuch insert --keep < $gen_msg_filename
+gdb --batch-silent --return-child-result \
+ -ex "set args insert --keep < $gen_msg_filename" \
+ -x index-file-$code.gdb notmuch
test_expect_equal $? 0
done
--
2.10.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-28 21:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28 21:07 [PATCH] test: gdb insert: redirect input inside gdb script Tomi Ollila
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).