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

[PATCH 02/10] test suite: Use 'say' to say something instead of 'test_expect_success'

From
Johannes Sixt <j6t@kdbg.org>
Date
Mar 18, 2009, 21:27 UTC
Message-ID
<199f6a5e20f857a53af50872927a8086ce221345.1237410682.git.j6t@kdbg.org>
In-Reply-To
<cover.1237410682.git.j6t@kdbg.org>

Some tests report that some tests will be skipped. They used 'test_exect_success' with a trivially successful test. Nowadays we have the helper function 'say' for this purpose.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/lib-git-svn.sh                       |    6 +++---
 t/t0024-crlf-archive.sh                |    2 +-
 t/t3600-rm.sh                          |    2 +-
 t/t5000-tar-tree.sh                    |    2 +-
 t/t7004-tag.sh                         |    4 ++--
 t/t9200-git-cvsexportcommit.sh         |    2 +-
 t/t9400-git-cvsserver-server.sh        |    4 ++--
 t/t9401-git-cvsserver-crlf.sh          |    4 ++--
 t/t9500-gitweb-standalone-no-errors.sh |    2 +-
 t/t9700-perl-git.sh                    |    2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 67c431d..de384e6 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -5,7 +5,7 @@ git_svn_id=git""-svn-id
 
 if test -n "$NO_SVN_TESTS"
 then
-	test_expect_success 'skipping git svn tests, NO_SVN_TESTS defined' :
+	say 'skipping git svn tests, NO_SVN_TESTS defined'
 	test_done
 	exit
 fi
@@ -17,7 +17,7 @@ SVN_TREE=$GIT_SVN_DIR/svn-tree
 svn >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git svn tests, svn not found' :
+    say 'skipping git svn tests, svn not found'
     test_done
     exit
 fi
@@ -41,7 +41,7 @@ then
 	else
 		err='Perl SVN libraries not found or unusable, skipping test'
 	fi
-	test_expect_success "$err" :
+	say "$err"
 	test_done
 	exit
 fi
diff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh
index e533039..ae90d34 100755
--- a/t/t0024-crlf-archive.sh
+++ b/t/t0024-crlf-archive.sh
@@ -28,7 +28,7 @@ test_expect_success 'tar archive' '
 
 "$UNZIP" -v >/dev/null 2>&1
 if [ $? -eq 127 ]; then
-	echo "Skipping ZIP test, because unzip was not found"
+	say "Skipping ZIP test, because unzip was not found"
 	test_done
 	exit
 fi
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 95542e9..74ea8e0 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -112,7 +112,7 @@ test_expect_success \
     'test_must_fail git rm -f baz'
 chmod 775 .
 else
-    test_expect_success 'skipping removal failure (perhaps running as root?)' :
+    say 'skipping removal failure test (perhaps running as root?)'
 fi
 
 test_expect_success \
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index e1ed073..7a84ab6 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -182,7 +182,7 @@ test_expect_success 'git archive --format=zip with --output' \
 
 $UNZIP -v >/dev/null 2>&1
 if [ $? -eq 127 ]; then
-	echo "Skipping ZIP tests, because unzip was not found"
+	say "Skipping ZIP tests, because unzip was not found"
 	test_done
 	exit
 fi
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 69501e2..06e6e17 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -582,7 +582,7 @@ test_expect_success \
 # subsequent tests require gpg; check if it is available
 gpg --version >/dev/null
 if [ $? -eq 127 ]; then
-	echo "gpg not found - skipping tag signing and verification tests"
+	say "gpg not found - skipping tag signing and verification tests"
 	test_done
 	exit
 fi
@@ -614,7 +614,7 @@ test_expect_success \
 # that version, creation of signed tags using the generated key fails.
 case "$(gpg --version)" in
 'gpg (GnuPG) 1.0.6'*)
-	echo "Skipping signed tag tests, because a bug in 1.0.6 version"
+	say "Skipping signed tag tests, because a bug in 1.0.6 version"
 	test_done
 	exit
 	;;
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 245a7c3..d28b71b 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -9,7 +9,7 @@ test_description='Test export of commits to CVS'
 cvs >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git cvsexportcommit tests, cvs not found' :
