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

Re: &&-chaining tester

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Dec 7, 2011, 19:36 UTC
Message-ID
<1323286611-4806-1-git-send-email-artagnon@gmail.com>
In-Reply-To
<20111207100858.GB13374@elie.hsd1.il.comcast.net>
Hi,
Jonathan Nieder wrote:
Show 10 quoted lines
> Ramkumar Ramachandra wrote:
>
>> Missing the chaining '&&' seems to be quite a common
>> error: I vaguely remember seeing a patch to detect this sometime ago.
>> Jonathan?
>
> [...]
>  - fix all cases of broken &&-chaining.  For extra bonus points,
>   send out those patches, respond to reviews, and gently usher
>   them into Junio's tree

Hm, involves a huge amount of janitorial work. Anyway, thanks for pointing me in the right direction- here's a small start.

[What I used; for reference]
--
 t/test-lib.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index bdd9513..3bf75ac 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -472,7 +472,17 @@ test_eval_ () {
 	eval >&3 2>&4 "$*"
 }
 
+check_command_chaining_ () {
+	eval >&3 2>&4 "(exit 189) && $1"
+	eval_chain_ret=$?
+	if test "$eval_chain_ret" != 189
+	then
+		echo '[CHAIN_BUG] in the test script: missing "&&" in test commands'
+	fi
+}
+
 test_run_ () {
+	check_command_chaining_ "$1"
 	test_cleanup=:
 	expecting_failure=$2
 	test_eval_ "$1"
-- 
Thanks.

-- Ram

Ramkumar Ramachandra (15):
  t1013 (loose-object-format): fix && chaining
  t1300 (repo-config): fix && chaining
  t1412 (reflog-loop): fix && chaining
  t1007 (hash-object): fix && chaining
  t1510 (repo-setup): fix && chaining
  t1511 (rev-parse-caret): fix && chaining
  t1510 (worktree): fix && chaining
  t3200 (branch): fix && chaining
  t3418 (rebase-continue): fix && chaining
  t3400 (rebase): fix && chaining
  t3310 (notes-merge-manual-resolve): fix && chaining
  t3419 (rebase-patch-id): fix && chaining
  t3030 (merge-recursive): use test_expect_code
  t1006 (cat-file): use test_cmp
  t3040 (subprojects-basic): modernize style

 t/t1006-cat-file.sh                   |   53 +++---------
 t/t1007-hash-object.sh                |   16 ++--
 t/t1013-loose-object-format.sh        |    2 +-
 t/t1300-repo-config.sh                |    2 +-
 t/t1412-reflog-loop.sh                |    2 +-
 t/t1501-worktree.sh                   |    6 +-
 t/t1510-repo-setup.sh                 |    4 +-
 t/t1511-rev-parse-caret.sh            |    2 +-
 t/t3030-merge-recursive.sh            |   72 ++---------------
 t/t3040-subprojects-basic.sh          |  144 ++++++++++++++++----------------
 t/t3200-branch.sh                     |    4 +-
 t/t3310-notes-merge-manual-resolve.sh |   10 +-
 t/t3400-rebase.sh                     |    4 +-
 t/t3418-rebase-continue.sh            |    4 +-
 t/t3419-rebase-patch-id.sh            |    2 +-
 15 files changed, 119 insertions(+), 208 deletions(-)

-- 
1.7.7.3
Previous: Jonathan NiederNext: Ramkumar Ramachandra
Message 6 of 45 in “What's cooking in git.git (Dec 2011, #02; Mon, 5)”
  1. Junio C HamanoDec 6, 2011
  2. Ramkumar RamachandraDec 6, 2011
  3. Junio C HamanoDec 6, 2011
  4. Ramkumar RamachandraDec 6, 2011
  5. &&-chaining testerJonathan Nieder, Dec 7, 2011
  6. Ramkumar RamachandraDec 7, 2011
  7. 01/15 t1013 (loose-object-format): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  8. 02/15 t1300 (repo-config): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  9. 03/15 t1412 (reflog-loop): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  10. 04/15 t1007 (hash-object): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  11. Jonathan NiederDec 7, 2011
  12. Ramkumar RamachandraDec 8, 2011
  13. 05/15 t1510 (repo-setup): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  14. 06/15 t1511 (rev-parse-caret): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  15. 07/15 t1510 (worktree): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  16. Jonathan NiederDec 7, 2011
  17. Ramkumar RamachandraDec 8, 2011
  18. 08/15 t3200 (branch): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  19. Jonathan NiederDec 7, 2011
  20. Ramkumar RamachandraDec 8, 2011
  21. 09/15 t3418 (rebase-continue): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  22. 10/15 t3400 (rebase): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  23. 11/15 t3310 (notes-merge-manual-resolve): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  24. 12/15 t3419 (rebase-patch-id): fix && chainingRamkumar Ramachandra, Dec 7, 2011
  25. 13/15 t3030 (merge-recursive): use test_expect_codeRamkumar Ramachandra, Dec 7, 2011
  26. Jonathan NiederDec 7, 2011
  27. 14/15 t1006 (cat-file): use test_cmpRamkumar Ramachandra, Dec 7, 2011
  28. Jonathan NiederDec 7, 2011
  29. 15/15 t3040 (subprojects-basic): modernize styleRamkumar Ramachandra, Dec 7, 2011
  30. Jonathan NiederDec 7, 2011
  31. Ramkumar RamachandraDec 8, 2011
  32. Matthieu MoyDec 8, 2011
  33. Junio C HamanoDec 8, 2011
  34. Jeff KingDec 6, 2011
  35. Erik Faye-LundDec 6, 2011
  36. Jeff KingDec 6, 2011
  37. Erik Faye-LundDec 8, 2011
  38. Junio C HamanoDec 8, 2011
  39. Junio C HamanoDec 6, 2011
  40. Jeff KingDec 6, 2011
  41. Nguyen Thai Ngoc DuyDec 6, 2011
  42. Junio C HamanoDec 6, 2011
  43. Nguyen Thai Ngoc DuyDec 6, 2011
  44. Junio C HamanoDec 6, 2011
  45. Luke DiamandDec 6, 2011

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.