{"thread":{"id":"710","subject":"[PATCH] Make tests more portable","startedAt":"2005-05-25T04:52:28Z","lastAt":"2005-05-26T00:07:33Z","messageCount":3,"participants":["Mark Allen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"3917","messageId":"20050525045229.29706.qmail@web41205.mail.yahoo.com","threadId":"710","inReplyTo":null,"subject":"[PATCH] Make tests more portable","fromName":"Mark Allen","fromEmail":"mrallen1@yahoo.com","sentAt":"2005-05-25T04:52:28Z","receivedAt":"2005-05-25T04:52:28Z","isPatch":true,"sender":{"key":"mrallen1@yahoo.com","avatar":null},"body":"I made some minor changes to the test suite to make the tests more portable.  The sed on\nDarwin doesn't understand extended regex, cmp won't read from '-', and xargs doesn't have\nan '-r' command line flag.\n\nThe t3000 test was broken because it wasn't updated when Linus merged Junio's patch to\nmake git-ls-files show filenames with leading dots.  I fixed that with a trivial\naddition. \n\nCheers,\n\n--Mark\n\n\nMake t0000-basic.sh and t0110-environment-names-old.sh more portable.\nFix t3000-ls-files-others to pick up filenames that start with dots.\n\n---\ncommit 36c3e78b55d6740201296aadd32430c0212ad0bf\ntree b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a\nparent c4ee2952b3146fe7dc9433b92bf066e55987ef74\nauthor Mark Allen <mallen@aeris.local> 1116996230 -0500\ncommitter Mark Allen <mallen@aeris.local> 1116996230 -0500\n\n t0000-basic.sh                 |    2 +-\n t0110-environment-names-old.sh |    6 ++----\n t3000-ls-files-others.sh       |    1 +\n 3 files changed, 4 insertions, 5 deletions\n\nIndex: t/t0000-basic.sh\n===================================================================\n--- 0a6dd114f3cbd19fc9773dc31f19c21b59007800/t/t0000-basic.sh  (mode:100755)\n+++ b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a/t/t0000-basic.sh  (mode:100755)\n@@ -84,7 +84,7 @@\n done\n test_expect_success \\\n     'adding various types of objects with git-update-cache --add.' \\\n-    'find path* ! -type d -print0 | xargs -0 -r git-update-cache --add'\n+    'find path* ! -type d -print0 | xargs -0 git-update-cache --add'\n \n # Show them and see that matches what we expect.\n test_expect_success \\\nIndex: t/t0110-environment-names-old.sh\n===================================================================\n--- 0a6dd114f3cbd19fc9773dc31f19c21b59007800/t/t0110-environment-names-old.sh  (mode:100755)\n+++ b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a/t/t0110-environment-names-old.sh  (mode:100755)\n@@ -86,8 +86,7 @@\n EOF\n test_expect_success \\\n     'verify old AUTHOR variables were used correctly in commit' \\\n-    'sed -ne '\\''/^\\(author\\|committer\\)/s|>.*|>|p'\\'' current |\n-     cmp - expected'\n+    'sed -ne '\\''/^\\(author\\)/s|>.*|>|p'\\'' -e'\\''/^\\(committer\\)/s|>.*|>|p'\\''\\    current > out && cmp out expected'\n \n unset GIT_DIR\n test_expect_success \\\n@@ -128,7 +127,6 @@\n EOF\n test_expect_success \\\n     'verify new AUTHOR variables were used correctly in commit.' \\\n-    'sed -ne '\\''/^\\(author\\|committer\\)/s|>.*|>|p'\\'' current |\n-     cmp - expected'\n+    'sed -ne '\\''/^\\(author\\)/s|>.*|>|p'\\'' -e'\\''/^\\(committer\\)/s|>.*|>|p'\\''\\    current > out && cmp out expected'\n \n test_done\nIndex: t/t3000-ls-files-others.sh\n===================================================================\n--- 0a6dd114f3cbd19fc9773dc31f19c21b59007800/t/t3000-ls-files-others.sh  (mode:100755)\n+++ b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a/t/t3000-ls-files-others.sh  (mode:100755)\n@@ -22,6 +22,7 @@\n     'git-ls-files --others to show output.' \\\n     'git-ls-files --others >.output'\n cat >.expected <<EOF\n+.output\n path0\n path1\n path2/file2\n"},{"id":"3920","messageId":"7vis17opnz.fsf@assigned-by-dhcp.cox.net","threadId":"710","inReplyTo":"20050525045229.29706.qmail@web41205.mail.yahoo.com","subject":"Re: [PATCH] Make tests more portable","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-25T05:11:44Z","receivedAt":"2005-05-25T05:11:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"MA\" == Mark Allen <mrallen1@yahoo.com> writes:\n\nMA> I made some minor changes to the test suite to make the\nMA> tests more portable.  The sed on Darwin doesn't understand\nMA> extended regex, cmp won't read from '-', and xargs doesn't\nMA> have an '-r' command line flag.\n\nThank you for doing this.\n\nMA> The t3000 test was broken because it wasn't updated when\nMA> Linus merged Junio's patch to make git-ls-files show\nMA> filenames with leading dots.  I fixed that with a trivial\nMA> addition.\n\nNot updating the tests to match code was my fault, not Linus.\nThanks again for the fix.\n\n\n"},{"id":"3957","messageId":"7vsm0ahmt6.fsf@assigned-by-dhcp.cox.net","threadId":"710","inReplyTo":"20050525045229.29706.qmail@web41205.mail.yahoo.com","subject":"[PATCH] Make tests more portable","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-26T00:07:33Z","receivedAt":"2005-05-26T00:07:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is the remainder of testcase fix by Mark Allen to make them\nwork on his Darwin box.  I was using \"xargs -r\" (GNU) where it\nwas not needed, sed -ne '/^\\(author\\|committer\\)/s|>.*|>|p'\nwhere his sed does not know what to do with '\\|', and \"cmp -\nfile\" to compare standard input with a file, which his cmp does\nnot support.\n\nAnother problem his patch fixed has been merged in the tip of\nyour git.git already.\n\nAuthor: Mark Allen <mrallen1@yahoo.com>\nAuthor-Date: Tue, 24 May 2005 21:52:28 -0700\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\nt/t0000-basic.sh                 |    2 +-\nt/t0110-environment-names-old.sh |    6 ++----\n2 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -84,7 +84,7 @@ do\n done\n test_expect_success \\\n     'adding various types of objects with git-update-cache --add.' \\\n-    'find path* ! -type d -print0 | xargs -0 -r git-update-cache --add'\n+    'find path* ! -type d -print0 | xargs -0 git-update-cache --add'\n \n # Show them and see that matches what we expect.\n test_expect_success \\\ndiff --git a/t/t0110-environment-names-old.sh b/t/t0110-environment-names-old.sh\n--- a/t/t0110-environment-names-old.sh\n+++ b/t/t0110-environment-names-old.sh\n@@ -86,8 +86,7 @@ committer A U Thor <author@example.xz>\n EOF\n test_expect_success \\\n     'verify old AUTHOR variables were used correctly in commit' \\\n-    'sed -ne '\\''/^\\(author\\|committer\\)/s|>.*|>|p'\\'' current |\n-     cmp - expected'\n+    'sed -ne '\\''/^\\(author\\)/s|>.*|>|p'\\'' -e'\\''/^\\(committer\\)/s|>.*|>|p'\\''\\    current > out && cmp out expected'\n \n unset GIT_DIR\n test_expect_success \\\n@@ -128,7 +127,6 @@ committer R O Htua <rohtua@example.xz>\n EOF\n test_expect_success \\\n     'verify new AUTHOR variables were used correctly in commit.' \\\n-    'sed -ne '\\''/^\\(author\\|committer\\)/s|>.*|>|p'\\'' current |\n-     cmp - expected'\n+    'sed -ne '\\''/^\\(author\\)/s|>.*|>|p'\\'' -e'\\''/^\\(committer\\)/s|>.*|>|p'\\''\\    current > out && cmp out expected'\n \n test_done\n------------------------------------------------\n\n"}]}