git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC v2 1/5] t9001-send-email: move script creation in a setup test

From
Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Date
Jun 6, 2015, 16:59 UTC
Message-ID
<1433609976-1868-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr>

Move the creation of the scripts used in to-cmd and cc-cmd tests in a setup test to make them available for later tests.

This will be used in the next commit.
Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
---
 t/t9001-send-email.sh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 7be14a4..e63fc83 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -312,13 +312,19 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email'
 	)
 '
 
+test_expect_success $PREREQ 'setup tocmd and cccmd scripts' '
+	write_script tocmd-sed <<-\EOF &&
+	sed -n -e "s/^tocmd--//p" "$1"
+	EOF
+	write_script cccmd-sed <<-\EOF
+	sed -n -e "s/^cccmd--//p" "$1"
+	EOF
+'
+
 test_expect_success $PREREQ 'tocmd works' '
 	clean_fake_sendmail &&
 	cp $patches tocmd.patch &&
 	echo tocmd--tocmd@example.com >>tocmd.patch &&
-	write_script tocmd-sed <<-\EOF &&
-	sed -n -e "s/^tocmd--//p" "$1"
-	EOF
 	git send-email \
 		--from="Example <nobody@example.com>" \
 		--to-cmd=./tocmd-sed \
@@ -332,9 +338,6 @@ test_expect_success $PREREQ 'cccmd works' '
 	clean_fake_sendmail &&
 	cp $patches cccmd.patch &&
 	echo "cccmd--  cccmd@example.com" >>cccmd.patch &&
-	write_script cccmd-sed <<-\EOF &&
-	sed -n -e "s/^cccmd--//p" "$1"
-	EOF
 	git send-email \
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
-- 
1.9.1
Next: Remi Lespinet
Message 1 of 11 in “t9001-send-email: move script creation in a setup test”
  1. 1/5 t9001-send-email: move script creation in a setup testRemi Lespinet, Jun 6, 2015
  2. 2/5 send-email: allow aliases in patch header and command script outputsRemi Lespinet, Jun 6, 2015
  3. 3/5 t9001-send-email: refactor header variable fields replacementRemi Lespinet, Jun 6, 2015
  4. 4/5 send-email: allow multiple emails using --cc, --to and --bccRemi Lespinet, Jun 6, 2015
  5. 5/5 send-email: refactor address list processRemi Lespinet, Jun 6, 2015
  6. Matthieu MoyJun 8, 2015
  7. 5/5 send-email: refactor address list processRemi Lespinet, Jun 8, 2015
  8. Matthieu MoyJun 8, 2015
  9. 5/5 send-email: refactor address list processRemi Lespinet, Jun 8, 2015
  10. Junio C HamanoJun 8, 2015
  11. 5/5 send-email: refactor address list processRemi Lespinet, Jun 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.