Thread (39 messages) flat view 39 messages, 6 authors, 2016-06-15
STALE3732d

[PATCH v2 7/8] t5523-push-upstream: test progress messages

From: Tay Ray Chuan <hidden>
Date: 2016-06-15 22:49:48
Subsystem: the rest · Maintainer: Linus Torvalds

Reported-by: Chase Brammer <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
---

  Squashed in Jeff's additional tests, as well as added (missing) TTY
  pre-requisites pointed out by Johnathan.

 t/t5523-push-upstream.sh |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index 5a18533..f43d760 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -2,6 +2,7 @@
 
 test_description='push with --set-upstream'
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-terminal.sh
 
 ensure_fresh_upstream() {
 	rm -rf parent && git init --bare parent
@@ -70,4 +71,41 @@ test_expect_success 'push -u HEAD' '
 	check_config headbranch upstream refs/heads/headbranch
 '
 
+test_expect_success TTY 'progress messages go to tty' '
+	ensure_fresh_upstream &&
+
+	test_terminal git push -u upstream master >out 2>err &&
+	grep "Writing objects" err
+'
+
+test_expect_failure 'progress messages do not go to non-tty' '
+	ensure_fresh_upstream &&
+
+	# skip progress messages, since stderr is non-tty
+	git push -u upstream master >out 2>err &&
+	! grep "Writing objects" err
+'
+
+test_expect_failure 'progress messages go to non-tty (forced)' '
+	ensure_fresh_upstream &&
+
+	# force progress messages to stderr, even though it is non-tty
+	git push -u --progress upstream master >out 2>err &&
+	grep "Writing objects" err
+'
+
+test_expect_success TTY 'push -q suppresses progress' '
+	ensure_fresh_upstream &&
+
+	test_terminal git push -u -q upstream master >out 2>err &&
+	! grep "Writing objects" err
+'
+
+test_expect_failure TTY 'push --no-progress suppresses progress' '
+	ensure_fresh_upstream &&
+
+	test_terminal git push -u --no-progress upstream master >out 2>err &&
+	! grep "Writing objects" err
+'
+
 test_done
-- 
1.7.2.2.513.ge1ef3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help