Re: [PATCH 8/8] t0012: test "-h" with builtins

2 messages, 2 authors, 2017-05-30 · open the first message on its own page

Re: [PATCH 8/8] t0012: test "-h" with builtins

From: Junio C Hamano <hidden>
Date: 2017-05-30 06:03:26

Jeff King [off-list ref] writes:
quoted hunk
This patch just tests that "git foo -h" works for every
builtin, where we see a 129 exit code (the normal code for
our usage() helper), and that the word "usage" appears in
the output.

Signed-off-by: Jeff King <redacted>
---
 t/t0012-help.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 8faba2e8b..487b92a5d 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -49,4 +49,16 @@ test_expect_success "--help does not work for guides" "
 	test_i18ncmp expect actual
 "
 
+test_expect_success 'generate builtin list' '
+	git --list-builtins >builtins
+'
+
+while read builtin
+do
+	test_expect_success "$builtin can handle -h" '
+		test_expect_code 129 git $builtin -h >output 2>&1 &&
+		test_i18ngrep usage output
+	'
+done <builtins
+
These still seem to need further tweaks?

    diff-files
    diff-index
    diff-tree
    rev-list

Re: [PATCH 8/8] t0012: test "-h" with builtins

From: Jeff King <hidden>
Date: 2017-05-30 06:06:03

On Tue, May 30, 2017 at 03:03:18PM +0900, Junio C Hamano wrote:
quoted
+test_expect_success 'generate builtin list' '
+	git --list-builtins >builtins
+'
+
+while read builtin
+do
+	test_expect_success "$builtin can handle -h" '
+		test_expect_code 129 git $builtin -h >output 2>&1 &&
+		test_i18ngrep usage output
+	'
+done <builtins
+
These still seem to need further tweaks?

    diff-files
    diff-index
    diff-tree
    rev-list
How so? They pass the test for me, and the output for a manual run looks
sane.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help