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

Re: Tests in Cygwin

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 7, 2009, 07:13 UTC
Message-ID
<4A028A0A.5070003@viscovery.net>
In-Reply-To
<7vvdoet13g.fsf@alter.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 6 quoted lines
> Don Slutz <Don.Slutz@SierraAtlantic.com> writes:
> 
>> A lot of these failures are do to running as root (member of
>> Administrators)....
> 
> Perhaps we can do this to reduce the noise level.

Thank you for this patch. Unfortunately, it does not work as intended because the call to test_have_prereq in test_skip does not split the prereq tokens so that tests with space-separated prerequisite tokens are always skipped.

My first attempt to solve that is to remove the quotes from the test_have_prereq call in test_skip; but I think that this simple solution is rather unintuitive, and will look like a bug if you inspect the code again in two months.

You could squash in the patch below, where I chose to concatenate tokens with '+' because I dislike the extra quoting that is otherwise necessary at the call site. The downside is that it plays games with IFS, which you might find too ugly and not worth it. It's your call.

BTW, I didn't dare test this as root on my production system; I'll do that later today elsewhere.

diff --git a/t/README b/t/README
index a532c32..49c3a51 100644
--- a/t/README
+++ b/t/README
@@ -200,7 +200,7 @@ library for your script to use.
    <script>.  If it yields success, test is considered
    successful.  <message> should state what it is testing.

-   An optional parameter <prereq> is a space separated list of prerequisite
+   An optional parameter <prereq> is a '+' separated list of prerequisite
    tokens.  The test will be skipped if the test environment lacks any of
    the prerequiste feature listed (see below for commonly used
    prerequisites).
@@ -260,7 +260,8 @@ Prerequisites
 -------------

  POSIXPERM	The filesystem supports POSIX style permission bits
- BSLASHPSPEC	???
+ BSLASHPSPEC	Backslashes in pathspec are not directory separators
+                (i.e. they are not converted to forward-slash)
  EXECKEEPSPID	The process retains the same pid across exec(2)

  SANITY		Test is not run by root user, and an attempt to an
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index eb60f80..8683189 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -177,7 +177,7 @@ test_expect_success SYMLINKS 'funny symlink in work tree' '

 '

-test_expect_success 'SYMLINKS SANITY' 'funny symlink in work tree, un-unlink-able' '
+test_expect_success SYMLINKS+SANITY 'funny symlink in work tree, un-unlink-able' '

 	rm -fr a b &&
 	git reset --hard &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1922e0b..2d12799 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,12 @@ test_set_prereq () {
 }
 satisfied=" "

+# prerequisites can be concatenated with '+'
 test_have_prereq () {
+	save_IFS=$IFS
+	IFS=+
+	set -- $*
+	IFS=$save_IFS
 	for prerequisite
 	do
 		case $satisfied in
Previous: Junio C HamanoNext: Don Slutz
Message 4 of 16 in “Tests in Cygwin”
  1. Hannu KoivistoApr 17, 2009
  2. Don SlutzMay 6, 2009
  3. Junio C HamanoMay 6, 2009
  4. Johannes SixtMay 7, 2009
  5. Don SlutzMay 7, 2009
  6. Don SlutzMay 7, 2009
  7. Junio C HamanoMay 8, 2009
  8. Johannes SixtMay 8, 2009
  9. Jeff KingMay 8, 2009
  10. Johannes SixtMay 8, 2009
  11. Junio C HamanoMay 8, 2009
  12. Alex RiesenMay 8, 2009
  13. Don SlutzMay 8, 2009
  14. Johannes SixtMay 8, 2009
  15. Alex RiesenMay 8, 2009
  16. Junio C HamanoMay 8, 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.