test: allow user to choose which gdb to run tests with
authorTomi Ollila <tomi.ollila@iki.fi>
Sat, 7 Jan 2017 09:47:27 +0000 (11:47 +0200)
committerDavid Bremner <david@tethera.net>
Sun, 8 Jan 2017 14:50:28 +0000 (10:50 -0400)
The variable used for selecting gdb is TEST_GDB, consistent with
TEST_CC and TEST_EMACS{,CLIENT}.

test/T050-new.sh
test/T060-count.sh
test/T070-insert.sh
test/T380-atomicity.sh
test/test-lib.sh

index 2bc799d2e2bcb513afecb42940a108ca00720541..9115de820770181bd6ff8f8c9b655d047e9fd8c9 100755 (executable)
@@ -317,7 +317,7 @@ end
 run
 EOF
 
-gdb --batch-silent --return-child-result -x notmuch-new-vanish.gdb \
+${TEST_GDB} --batch-silent --return-child-result -x notmuch-new-vanish.gdb \
     --args notmuch new 2>OUTPUT 1>/dev/null
 echo "exit status: $?" >> OUTPUT
 
index 69ab591fe0bd2dd3f1ac68039b007c630cd25709..d27e1babd0a600a60a29203b44a6d5d8ea74d39b 100755 (executable)
@@ -115,7 +115,7 @@ EOF
 
 backup_database
 test_begin_subtest "error message from query_search_messages"
-gdb --batch-silent --return-child-result -x count-files.gdb \
+${TEST_GDB} --batch-silent --return-child-result -x count-files.gdb \
     --args notmuch count --output=files '*' 2>OUTPUT 1>/dev/null
 cat <<EOF > EXPECTED
 notmuch count: A Xapian exception occurred
index 57472b913964e4ca0200de2cc5ccea5bb98253f5..7e04a23d93e2b0817f8c847bc7840bc0dbfb1b2a 100755 (executable)
@@ -206,22 +206,22 @@ gen_insert_msg
 
 for code in  FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
     test_expect_code 1 "EXIT_FAILURE when add_message returns $code" \
-         "gdb --batch-silent --return-child-result \
+         "${TEST_GDB} --batch-silent --return-child-result \
             -ex 'set args insert < $gen_msg_filename' \
             -x index-file-$code.gdb notmuch"
     test_expect_code 0 "success exit with --keep when add_message returns $code" \
-         "gdb --batch-silent --return-child-result \
+         "${TEST_GDB} --batch-silent --return-child-result \
             -ex 'set args insert --keep < $gen_msg_filename' \
             -x index-file-$code.gdb notmuch"
 done
 
 for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do
     test_expect_code 75 "EX_TEMPFAIL when add_message returns $code" \
-         "gdb --batch-silent --return-child-result \
+         "${TEST_GDB} --batch-silent --return-child-result \
             -ex 'set args insert < $gen_msg_filename' \
             -x index-file-$code.gdb notmuch"
     test_expect_code 0 "success exit with --keep when add_message returns $code" \
-         "gdb --batch-silent --return-child-result \
+         "${TEST_GDB} --batch-silent --return-child-result \
             -ex 'set args insert --keep < $gen_msg_filename' \
             -x index-file-$code.gdb notmuch"
 done
index 845dfde75fd6e8bae20283da3285d3046b498761..c6a9fb980bf0d4678a444939f5bb97ddd957747a 100755 (executable)
@@ -64,7 +64,7 @@ if test_require_external_prereq gdb; then
     # -tty /dev/null works around a conflict between the 'timeout' wrapper
     # and gdb's attempt to control the TTY.
     export MAIL_DIR
-    gdb -tty /dev/null -batch -x $TEST_DIRECTORY/atomicity.py notmuch 1>gdb.out 2>&1
+    ${TEST_GDB} -tty /dev/null -batch -x $TEST_DIRECTORY/atomicity.py notmuch 1>gdb.out 2>&1
 
     # Get the final, golden output
     notmuch search '*' > expected
index f55d2c67aac15a9a0d2b0238c6655d33aa37ed50..6f9468ae43bc22760b11b72ed7547d8cacb0b8d6 100644 (file)
@@ -80,6 +80,7 @@ if [[ ( -n "$TEST_EMACS" && -z "$TEST_EMACSCLIENT" ) || \
 fi
 TEST_EMACS=${TEST_EMACS:-${EMACS:-emacs}}
 TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient}
+TEST_GDB=${TEST_GDB:-gdb}
 TEST_CC=${TEST_CC:-cc}
 TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"}
 
@@ -1379,7 +1380,7 @@ esac
 test_declare_external_prereq dtach
 test_declare_external_prereq emacs
 test_declare_external_prereq ${TEST_EMACSCLIENT}
-test_declare_external_prereq gdb
+test_declare_external_prereq ${TEST_GDB}
 test_declare_external_prereq gpg
 test_declare_external_prereq openssl
 test_declare_external_prereq gpgsm