]> git.notmuchmail.org Git - notmuch/commitdiff
test: gdb insert: redirect input inside gdb script
authorTomi Ollila <tomi.ollila@iki.fi>
Mon, 28 Nov 2016 21:07:08 +0000 (23:07 +0200)
committerDavid Bremner <david@tethera.net>
Wed, 7 Dec 2016 11:00:39 +0000 (07:00 -0400)
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.

test/T070-insert.sh

index c2485bb2c2bd71bf0e1a51db5b9f833d03e018c6..43b3abcff58d37c0ab7b6716b392fa6c40f16f2c 100755 (executable)
@@ -202,13 +202,15 @@ end
 run
 EOF
 test_begin_subtest "error exit when add_message returns $code"
 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"
 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
 
 test_expect_equal $? 0
 done