aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2016-11-28 23:07:08 +0200
committerDavid Bremner <david@tethera.net>2016-12-07 07:00:39 -0400
commit27e293f653b2688fc4452a92c99e76c7e97669d1 (patch)
tree47166859ec6f6bd95208669507d28634bf777c46
parent636367b4cf0bd8059a2238773dc40d55a2fb3472 (diff)
test: gdb insert: redirect input inside gdb script
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.
-rwxr-xr-xtest/T070-insert.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/T070-insert.sh b/test/T070-insert.sh
index c2485bb2..43b3abcf 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