+    say 'skipping git cvsexportcommit tests, cvs not found'
     test_done
     exit
 fi
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 9ccb123..466240c 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -13,12 +13,12 @@ cvs CLI client via git-cvsserver server'
 cvs >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git-cvsserver tests, cvs not found' :
+    say 'skipping git-cvsserver tests, cvs not found'
     test_done
     exit
 fi
 perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
-    test_expect_success 'skipping git-cvsserver tests, Perl SQLite interface unavailable' :
+    say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
     test_done
     exit
 }
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index 5d6200c..8882230 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -49,12 +49,12 @@ not_present() {
 cvs >/dev/null 2>&1
 if test $? -ne 1
 then
-    test_expect_success 'skipping git-cvsserver tests, cvs not found' :
+    say 'skipping git-cvsserver tests, cvs not found'
     test_done
     exit
 fi
 perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
-    test_expect_success 'skipping git-cvsserver tests, Perl SQLite interface unavailable' :
+    say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
     test_done
     exit
 }
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 6ed10d0..1b78e28 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -74,7 +74,7 @@ safe_chmod () {
 . ./test-lib.sh
 
 perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
-    test_expect_success 'skipping gitweb tests, perl version is too old' :
+    say 'skipping gitweb tests, perl version is too old'
     test_done
     exit
 }
diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index b81d5df..4a501c6 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -7,7 +7,7 @@ test_description='perl interface (Git.pm)'
 . ./test-lib.sh
 
 perl -MTest::More -e 0 2>/dev/null || {
-	say_color skip "Perl Test::More unavailable, skipping test"
+	say "Perl Test::More unavailable, skipping test"
 	test_done
 }
 
-- 
1.6.2.1.224.g2225f
Previous: Johannes SixtNext: Johannes Schindelin
Message 3 of 27 in “Test on Windows - prequel”
  1. 00/11 Test on Windows - prequelJohannes Sixt, Mar 18, 2009
  2. 01/10 t9400, t9401: Do not force hard-linked cloneJohannes Sixt, Mar 18, 2009
  3. 02/10 test suite: Use 'say' to say something instead of 'test_expect_success'Johannes Sixt, Mar 18, 2009
  4. Johannes SchindelinMar 18, 2009
  5. Johannes SixtMar 19, 2009
  6. Johannes SchindelinMar 19, 2009
  7. Junio C HamanoMar 19, 2009
  8. 03/10 Call 'say' outside test_expect_successJohannes Sixt, Mar 18, 2009
  9. 04/10 test-lib: Replace uses of $(expr ...) by POSIX shell features.Johannes Sixt, Mar 18, 2009
  10. Johannes SchindelinMar 18, 2009
  11. Johannes SixtMar 19, 2009
  12. Johannes SchindelinMar 19, 2009
  13. 05/10 test-lib: Simplify test counting.Johannes Sixt, Mar 18, 2009
  14. Johannes SchindelinMar 18, 2009
  15. Johannes SixtMar 19, 2009
  16. 06/10 test-lib: Introduce test_chmod and use it instead of update-index --chmodJohannes Sixt, Mar 18, 2009
  17. 07/10 t7300: fix clean up on WindowsJohannes Sixt, Mar 18, 2009
  18. 08/10 t2200, t7004: Avoid glob pattern that also matches filesJohannes Sixt, Mar 18, 2009
  19. Junio C HamanoMar 19, 2009
  20. Johannes SixtMar 19, 2009
  21. Junio C HamanoMar 19, 2009
  22. 09/10 t5300, t5302, t5303: Do not use /dev/zeroJohannes Sixt, Mar 18, 2009
  23. 10/10 t5602: Work around path mangling on MSYSJohannes Sixt, Mar 18, 2009
  24. Junio C HamanoMar 18, 2009
  25. Johannes SixtMar 19, 2009
  26. Johannes SixtMar 19, 2009
  27. Junio C HamanoMar 19, 2009

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.