unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH] test: allow user to choose which gdb to run tests with
Date: Sat,  7 Jan 2017 11:47:27 +0200	[thread overview]
Message-ID: <20170107094727.428-1-tomi.ollila@iki.fi> (raw)

The variable used for selecting gdb is TEST_GDB, consistent with
TEST_CC and TEST_EMACS{,CLIENT}.
---

I tested this on FreeBSD kvm virtual machine, changed

env PATH=/usr/local/bin:$PATH CPATH=/usr/local/include LIBRARY_PATH=/usr/local/lib script typescript gmake test

to

env TEST_GDB=/usr/local/bin/gdb CPATH=/usr/local/include LIBRARY_PATH=/usr/local/lib script typescript gmake test

and got same results.

 test/T050-new.sh       | 2 +-
 test/T060-count.sh     | 2 +-
 test/T070-insert.sh    | 8 ++++----
 test/T380-atomicity.sh | 2 +-
 test/test-lib.sh       | 3 ++-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/test/T050-new.sh b/test/T050-new.sh
index 2bc799d..9115de8 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -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
 
diff --git a/test/T060-count.sh b/test/T060-count.sh
index 69ab591..d27e1ba 100755
--- a/test/T060-count.sh
+++ b/test/T060-count.sh
@@ -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
diff --git a/test/T070-insert.sh b/test/T070-insert.sh
index 57472b9..7e04a23 100755
--- a/test/T070-insert.sh
+++ b/test/T070-insert.sh
@@ -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
diff --git a/test/T380-atomicity.sh b/test/T380-atomicity.sh
index 845dfde..c6a9fb9 100755
--- a/test/T380-atomicity.sh
+++ b/test/T380-atomicity.sh
@@ -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
diff --git a/test/test-lib.sh b/test/test-lib.sh
index f55d2c6..6f9468a 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -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
-- 
2.9.3

             reply	other threads:[~2017-01-07  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07  9:47 Tomi Ollila [this message]
2017-01-08 14:56 ` [PATCH] test: allow user to choose which gdb to run tests with David Bremner
2017-01-11 19:18   ` Mikhail
2017-02-05 17:57     ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170107094727.428-1-tomi.ollila@iki.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).