]> git.cworth.org Git - notmuch/commitdiff
Merge tag '0.32'
authorDavid Bremner <david@tethera.net>
Sun, 2 May 2021 10:41:42 +0000 (07:41 -0300)
committerDavid Bremner <david@tethera.net>
Sun, 2 May 2021 10:41:42 +0000 (07:41 -0300)
notmuch 0.32 release

12 files changed:
NEWS
performance-test/README
performance-test/perf-test-lib.sh
test/T310-emacs.sh
test/T350-crypto.sh
test/T355-smime.sh
test/T357-index-decryption.sh
test/T450-emacs-show.sh
test/T460-emacs-tree.sh
test/T730-emacs-forwarding.sh
test/test-lib.sh
vim/notmuch.vim

diff --git a/NEWS b/NEWS
index 8cb9b3458fdc2f7b4ac5d303bcccddd0156b55d2..96765c7335e932c5916ab9b0eb23caef60d8b11a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Notmuch 0.33 (UNRELEASED)
+=========================
+
+Vim
+---
+
+Respect excluded tags when showing a thread.
+
 Notmuch 0.32 (2021-05-02)
 =========================
 
index fbc61028d2db4dfdc204cd4a78e2613cadd78c3c..59b37b1b8ff033092591ede74f9b1f7eb551ec62 100644 (file)
@@ -16,6 +16,7 @@ In addition to having notmuch, you need:
 - xz. Some speedup can be gotten by installing "pixz", but this is
   probably only worthwhile if you are debugging the tests.
 - valgrind (for the memory tests)
+- perf (optional, for more fine-grained timing)
 
 Getting set up to run tests:
 ----------------------------
@@ -56,11 +57,24 @@ supports the following arguments
 
 --small / --medium / --large   Choose corpus size.
 --debug                                Enable debugging. In particular don't delete
-                               temporary directories.
+                                temporary directories.
+--perf                          Run perf record in place of /usr/bin/time. Perf output can be
+                                found in a log directory.
+--call-graph {fp,lbr,dwarf}     Call graph option for perf record. Default is 'lbr'.
 
 When using the make targets, you can pass arguments to all test
 scripts by defining the make variable OPTIONS.
 
+Log Directory
+-------------
+
+The memory tests, and the time tests when option '--perf' is given
+save their output in a directory named as follows
+
+     log.$test_name-$corpus_size-$timestamp
+
+These directories are removed by "make clean".
+
 Writing tests
 -------------
 
index b70288ccaf316158b5c6ab16a46bff799c1b46a0..e7c502b6ca3d024aab87ab4d60d808fa8cf199df 100644 (file)
@@ -1,6 +1,9 @@
 . $(dirname "$0")/version.sh || exit 1
 
+debug=""
 corpus_size=large
+perf_callgraph=lbr
+use_perf=0
 
 while test "$#" -ne 0
 do
@@ -9,6 +12,15 @@ do
                debug=t;
                shift
                ;;
+       -p|--perf)
+               use_perf=1;
+               shift
+               ;;
+       -c|--call-graph)
+               shift
+               perf_callgraph=$1
+               shift
+               ;;
        -s|--small)
                corpus_size=small;
                shift
@@ -127,10 +139,20 @@ notmuch_new_with_cache ()
     fi
 }
 
