test: allow user to choose which gdb to run tests with

The variable used for selecting gdb is TEST_GDB, consistent with
TEST_CC and TEST_EMACS{,CLIENT}.
This commit is contained in:
Tomi Ollila 2017-01-07 11:47:27 +02:00 committed by David Bremner
parent b15b96f846
commit 95efe2d484
5 changed files with 9 additions and 8 deletions

View file

@ -317,7 +317,7 @@ end
run run
EOF 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 --args notmuch new 2>OUTPUT 1>/dev/null
echo "exit status: $?" >> OUTPUT echo "exit status: $?" >> OUTPUT

View file

@ -115,7 +115,7 @@ EOF
backup_database backup_database
test_begin_subtest "error message from query_search_messages" 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 --args notmuch count --output=files '*' 2>OUTPUT 1>/dev/null
cat <<EOF > EXPECTED cat <<EOF > EXPECTED
notmuch count: A Xapian exception occurred notmuch count: A Xapian exception occurred

View file

@ -206,22 +206,22 @@ gen_insert_msg
for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do 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" \ 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' \ -ex 'set args insert < $gen_msg_filename' \
-x index-file-$code.gdb notmuch" -x index-file-$code.gdb notmuch"
test_expect_code 0 "success exit with --keep when add_message returns $code" \ 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' \ -ex 'set args insert --keep < $gen_msg_filename' \
-x index-file-$code.gdb notmuch" -x index-file-$code.gdb notmuch"
done done
for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do
test_expect_code 75 "EX_TEMPFAIL when add_message returns $code" \ 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' \ -ex 'set args insert < $gen_msg_filename' \
-x index-file-$code.gdb notmuch" -x index-file-$code.gdb notmuch"
test_expect_code 0 "success exit with --keep when add_message returns $code" \ 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' \ -ex 'set args insert --keep < $gen_msg_filename' \
-x index-file-$code.gdb notmuch" -x index-file-$code.gdb notmuch"
done done

View file

@ -64,7 +64,7 @@ if test_require_external_prereq gdb; then
# -tty /dev/null works around a conflict between the 'timeout' wrapper # -tty /dev/null works around a conflict between the 'timeout' wrapper
# and gdb's attempt to control the TTY. # and gdb's attempt to control the TTY.
export MAIL_DIR 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 # Get the final, golden output
notmuch search '*' > expected notmuch search '*' > expected

View file

@ -80,6 +80,7 @@ if [[ ( -n "$TEST_EMACS" && -z "$TEST_EMACSCLIENT" ) || \
fi fi
TEST_EMACS=${TEST_EMACS:-${EMACS:-emacs}} TEST_EMACS=${TEST_EMACS:-${EMACS:-emacs}}
TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient} TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient}
TEST_GDB=${TEST_GDB:-gdb}
TEST_CC=${TEST_CC:-cc} TEST_CC=${TEST_CC:-cc}
TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"} TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"}
@ -1379,7 +1380,7 @@ esac
test_declare_external_prereq dtach test_declare_external_prereq dtach
test_declare_external_prereq emacs test_declare_external_prereq emacs
test_declare_external_prereq ${TEST_EMACSCLIENT} 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 gpg
test_declare_external_prereq openssl test_declare_external_prereq openssl
test_declare_external_prereq gpgsm test_declare_external_prereq gpgsm