Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Henriques <henrix@camandro.org>2014-12-04 22:11:30 +0300
committerJunio C Hamano <gitster@pobox.com>2014-12-16 02:18:24 +0300
commit2cf770f50185fc7a1e3aaa0463eb452d32517f83 (patch)
tree9d1eda5d38be8301342d5ce83b684c3e2ca95508 /t/t9001-send-email.sh
parentac1596a684a44144efa2d52d9104b0d627e6d9a1 (diff)
test/send-email: --[no-]xmailer tests
Add tests for the --[no-]xmailer option. Signed-off-by: Luis Henriques <henrix@camandro.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 19a3ced600..aa6137bfe1 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1407,4 +1407,37 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
grep "^!someone@example\.org!$" commandline1
'
+do_xmailer_test () {
+ expected=$1 params=$2 &&
+ git format-patch -1 &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=someone@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $params \
+ 0001-*.patch \
+ 2>errors >out &&
+ { grep '^X-Mailer:' out || :; } >mailer &&
+ test_line_count = $expected mailer
+}
+
+test_expect_success $PREREQ '--[no-]xmailer without any configuration' '
+ do_xmailer_test 1 "--xmailer" &&
+ do_xmailer_test 0 "--no-xmailer"
+'
+
+test_expect_success $PREREQ '--[no-]xmailer with sendemail.xmailer=true' '
+ test_config sendemail.xmailer true &&
+ do_xmailer_test 1 "" &&
+ do_xmailer_test 0 "--no-xmailer" &&
+ do_xmailer_test 1 "--xmailer"
+'
+
+test_expect_success $PREREQ '--[no-]xmailer with sendemail.xmailer=false' '
+ test_config sendemail.xmailer false &&
+ do_xmailer_test 0 "" &&
+ do_xmailer_test 0 "--no-xmailer" &&
+ do_xmailer_test 1 "--xmailer"
+'
+
test_done