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

[PATCH] Skip t3403 selftests if stdin is not a terminal

From
Gerrit Pape <pape@smarden.org>
Date
Sep 15, 2006, 12:59 UTC
Message-ID
<20060915125910.10514.qmail@26499ea44f2ee3.315fe32.mid.smarden.org>

sh t3403-rebase-skip.sh </dev/null fails because stdin is not connected to a terminal, as in the Debian autobuild environment. This disbales the test 3 and 7 in this case.

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 t/t3403-rebase-skip.sh |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index 8ab63c5..983d152 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -39,10 +39,16 @@ test_expect_success setup '
 
 test_expect_failure 'rebase with git am -3 (default)' 'git rebase master'
 
-test_expect_success 'rebase --skip with am -3' '
-	git reset --hard HEAD &&
-	git rebase --skip
-	'
+if tty -s
+then
+	test_expect_success 'rebase --skip with am -3' '
+		git reset --hard HEAD &&
+		git rebase --skip
+		'
+else
+	echo 'stdin is not a terminal, skip test.'
+fi
+
 test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
 
 test_expect_failure 'rebase with --merge' 'git rebase --merge master'
@@ -52,8 +58,13 @@ test_expect_success 'rebase --skip with 
 	git rebase --skip
 	'
 
-test_expect_success 'merge and reference trees equal' \
-	'test -z "`git-diff-tree skip-merge skip-reference`"'
+if tty -s
+then
+	test_expect_success 'merge and reference trees equal' \
+		'test -z "`git-diff-tree skip-merge skip-reference`"'
+else
+	echo 'stdin is not a terminal, skip test.'
+fi
 
 test_debug 'gitk --all & sleep 1'
 
-- 
1.4.2.1
Next: Junio C Hamano
Message 1 of 4 in “Skip t3403 selftests if stdin is not a terminal”
  1. Skip t3403 selftests if stdin is not a terminalGerrit Pape, Sep 15, 2006
  2. Junio C HamanoSep 16, 2006
  3. Junio C HamanoSep 16, 2006
  4. Gerrit PapeSep 19, 2006

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.