+make_log_dir () {
+    local timestamp=$(date +%Y%m%dT%H%M%S)
+    log_dir=${TEST_DIRECTORY}/log.$(basename $0)-$corpus_size-${timestamp}
+    mkdir -p "${log_dir}"
+}
+
 time_start ()
 {
     add_email_corpus
 
+    if [[ "$use_perf" = 1 ]]; then
+       make_log_dir
+    fi
+
     print_header
 
     notmuch_new_with_cache time_run
@@ -140,9 +162,7 @@ memory_start ()
 {
     add_email_corpus
 
-    local timestamp=$(date +%Y%m%dT%H%M%S)
-    log_dir="${TEST_DIRECTORY}/log.$(basename $0)-$corpus_size-${timestamp}"
-    mkdir -p ${log_dir}
+    make_log_dir
 
     notmuch_new_with_cache memory_run
 }
@@ -193,7 +213,13 @@ time_run ()
     printf "  %-22s" "$1"
     test_count=$(($test_count+1))
     if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
-    if ! eval >&3 "/usr/bin/time -f '%e\t%U\t%S\t%M\t%I/%O' $2" ; then
+    if [[ "$use_perf" = 1 ]]; then
+       command_str="perf record --call-graph=${perf_callgraph} -o ${log_dir}/${test_count}.perf $2"
+    else
+       command_str="/usr/bin/time -f '%e\t%U\t%S\t%M\t%I/%O' $2"
+    fi
+
+    if ! eval >&3 "$command_str" ; then
        test_failure=$(($test_failure + 1))
        return 1
     fi
index 78ac19a8655c150bd428657fcd387336b7b689d4..e64627c6729fab8a1606730f7f036bdccd5db0ba 100755 (executable)
@@ -5,6 +5,7 @@ test_description="emacs interface"
 
 EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output
 
+test_require_emacs
 add_email_corpus
 
 # syntax errors in test-lib.el cause mysterious failures
index 0aada4dfe7023a15384f121fb794f97126d9a30a..ae1d6a98bc9134ee74b49f6c9c344c7f53f04bbe 100755 (executable)
@@ -9,6 +9,7 @@ test_description='PGP/MIME signature verification and decryption'
 
 ##################################################
 
+test_require_emacs
 add_gnupg_home
 
 test_begin_subtest "emacs delivery of signed message"
index 8b2b52be032a34ec539ee673ffa8fee23dc8dc3d..12ac2525345a2196e6ce8f8ecc2036d3c15eeb7a 100755 (executable)
@@ -3,6 +3,7 @@
 test_description='S/MIME signature verification and decryption'
 . $(dirname "$0")/test-lib.sh || exit 1
 
+test_require_emacs
 test_require_external_prereq openssl
 test_require_external_prereq gpgsm
 
index 1ed5f28cfc455bd74d30f0f047032f75595c2886..b81bdfe192805f9d7a5ae2a1cd43af692405add8 100755 (executable)
@@ -7,6 +7,7 @@ test_description='indexing decrypted mail'
 
 ##################################################
 
+test_require_emacs
 add_gnupg_home
 
 # create a test encrypted message
index cca56ca32cd6875e6da4dbcd7b3b90932b3e3bef..bd76d378e8fd693641ddd106a2299dde018dea1d 100755 (executable)
@@ -5,6 +5,7 @@ test_description="emacs notmuch-show view"
 
 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output
 
+test_require_emacs
 add_email_corpus
 
 test_begin_subtest "Hiding Original Message region at beginning of a message"
index cb2c90b80991ec4a1bf31529bc1f6e74493eefdd..195485c156d312f46680792284ec62048faee828 100755 (executable)
@@ -5,6 +5,7 @@ test_description="emacs tree view interface"
 
 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-tree.expected-output
 
+test_require_emacs
 add_email_corpus
 
 test_begin_subtest "Basic notmuch-tree view in emacs"
index 45e61568ec62540b03094562dfb3aa1c0def08f8..5d6ac9f052b15583407e9117fdb1a6d11b29ec94 100755 (executable)
@@ -3,6 +3,8 @@
 test_description="emacs forwarding"
 . $(dirname "$0")/test-lib.sh || exit 1
 
+test_require_emacs
+
 test_begin_subtest "Forward setting the correct references header"
 # Check that, when forwarding a message, the new message has
 # a References-header pointing to the original (forwarded) message.
index 4c9f2a2103e32a18c2c14dc257669300ecbe4d6f..88e2a82f7337e9bf0a755b70187e8bbc342bada1 100644 (file)
@@ -112,6 +112,13 @@ unset ALTERNATE_EDITOR
 
 # for reproducibility
 unset EMAIL
+unset NAME
+
+test_require_emacs () {
+    test_require_external_prereq emacs
+    test_require_external_prereq ${TEST_EMACSCLIENT}
+    test_require_external_prereq dtach
+}
 
 add_gnupg_home ()
 {
@@ -591,6 +598,9 @@ test_emacs_expect_t () {
                exec 1>&6 2>&7          # Restore stdout and stderr
                inside_subtest=
 
+               # test_emacs may update missing external prerequisites
+               test_check_missing_external_prereqs_ "$test_subtest_name" && return
+
                # Report success/failure.
                result=$(cat OUTPUT)
                if [ "$result" = t ]
@@ -708,10 +718,15 @@ import os, sys, pwd, socket
 pw = pwd.getpwuid(os.getuid())
 user = pw.pw_name
 name = pw.pw_gecos.partition(",")[0]
-fqdn = socket.getfqdn()
+fqdn = socket.getaddrinfo(socket.gethostname(), 0, 0, socket.SOCK_STREAM, 0, socket.AI_CANONNAME)[0][3]
 
 for l in sys.stdin:
-    l = l.replace(user, "USERNAME").replace(fqdn, "FQDN").replace(".(none)","").replace(name, "USER_FULL_NAME")
+    if user:
+        l = l.replace(user, "USERNAME")
+    if fqdn:
+        l = l.replace(fqdn, "FQDN").replace(".(none)","")
+    if name:
+        l = l.replace(name, "USER_FULL_NAME")
     sys.stdout.write(l)
 '
 }
@@ -913,7 +928,7 @@ test_expect_success () {
                test_run_ "$1"
                run_ret="$?"
                # test_run_ may update missing external prerequisites
-               test_check_missing_external_prereqs_ "$@" ||
+               test_check_missing_external_prereqs_ "$test_subtest_name" ||
                if [ "$run_ret" = 0 -a "$eval_ret" = 0 ]
                then
                        test_ok_
@@ -937,7 +952,7 @@ test_expect_code () {
                test_run_ "$2"
                run_ret="$?"
                # test_run_ may update missing external prerequisites,
-               test_check_missing_external_prereqs_ "$@" ||
+               test_check_missing_external_prereqs_ "$test_subtest_name" ||
                if [ "$run_ret" = 0 -a "$eval_ret" = "$1" ]
                then
                        test_ok_
index 541698cdfee7939e05aa3554ff39c91295920940..c1c2f63d20178dab69f92c9ff9aab4631dda6ee5 100644 (file)
@@ -317,6 +317,9 @@ ruby << EOF
        $curbuf.render do |b|
                q = $curbuf.query(get_cur_view)
                q.sort = Notmuch::SORT_OLDEST_FIRST
+               $exclude_tags.each { |t|
+                       q.add_tag_exclude(t)
+               }
                msgs = q.search_messages
                msgs.each do |msg|
                        m = Mail.read(msg.filename)