{"thread":{"id":"18913","subject":"Tests in Cygwin","startedAt":"2009-04-17T09:47:02Z","lastAt":"2009-05-08T16:45:43Z","messageCount":16,"participants":["Hannu Koivisto","Don Slutz","Junio C Hamano","Johannes Sixt","Jeff King","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"111477","messageId":"83prfbhasp.fsf@kalahari.s2.org","threadId":"18913","inReplyTo":null,"subject":"Tests in Cygwin","fromName":"Hannu Koivisto","fromEmail":"azure@iki.fi","sentAt":"2009-04-17T09:47:02Z","receivedAt":"2009-04-17T09:47:02Z","isPatch":false,"sender":{"key":"azure@iki.fi","avatar":null},"body":"Greetings,\n\nI upgraded to the latest git.git as of yesterday\n(f800b65bea1504299747e7be03ee279508a74e1f) in Cygwin to see if it\nstill has the rebase and bogus modified files problem(s) (reported\nearlier http://osdir.com/ml/git/2009-04/msg00619.html).  It does;\nI'll try to bisect it if I manage to make the test case automatic.\n\nI also thought I'd run all the tests just for the heck of it.  The\nresult is about 240 failures which are available here (lines\nindicating passed tests removed):\n\nhttp://www.iki.fi/azure/tmp/git-test-results-cygwin-f800b65bea1504299747e7be03ee279508a74e1f.txt\n\nI wonder, since there seems to be some sort of mechanism to mark\nfailures \"known\" (at least I got a couple of \"still broken ...\"\nlines), are all these unexpected, new problems, or is there perhaps\nsome separate list of known failures on Cygwin?\n\n-- \nHannu\n"},{"id":"113116","messageId":"4A01E64C.7050703@SierraAtlantic.com","threadId":"18913","inReplyTo":"83prfbhasp.fsf@kalahari.s2.org","subject":"Re: Tests in Cygwin","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-06T19:34:36Z","receivedAt":"2009-05-06T19:34:36Z","isPatch":false,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"A lot of these failures are do to running as root (member of \nAdministrators).  Using v1.6.3-rc4 (503f464...) I get:\n\nmake -i test\n...\nmake aggregate-results\nmake[3]: Entering directory `/home/udslutz/BinMode/git/t'\n'/bin/sh' ./aggregate-results.sh test-results/t*-*\nfixed   3\nsuccess 4211\nfailed  5\nbroken  5\ntotal   4272\nmake[3]: Leaving directory `/home/udslutz/BinMode/git/t'\n...\n\n  -Don Slutz\n\n\n\n-------- Original Message --------\nSubject: Tests in Cygwin\nFrom: Hannu Koivisto <azure@iki.fi>\nTo: git@vger.kernel.org\nDate: 4/17/2009 5:47 AM\n> Greetings,\n>\n> I upgraded to the latest git.git as of yesterday\n> (f800b65bea1504299747e7be03ee279508a74e1f) in Cygwin to see if it\n> still has the rebase and bogus modified files problem(s) (reported\n> earlier http://osdir.com/ml/git/2009-04/msg00619.html).  It does;\n> I'll try to bisect it if I manage to make the test case automatic.\n>\n> I also thought I'd run all the tests just for the heck of it.  The\n> result is about 240 failures which are available here (lines\n> indicating passed tests removed):\n>\n> http://www.iki.fi/azure/tmp/git-test-results-cygwin-f800b65bea1504299747e7be03ee279508a74e1f.txt\n>\n> I wonder, since there seems to be some sort of mechanism to mark\n> failures \"known\" (at least I got a couple of \"still broken ...\"\n> lines), are all these unexpected, new problems, or is there perhaps\n> some separate list of known failures on Cygwin?\n>\n>   \n\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"},{"id":"113126","messageId":"7vvdoet13g.fsf@alter.siamese.dyndns.org","threadId":"18913","inReplyTo":"4A01E64C.7050703@SierraAtlantic.com","subject":"Re: Tests in Cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-06T20:42:27Z","receivedAt":"2009-05-06T20:42:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Don Slutz <Don.Slutz@SierraAtlantic.com> writes:\n\n> A lot of these failures are do to running as root (member of\n> Administrators)....\n\nPerhaps we can do this to reduce the noise level.\n\n---\n t/README                    |   26 +++++++++++++++++++++++---\n t/t1004-read-tree-m-u-wf.sh |    2 +-\n t/t7300-clean.sh            |    2 +-\n t/test-lib.sh               |   22 +++++++++++++++-------\n 4 files changed, 40 insertions(+), 12 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex d8f6c7d..a532c32 100644\n--- a/t/README\n+++ b/t/README\n@@ -194,19 +194,28 @@ Test harness library\n There are a handful helper functions defined in the test harness\n library for your script to use.\n \n- - test_expect_success <message> <script>\n+ - test_expect_success [<prereq>] <message> <script>\n \n-   This takes two strings as parameter, and evaluates the\n+   This takes two or three strings as parameters, and evaluates the\n    <script>.  If it yields success, test is considered\n    successful.  <message> should state what it is testing.\n \n+   An optional parameter <prereq> is a space separated list of prerequisite\n+   tokens.  The test will be skipped if the test environment lacks any of\n+   the prerequiste feature listed (see below for commonly used\n+   prerequisites).\n+\n    Example:\n \n \ttest_expect_success \\\n \t    'git-write-tree should be able to write an empty tree.' \\\n \t    'tree=$(git-write-tree)'\n \n- - test_expect_failure <message> <script>\n+\ttest_expect_success SANITY '/ should not be writable' '\n+\t\t! test -w /\n+\t'\n+\n+ - test_expect_failure [<prereq>] <message> <script>\n \n    This is NOT the opposite of test_expect_success, but is used\n    to mark a test that demonstrates a known breakage.  Unlike\n@@ -247,6 +256,17 @@ library for your script to use.\n    Merges the given rev using the given message.  Like test_commit,\n    creates a tag and calls test_tick before committing.\n \n+Prerequisites\n+-------------\n+\n+ POSIXPERM\tThe filesystem supports POSIX style permission bits\n+ BSLASHPSPEC\t???\n+ EXECKEEPSPID\tThe process retains the same pid across exec(2)\n+\n+ SANITY\t\tTest is not run by root user, and an attempt to an\n+                unwritable file is expected to fail correctly.\n+\n+\n Tips for Writing Tests\n ----------------------\n \ndiff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\nindex f19b4a2..eb60f80 100755\n--- a/t/t1004-read-tree-m-u-wf.sh\n+++ b/t/t1004-read-tree-m-u-wf.sh\n@@ -177,7 +177,7 @@ test_expect_success SYMLINKS 'funny symlink in work tree' '\n \n '\n \n-test_expect_success SYMLINKS 'funny symlink in work tree, un-unlink-able' '\n+test_expect_success 'SYMLINKS SANITY' 'funny symlink in work tree, un-unlink-able' '\n \n \trm -fr a b &&\n \tgit reset --hard &&\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 929d5d4..7a5f680 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -369,7 +369,7 @@ test_expect_success 'core.excludesfile' '\n \n '\n \n-test_expect_success 'removal failure' '\n+test_expect_success SANITY 'removal failure' '\n \n \tmkdir foo &&\n \ttouch foo/bar &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex dad1437..1922e0b 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -264,12 +264,16 @@ test_set_prereq () {\n satisfied=\" \"\n \n test_have_prereq () {\n-\tcase $satisfied in\n-\t*\" $1 \"*)\n-\t\t: yes, have it ;;\n-\t*)\n-\t\t! : nope ;;\n-\tesac\n+\tfor prerequisite\n+\tdo\n+\t\tcase $satisfied in\n+\t\t*\" $prerequisite \"*)\n+\t\t\t: yes, have it ;;\n+\t\t*)\n+\t\t\treturn 1 ;;\n+\t\tesac\n+\tdone\n+\t:\n }\n \n # You are not expected to call test_ok_ and test_failure_ directly, use\n@@ -670,6 +674,10 @@ do\n \tesac\n done\n \n+# When tests are run as root (which is silly), permission\n+# tests will report things are writable when they should not be.\n+test -w / || test_set_prereq SANITY\n+\n # Fix some commands on Windows\n case $(uname -s) in\n *MINGW*)\n@@ -692,7 +700,7 @@ case $(uname -s) in\n \t# exec does not inherit the PID\n \t;;\n *)\n-\ttest_set_prereq POSIXPERM\n+\ttest_have_prereq SANITY && test_set_prereq POSIXPERM\n \ttest_set_prereq BSLASHPSPEC\n \ttest_set_prereq EXECKEEPSPID\n \t;;\n"},{"id":"113175","messageId":"4A028A0A.5070003@viscovery.net","threadId":"18913","inReplyTo":"7vvdoet13g.fsf@alter.siamese.dyndns.org","subject":"Re: Tests in Cygwin","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-07T07:13:14Z","receivedAt":"2009-05-07T07:13:14Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> Don Slutz <Don.Slutz@SierraAtlantic.com> writes:\n> \n>> A lot of these failures are do to running as root (member of\n>> Administrators)....\n> \n> Perhaps we can do this to reduce the noise level.\n\nThank you for this patch. Unfortunately, it does not work as intended\nbecause the call to test_have_prereq in test_skip does not split\nthe prereq tokens so that tests with space-separated prerequisite tokens\nare always skipped.\n\nMy first attempt to solve that is to remove the quotes from the\ntest_have_prereq call in test_skip; but I think that this simple\nsolution is rather unintuitive, and will look like a bug if you inspect\nthe code again in two months.\n\nYou could squash in the patch below, where I chose to concatenate\ntokens with '+' because I dislike the extra quoting that is otherwise\nnecessary at the call site. The downside is that it plays games with\nIFS, which you might find too ugly and not worth it. It's your call.\n\nBTW, I didn't dare test this as root on my production system; I'll do\nthat later today elsewhere.\n\n\ndiff --git a/t/README b/t/README\nindex a532c32..49c3a51 100644\n--- a/t/README\n+++ b/t/README\n@@ -200,7 +200,7 @@ library for your script to use.\n    <script>.  If it yields success, test is considered\n    successful.  <message> should state what it is testing.\n\n-   An optional parameter <prereq> is a space separated list of prerequisite\n+   An optional parameter <prereq> is a '+' separated list of prerequisite\n    tokens.  The test will be skipped if the test environment lacks any of\n    the prerequiste feature listed (see below for commonly used\n    prerequisites).\n@@ -260,7 +260,8 @@ Prerequisites\n -------------\n\n  POSIXPERM\tThe filesystem supports POSIX style permission bits\n- BSLASHPSPEC\t???\n+ BSLASHPSPEC\tBackslashes in pathspec are not directory separators\n+                (i.e. they are not converted to forward-slash)\n  EXECKEEPSPID\tThe process retains the same pid across exec(2)\n\n  SANITY\t\tTest is not run by root user, and an attempt to an\ndiff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\nindex eb60f80..8683189 100755\n--- a/t/t1004-read-tree-m-u-wf.sh\n+++ b/t/t1004-read-tree-m-u-wf.sh\n@@ -177,7 +177,7 @@ test_expect_success SYMLINKS 'funny symlink in work tree' '\n\n '\n\n-test_expect_success 'SYMLINKS SANITY' 'funny symlink in work tree, un-unlink-able' '\n+test_expect_success SYMLINKS+SANITY 'funny symlink in work tree, un-unlink-able' '\n\n \trm -fr a b &&\n \tgit reset --hard &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 1922e0b..2d12799 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -263,7 +263,12 @@ test_set_prereq () {\n }\n satisfied=\" \"\n\n+# prerequisites can be concatenated with '+'\n test_have_prereq () {\n+\tsave_IFS=$IFS\n+\tIFS=+\n+\tset -- $*\n+\tIFS=$save_IFS\n \tfor prerequisite\n \tdo\n \t\tcase $satisfied in\n"},{"id":"113228","messageId":"4A030277.2000708@SierraAtlantic.com","threadId":"18913","inReplyTo":"4A028A0A.5070003@viscovery.net","subject":"Re: Tests in Cygwin","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-07T15:47:03Z","receivedAt":"2009-05-07T15:47:03Z","isPatch":false,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Here is a change back to using spaces.  It also includes a change\nto test for the code working.  Squash on top.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/README                    |    4 ++--\n t/t0000-basic.sh            |   13 ++++++++++++-\n t/t1004-read-tree-m-u-wf.sh |    2 +-\n t/test-lib.sh               |    7 +------\n 4 files changed, 16 insertions(+), 10 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 49c3a51..c61e1d4 100644\n--- a/t/README\n+++ b/t/README\n@@ -200,9 +200,9 @@ library for your script to use.\n    <script>.  If it yields success, test is considered\n    successful.  <message> should state what it is testing.\n \n-   An optional parameter <prereq> is a '+' separated list of prerequisite\n+   An optional parameter <prereq> is a space separated list of prerequisite\n    tokens.  The test will be skipped if the test environment lacks any of\n-   the prerequiste feature listed (see below for commonly used\n+   the prerequisite feature listed (see below for commonly used\n    prerequisites).\n \n    Example:\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex f4ca4fc..58bac69 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -67,7 +67,18 @@ donthaveit=yes\n test_expect_success DONTHAVEIT 'unmet prerequisite causes test to be \nskipped' '\n     donthaveit=no\n '\n-if test $haveit$donthaveit != yesyes\n+test_set_prereq HAVEBOTH\n+haveboth1=no\n+test_expect_success 'HAVEBOTH HAVEIT' 'test runs if both prerequisites \nare satisfied' '\n+    test_have_prereq \"HAVEIT HAVEBOTH\" &&\n+    haveboth1=yes\n+'\n+haveboth2=no\n+test_expect_success 'HAVEIT HAVEBOTH' 'test passes if both \nprerequisites are satisfied' '\n+    test_have_prereq \"HAVEBOTH HAVEIT\" &&\n+    haveboth2=yes\n+'\n+if test $haveit$donthaveit$haveboth1$haveboth2 != yesyesyesyes\n then\n        say \"bug in test framework: prerequisite tags do not work reliably\"\n        exit 1\ndiff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\nindex 8683189..eb60f80 100755\n--- a/t/t1004-read-tree-m-u-wf.sh\n+++ b/t/t1004-read-tree-m-u-wf.sh\n@@ -177,7 +177,7 @@ test_expect_success SYMLINKS 'funny symlink in work \ntree' '\n \n '\n \n-test_expect_success SYMLINKS+SANITY 'funny symlink in work tree, \nun-unlink-able' '\n+test_expect_success 'SYMLINKS SANITY' 'funny symlink in work tree, \nun-unlink-able' '\n \n        rm -fr a b &&\n        git reset --hard &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 2d12799..dd3b8d7 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -263,13 +263,8 @@ test_set_prereq () {\n }\n satisfied=\" \"\n \n-# prerequisites can be concatenated with '+'\n test_have_prereq () {\n-       save_IFS=$IFS\n-       IFS=+\n-       set -- $*\n-       IFS=$save_IFS\n-       for prerequisite\n+       for prerequisite in $(echo $*)\n        do\n                case $satisfied in\n                *\" $prerequisite \"*)\n-- \n1.5.4.2\n\n\n-------- Original Message --------\nSubject: Re: Tests in Cygwin\nFrom: Johannes Sixt <j.sixt@viscovery.net>\nTo: Junio C Hamano <gitster@pobox.com>\nCC: Don Slutz <Don.Slutz@SierraAtlantic.com>, Hannu Koivisto \n<azure@iki.fi>, git@vger.kernel.org\nDate: 5/7/2009 3:13 AM\n> Junio C Hamano schrieb:\n>   \n>> Don Slutz <Don.Slutz@SierraAtlantic.com> writes:\n>>\n>>     \n>>> A lot of these failures are do to running as root (member of\n>>> Administrators)....\n>>>       \n>> Perhaps we can do this to reduce the noise level.\n>>     \n>\n> Thank you for this patch. Unfortunately, it does not work as intended\n> because the call to test_have_prereq in test_skip does not split\n> the prereq tokens so that tests with space-separated prerequisite tokens\n> are always skipped.\n>\n> My first attempt to solve that is to remove the quotes from the\n> test_have_prereq call in test_skip; but I think that this simple\n> solution is rather unintuitive, and will look like a bug if you inspect\n> the code again in two months.\n>\n> You could squash in the patch below, where I chose to concatenate\n> tokens with '+' because I dislike the extra quoting that is otherwise\n> necessary at the call site. The downside is that it plays games with\n> IFS, which you might find too ugly and not worth it. It's your call.\n>\n> BTW, I didn't dare test this as root on my production system; I'll do\n> that later today elsewhere.\n>\n>\n> diff --git a/t/README b/t/README\n> index a532c32..49c3a51 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -200,7 +200,7 @@ library for your script to use.\n>     <script>.  If it yields success, test is considered\n>     successful.  <message> should state what it is testing.\n>\n> -   An optional parameter <prereq> is a space separated list of prerequisite\n> +   An optional parameter <prereq> is a '+' separated list of prerequisite\n>     tokens.  The test will be skipped if the test environment lacks any of\n>     the prerequiste feature listed (see below for commonly used\n>     prerequisites).\n> @@ -260,7 +260,8 @@ Prerequisites\n>  -------------\n>\n>   POSIXPERM\tThe filesystem supports POSIX style permission bits\n> - BSLASHPSPEC\t???\n> + BSLASHPSPEC\tBackslashes in pathspec are not directory separators\n> +                (i.e. they are not converted to forward-slash)\n>   EXECKEEPSPID\tThe process retains the same pid across exec(2)\n>\n>   SANITY\t\tTest is not run by root user, and an attempt to an\n> diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\n> index eb60f80..8683189 100755\n> --- a/t/t1004-read-tree-m-u-wf.sh\n> +++ b/t/t1004-read-tree-m-u-wf.sh\n> @@ -177,7 +177,7 @@ test_expect_success SYMLINKS 'funny symlink in work tree' '\n>\n>  '\n>\n> -test_expect_success 'SYMLINKS SANITY' 'funny symlink in work tree, un-unlink-able' '\n> +test_expect_success SYMLINKS+SANITY 'funny symlink in work tree, un-unlink-able' '\n>\n>  \trm -fr a b &&\n>  \tgit reset --hard &&\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 1922e0b..2d12799 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -263,7 +263,12 @@ test_set_prereq () {\n>  }\n>  satisfied=\" \"\n>\n> +# prerequisites can be concatenated with '+'\n>  test_have_prereq () {\n> +\tsave_IFS=$IFS\n> +\tIFS=+\n> +\tset -- $*\n> +\tIFS=$save_IFS\n>  \tfor prerequisite\n>  \tdo\n>  \t\tcase $satisfied in\n>\n>   \n\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"},{"id":"113243","messageId":"4A03288E.7010405@SierraAtlantic.com","threadId":"18913","inReplyTo":"4A030277.2000708@SierraAtlantic.com","subject":"Re: Tests in Cygwin","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-07T18:29:34Z","receivedAt":"2009-05-07T18:29:34Z","isPatch":false,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Before these patches, I get:\n\nmake aggregate-results\nmake[3]: Entering directory `/home/adslutz/BinMode/git/t'\n'/bin/sh' ./aggregate-results.sh test-results/t*-*\nfixed   3\nsuccess 4201\nfailed  15\nbroken  5\ntotal   4272\nmake[3]: Leaving directory `/home/adslutz/BinMode/git/t'\n\nAfter:\n\nmake aggregate-results\nmake[2]: Entering directory `/home/adslutz/BinMode/git/t'\n'/bin/sh' ./aggregate-results.sh test-results/t*-*\nfixed   3\nsuccess 4181\nfailed  6\nbroken  5\ntotal   4274\nmake[2]: Leaving directory `/home/adslutz/BinMode/git/t'\n\n   -Don\n\n-------- Original Message --------\nSubject: Re: Tests in Cygwin\nFrom: Don Slutz <Don.Slutz@sierraatlantic.com>\nTo: Johannes Sixt <j.sixt@viscovery.net>\nCC: Junio C Hamano <gitster@pobox.com>, Hannu Koivisto <azure@iki.fi>, \ngit@vger.kernel.org\nDate: 5/7/2009 11:47 AM\n> Here is a change back to using spaces.  It also includes a change\n> to test for the code working.  Squash on top.\n>\n> Signed-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n> ---\n> t/README                    |    4 ++--\n> t/t0000-basic.sh            |   13 ++++++++++++-\n> t/t1004-read-tree-m-u-wf.sh |    2 +-\n> t/test-lib.sh               |    7 +------\n> 4 files changed, 16 insertions(+), 10 deletions(-)\n>\n> diff --git a/t/README b/t/README\n> index 49c3a51..c61e1d4 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -200,9 +200,9 @@ library for your script to use.\n>    <script>.  If it yields success, test is considered\n>    successful.  <message> should state what it is testing.\n>\n> -   An optional parameter <prereq> is a '+' separated list of \n> prerequisite\n> +   An optional parameter <prereq> is a space separated list of \n> prerequisite\n>    tokens.  The test will be skipped if the test environment lacks any of\n> -   the prerequiste feature listed (see below for commonly used\n> +   the prerequisite feature listed (see below for commonly used\n>    prerequisites).\n>\n>    Example:\n> diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n> index f4ca4fc..58bac69 100755\n> --- a/t/t0000-basic.sh\n> +++ b/t/t0000-basic.sh\n> @@ -67,7 +67,18 @@ donthaveit=yes\n> test_expect_success DONTHAVEIT 'unmet prerequisite causes test to be \n> skipped' '\n>     donthaveit=no\n> '\n> -if test $haveit$donthaveit != yesyes\n> +test_set_prereq HAVEBOTH\n> +haveboth1=no\n> +test_expect_success 'HAVEBOTH HAVEIT' 'test runs if both \n> prerequisites are satisfied' '\n> +    test_have_prereq \"HAVEIT HAVEBOTH\" &&\n> +    haveboth1=yes\n> +'\n> +haveboth2=no\n> +test_expect_success 'HAVEIT HAVEBOTH' 'test passes if both \n> prerequisites are satisfied' '\n> +    test_have_prereq \"HAVEBOTH HAVEIT\" &&\n> +    haveboth2=yes\n> +'\n> +if test $haveit$donthaveit$haveboth1$haveboth2 != yesyesyesyes\n> then\n>        say \"bug in test framework: prerequisite tags do not work \n> reliably\"\n>        exit 1\n> diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\n> index 8683189..eb60f80 100755\n> --- a/t/t1004-read-tree-m-u-wf.sh\n> +++ b/t/t1004-read-tree-m-u-wf.sh\n> @@ -177,7 +177,7 @@ test_expect_success SYMLINKS 'funny symlink in \n> work tree' '\n>\n> '\n>\n> -test_expect_success SYMLINKS+SANITY 'funny symlink in work tree, \n> un-unlink-able' '\n> +test_expect_success 'SYMLINKS SANITY' 'funny symlink in work tree, \n> un-unlink-able' '\n>\n>        rm -fr a b &&\n>        git reset --hard &&\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 2d12799..dd3b8d7 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -263,13 +263,8 @@ test_set_prereq () {\n> }\n> satisfied=\" \"\n>\n> -# prerequisites can be concatenated with '+'\n> test_have_prereq () {\n> -       save_IFS=$IFS\n> -       IFS=+\n> -       set -- $*\n> -       IFS=$save_IFS\n> -       for prerequisite\n> +       for prerequisite in $(echo $*)\n>        do\n>                case $satisfied in\n>                *\" $prerequisite \"*)\n\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"},{"id":"113285","messageId":"7vmy9ocvlg.fsf@alter.siamese.dyndns.org","threadId":"18913","inReplyTo":"4A028A0A.5070003@viscovery.net","subject":"Re: Tests in Cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-08T00:00:11Z","receivedAt":"2009-05-08T00:00:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> You could squash in the patch below, where I chose to concatenate\n> tokens with '+' because I dislike the extra quoting that is otherwise\n> necessary at the call site. The downside is that it plays games with\n> IFS, which you might find too ugly and not worth it. It's your call.\n>\n> BTW, I didn't dare test this as root on my production system; I'll do\n> that later today elsewhere.\n\nHeh, thanks.\n\nI think my \"how about this\" weather-balloon patch with your updates should\nbe split into a three-patch series:\n\n (1) t/README update to cover the Prerequisite system; we should have done\n     this when we applied the feature;\n\n (2) Addition of multiple-prerequisite feature (and documentation updates\n     to t/README);\n\n (3) Addition of SANITY prerequisite that uses (2).\n\nI personally do not think \"SANITY\" is such a good thing to look for (I'd\nrather make the test fail saying \"do not run me as root\"), but that is a\nseparate issue.\n"},{"id":"113286","messageId":"7viqkccvhb.fsf@alter.siamese.dyndns.org","threadId":"18913","inReplyTo":"4A030277.2000708@SierraAtlantic.com","subject":"Re: Tests in Cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-08T00:02:40Z","receivedAt":"2009-05-08T00:02:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Don Slutz <Don.Slutz@SierraAtlantic.com> writes:\n\n> test_have_prereq () {\n> -       save_IFS=$IFS\n> -       IFS=+\n> -       set -- $*\n> -       IFS=$save_IFS\n> -       for prerequisite\n> +       for prerequisite in $(echo $*)\n\nAh, that's clever.\n"},{"id":"113298","messageId":"20090508020037.GA1264@coredump.intra.peff.net","threadId":"18913","inReplyTo":"4A030277.2000708@SierraAtlantic.com","subject":"Re: Tests in Cygwin","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-08T02:00:37Z","receivedAt":"2009-05-08T02:00:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 07, 2009 at 11:47:03AM -0400, Don Slutz wrote:\n\n> Here is a change back to using spaces.  It also includes a change\n> to test for the code working.  Squash on top.\n\nMaybe it is just me, but I think\n\n  test_expect_success SYMLINKS,SANITY 'some description' '\n    the actual test\n  '\n\nis more readable than the space (since it keeps the number of single\nquoted chunks on the line down). Which should be as simple as:\n\n> -# prerequisites can be concatenated with '+'\n> test_have_prereq () {\n> -       save_IFS=$IFS\n> -       IFS=+\n> -       set -- $*\n> -       IFS=$save_IFS\n> -       for prerequisite\n> +       for prerequisite in $(echo $*)\n>        do\n>                case $satisfied in\n>                *\" $prerequisite \"*)\n\n  +for prerequisite in $(echo \"$1\" | tr , ' ')\n\nJust my bikeshedding two cents,\n\n-Peff\n"},{"id":"113307","messageId":"4A03CAFE.4060503@viscovery.net","threadId":"18913","inReplyTo":"20090508020037.GA1264@coredump.intra.peff.net","subject":"Re: Tests in Cygwin","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-08T06:02:38Z","receivedAt":"2009-05-08T06:02:38Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Jeff King schrieb:\n> On Thu, May 07, 2009 at 11:47:03AM -0400, Don Slutz wrote:\n> \n>> Here is a change back to using spaces.  It also includes a change\n>> to test for the code working.  Squash on top.\n> \n> Maybe it is just me, but I think\n> \n>   test_expect_success SYMLINKS,SANITY 'some description' '\n>     the actual test\n>   '\n> \n> is more readable than the space (since it keeps the number of single\n> quoted chunks on the line down). Which should be as simple as:\n> \n>> -# prerequisites can be concatenated with '+'\n>> test_have_prereq () {\n>> -       save_IFS=$IFS\n>> -       IFS=+\n>> -       set -- $*\n>> -       IFS=$save_IFS\n>> -       for prerequisite\n>> +       for prerequisite in $(echo $*)\n>>        do\n>>                case $satisfied in\n>>                *\" $prerequisite \"*)\n> \n>   +for prerequisite in $(echo \"$1\" | tr , ' ')\n\nSo, you dislike the space separator, but you also dislike the IFS games\nthat save a few new processes? ;) (Think of Windows, where fork is expensive).\n\n-- Hannes\n"},{"id":"113308","messageId":"4A03CB3A.4090108@viscovery.net","threadId":"18913","inReplyTo":"7viqkccvhb.fsf@alter.siamese.dyndns.org","subject":"Re: Tests in Cygwin","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-08T06:03:38Z","receivedAt":"2009-05-08T06:03:38Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> Don Slutz <Don.Slutz@SierraAtlantic.com> writes:\n> \n>> test_have_prereq () {\n>> -       save_IFS=$IFS\n>> -       IFS=+\n>> -       set -- $*\n>> -       IFS=$save_IFS\n>> -       for prerequisite\n>> +       for prerequisite in $(echo $*)\n> \n> Ah, that's clever.\n\nWell, it is an extra fork() that could easily be avoided by modifying the\ncall site in test_skip.\n\n-- Hannes\n"},{"id":"113309","messageId":"7v4ovwaygf.fsf@alter.siamese.dyndns.org","threadId":"18913","inReplyTo":"4A03CAFE.4060503@viscovery.net","subject":"Re: Tests in Cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-08T06:41:20Z","receivedAt":"2009-05-08T06:41:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n>>   +for prerequisite in $(echo \"$1\" | tr , ' ')\n>\n> So, you dislike the space separator, but you also dislike the IFS games\n> that save a few new processes? ;) (Think of Windows, where fork is expensive).\n\nYou can play IFS=, game, then ;-)\n\nI have to admit that it feels so 80'ish, back when our UNIX machines were\nso slow that we tried to shave every fork+exec from our shell scripts by\nusing built-ins when possible, though.\n"},{"id":"113336","messageId":"81b0412b0905080228j6b114631p35395464c0c98540@mail.gmail.com","threadId":"18913","inReplyTo":"7v4ovwaygf.fsf@alter.siamese.dyndns.org","subject":"Re: Tests in Cygwin","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-05-08T09:28:37Z","receivedAt":"2009-05-08T09:28:37Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"2009/5/8 Junio C Hamano <gitster@pobox.com>:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n>\n>>>   +for prerequisite in $(echo \"$1\" | tr , ' ')\n>>\n>> So, you dislike the space separator, but you also dislike the IFS games\n>> that save a few new processes? ;) (Think of Windows, where fork is expensive).\n>\n> You can play IFS=, game, then ;-)\n>\n> I have to admit that it feels so 80'ish, back when our UNIX machines were\n> so slow that we tried to shave every fork+exec from our shell scripts by\n> using built-ins when possible, though.\n\nWell, on Windows (at least with Cygwin), it is 80's still. My workstation\n(a 2.4GHz P4, 70C hot, 2Gb Dell monster) is about 100x slower than my\nold Asus laptop (a 384Mb, 1200Ghz Pentium-M) in starting a trivial program\n(\"int main() { return 0; }\").\n\nI'm trying to save where possible on cygwin, whatever cost.\n"},{"id":"113346","messageId":"4A043F7E.5070702@SierraAtlantic.com","threadId":"18913","inReplyTo":"81b0412b0905080228j6b114631p35395464c0c98540@mail.gmail.com","subject":"Re: Tests in Cygwin","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-08T14:19:42Z","receivedAt":"2009-05-08T14:19:42Z","isPatch":false,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Here is some testing that does not require a sub-shell and does support \noptions:\n\nrhf2-1:~/tmp>foof() { local IFS='       ,+';local args=\"$*\"; for i in \n$args; do echo i=$i; done; }\nrhf2-1:~/tmp>foo1() { for i; do echo i=$i; done; }\nrhf2-1:~/tmp>foo2() { for i in $*; do echo i=$i; done; }\nrhf2-1:~/tmp>foo1 'a b c' d e+f g,h 'j  k'\ni=a b c\ni=d\ni=e+f\ni=g,h\ni=j k\nrhf2-1:~/tmp>foo2 'a b c' d e+f g,h 'j  k'\ni=a\ni=b\ni=c\ni=d\ni=e+f\ni=g,h\ni=j\ni=k\nrhf2-1:~/tmp>foof 'a b c' d e+f g,h 'j  k'\ni=a\ni=b\ni=c\ni=d\ni=e\ni=f\ni=g\ni=h\ni=j\ni=k\nrhf2-1:~/tmp>uname -a\nCYGWIN_NT-5.1 rhf2-1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin\n\nNote: that should be IFS=$' \\t+,' and $'j\\tk' in case the mailer messes \nthis up.   I did not use this bash special syntax.\n\nSo which should we go with? foo2() which does the original way or foof() \nwhich allows you to use ',' and '+', and spaces?\n    -Don\n\n-------- Original Message --------\nSubject: Re: Tests in Cygwin\nFrom: Alex Riesen <raa.lkml@gmail.com>\nTo: Junio C Hamano <gitster@pobox.com>\nDate: 5/8/2009 5:28 AM\n> 2009/5/8 Junio C Hamano <gitster@pobox.com>:\n>   \n>> Johannes Sixt <j.sixt@viscovery.net> writes:\n>>\n>>     \n>>>>   +for prerequisite in $(echo \"$1\" | tr , ' ')\n>>>>         \n>>> So, you dislike the space separator, but you also dislike the IFS games\n>>> that save a few new processes? ;) (Think of Windows, where fork is expensive).\n>>>       \n>> You can play IFS=, game, then ;-)\n>>\n>> I have to admit that it feels so 80'ish, back when our UNIX machines were\n>> so slow that we tried to shave every fork+exec from our shell scripts by\n>> using built-ins when possible, though.\n>>     \n>\n> Well, on Windows (at least with Cygwin), it is 80's still. My workstation\n> (a 2.4GHz P4, 70C hot, 2Gb Dell monster) is about 100x slower than my\n> old Asus laptop (a 384Mb, 1200Ghz Pentium-M) in starting a trivial program\n> (\"int main() { return 0; }\").\n>\n> I'm trying to save where possible on cygwin, whatever cost.\n>   \n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"},{"id":"113347","messageId":"4A044196.7050106@viscovery.net","threadId":"18913","inReplyTo":"4A043F7E.5070702@SierraAtlantic.com","subject":"Re: Tests in Cygwin","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-08T14:28:38Z","receivedAt":"2009-05-08T14:28:38Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Don Slutz schrieb:\n> So which should we go with? foo2() which does the original way or foof()\n> which allows you to use ',' and '+', and spaces?\n\nI'd say take Junio's original proposal (that separates with spaces), but use\n\n     for prerequisite in $*      # split args at spaces\n\n(including the comment!) instead of merely\n\n     for prerequisite\n\nI can certainly live with the quoting at the call sites of\ntest_expect_success that is needed in the few cases where there is more\nthan one prerequisite.\n\n-- Hannes\n"},{"id":"113358","messageId":"81b0412b0905080945k46753edcy377cdaf5c4eb2e43@mail.gmail.com","threadId":"18913","inReplyTo":"4A043F7E.5070702@SierraAtlantic.com","subject":"Re: Tests in Cygwin","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-05-08T16:45:43Z","receivedAt":"2009-05-08T16:45:43Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"2009/5/8 Don Slutz <Don.Slutz@sierraatlantic.com>:\n> Here is some testing that does not require a sub-shell and does support\n> options:\n>\n> rhf2-1:~/tmp>foof() { local IFS='       ,+';local args=\"$*\"; for i in $args;\n> do echo i=$i; done; }\n\nI like this :)\n"}]}