unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 13/24] test: use source and build paths in T160-json.sh and T170-sexp.sh
Date: Mon, 25 Sep 2017 23:38:29 +0300	[thread overview]
Message-ID: <6ac13f2510644c5db920969dd3b83e496084da8b.1506370901.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1506370901.git.jani@nikula.org>
In-Reply-To: <cover.1506370901.git.jani@nikula.org>

Make a distinction between source and build directories.
---
 test/T160-json.sh | 4 ++--
 test/T170-sexp.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/T160-json.sh b/test/T160-json.sh
index 765b78a6746d..91b98e5d6bdc 100755
--- a/test/T160-json.sh
+++ b/test/T160-json.sh
@@ -41,13 +41,13 @@ id="json-show-inline-attachment-filename@notmuchmail.org"
 emacs_fcc_message \
     "$subject" \
     'This is a test message with inline attachment with a filename' \
-    "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")
+    "(mml-attach-file \"$NOTMUCH_SRCDIR/test/README\" nil nil \"inline\")
      (message-goto-eoh)
      (insert \"Message-ID: <$id>\n\")"
 output=$(notmuch show --format=json "id:$id")
 filename=$(notmuch search --output=files "id:$id")
 # Get length of README after base64-encoding, minus additional newline.
-attachment_length=$(( $(base64 $TEST_DIRECTORY/README | wc -c) - 1 ))
+attachment_length=$(( $(base64 $NOTMUCH_SRCDIR/test/README | wc -c) - 1 ))
 test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, \"excluded\": false, \"filename\": [\"$filename\"], \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"test_suite@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"content-length\": $attachment_length, \"content-transfer-encoding\": \"base64\", \"content-disposition\": \"inline\", \"filename\": \"README\"}]}]}, []]]]"
 
 test_begin_subtest "Search message: json, utf-8"
diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh
index 1125fdc91ec0..c3dcf52a8294 100755
--- a/test/T170-sexp.sh
+++ b/test/T170-sexp.sh
@@ -37,13 +37,13 @@ id="sexp-show-inline-attachment-filename@notmuchmail.org"
 emacs_fcc_message \
     "$subject" \
     'This is a test message with inline attachment with a filename' \
-    "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")
+    "(mml-attach-file \"$NOTMUCH_SRCDIR/test/README\" nil nil \"inline\")
      (message-goto-eoh)
      (insert \"Message-ID: <$id>\n\")"
 output=$(notmuch show --format=sexp "id:$id")
 filename=$(notmuch search --output=files "id:$id")
 # Get length of README after base64-encoding, minus additional newline.
-attachment_length=$(( $(base64 $TEST_DIRECTORY/README | wc -c) - 1 ))
+attachment_length=$(( $(base64 $NOTMUCH_SRCDIR/test/README | wc -c) - 1 ))
 test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :filename (\"$filename\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\") :headers (:Subject \"sexp-show-inline-attachment-filename\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"test_suite@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"multipart/mixed\" :content ((:id 2 :content-type \"text/plain\" :content \"This is a test message with inline attachment with a filename\") (:id 3 :content-type \"application/octet-stream\" :content-disposition \"inline\" :filename \"README\" :content-transfer-encoding \"base64\" :content-length $attachment_length))))) ())))"
 
 test_done
-- 
2.11.0

  parent reply	other threads:[~2017-09-25 20:39 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 20:38 [PATCH 00/24] test: separate source and build directories Jani Nikula
2017-09-25 20:38 ` [PATCH 01/24] test: use corpora/default not corpus in T480-hex-escaping.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 02/24] build: use NOTMUCH_SRCDIR for referencing notmuch-test Jani Nikula
2017-09-25 20:38 ` [PATCH 03/24] test: use $(dirname "$0") for sourcing test-lib.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 04/24] perf-test: use $(dirname "$0") for sourcing perf-test-lib.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 05/24] test: check for notmuch binary in test-lib.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 06/24] test: add a script to figure out source and build directories Jani Nikula
2017-09-25 20:38 ` [PATCH 07/24] test: use source and build paths in test-lib.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 08/24] perf-test: use source and build paths in perf-test-lib.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 09/24] test: use source and build paths in test-lib-common.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 10/24] test: mkdir and cd to $TMP_DIRECTORY instead of $test for testing Jani Nikula
2017-09-25 20:38 ` [PATCH 11/24] test: use source and build paths in notmuch-test Jani Nikula
2017-09-25 20:38 ` [PATCH 12/24] test: use source and build paths in T000-basic.sh Jani Nikula
2017-09-25 20:38 ` Jani Nikula [this message]
2017-09-25 20:38 ` [PATCH 14/24] test: use source and build paths in T260-thread-order.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 15/24] test: use source and build paths in T310-emacs.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 16/24] test: use source and build paths in T350-crypto.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 17/24] test: use source and build paths in T355-smime.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 18/24] test: use source and build paths in T360-symbol-hiding.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 19/24] test: use source and build paths in T380-atomicity.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 20/24] test: use source and build paths in T4?0-emacs-*.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 21/24] test: use source and build paths in T480-hex-escaping.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 22/24] test: use source and build paths in T590-thread-breakage.sh Jani Nikula
2017-09-25 20:38 ` [PATCH 23/24] build: don't copy the test directory for out-of-tree builds Jani Nikula
2017-09-25 20:38 ` [PATCH 24/24] devel: add script to test " Jani Nikula
2017-09-26  5:28   ` Tomi Ollila
2017-09-26  5:32     ` Tomi Ollila
2017-10-21  2:33 ` [PATCH 00/24] test: separate source and build directories David Bremner
2017-10-21 11:58   ` [PATCH] test: remove --root option and fix TMP_DIRECTORY cleanup Jani Nikula
2017-10-21 12:02     ` Jani Nikula
2017-10-21 15:02     ` David Bremner
2017-10-21 19:21       ` [PATCH v2] test: use source path in add_gnupg_home Jani Nikula
2017-10-21 19:31       ` [PATCH] test: remove --root option and fix TMP_DIRECTORY cleanup Jani Nikula
2017-10-21 19:53         ` [PATCH] NEWS: test suite out-of-tree builds Jani Nikula
2017-10-22 14:07           ` David Bremner
2017-10-21 20:44         ` [PATCH] test: remove --root option and fix TMP_DIRECTORY cleanup David Bremner

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=6ac13f2510644c5db920969dd3b83e496084da8b.1506370901.git.jani@nikula.org \
    --to=jani@nikula.org \
    --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).