* [PATCH] Make tests more portable
@ 2005-05-25 4:52 Mark Allen
2005-05-25 5:11 ` Junio C Hamano
2005-05-26 0:07 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Mark Allen @ 2005-05-25 4:52 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
I made some minor changes to the test suite to make the tests more portable. The sed on
Darwin doesn't understand extended regex, cmp won't read from '-', and xargs doesn't have
an '-r' command line flag.
The t3000 test was broken because it wasn't updated when Linus merged Junio's patch to
make git-ls-files show filenames with leading dots. I fixed that with a trivial
addition.
Cheers,
--Mark
[-- Attachment #2: 3636773645-git-tests.patch --]
[-- Type: application/octet-stream, Size: 2586 bytes --]
Make t0000-basic.sh and t0110-environment-names-old.sh more portable.
Fix t3000-ls-files-others to pick up filenames that start with dots.
---
commit 36c3e78b55d6740201296aadd32430c0212ad0bf
tree b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a
parent c4ee2952b3146fe7dc9433b92bf066e55987ef74
author Mark Allen <mallen@aeris.local> 1116996230 -0500
committer Mark Allen <mallen@aeris.local> 1116996230 -0500
t0000-basic.sh | 2 +-
t0110-environment-names-old.sh | 6 ++----
t3000-ls-files-others.sh | 1 +
3 files changed, 4 insertions, 5 deletions
Index: t/t0000-basic.sh
===================================================================
--- 0a6dd114f3cbd19fc9773dc31f19c21b59007800/t/t0000-basic.sh (mode:100755)
+++ b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a/t/t0000-basic.sh (mode:100755)
@@ -84,7 +84,7 @@
done
test_expect_success \
'adding various types of objects with git-update-cache --add.' \
- 'find path* ! -type d -print0 | xargs -0 -r git-update-cache --add'
+ 'find path* ! -type d -print0 | xargs -0 git-update-cache --add'
# Show them and see that matches what we expect.
test_expect_success \
Index: t/t0110-environment-names-old.sh
===================================================================
--- 0a6dd114f3cbd19fc9773dc31f19c21b59007800/t/t0110-environment-names-old.sh (mode:100755)
+++ b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a/t/t0110-environment-names-old.sh (mode:100755)
@@ -86,8 +86,7 @@
EOF
test_expect_success \
'verify old AUTHOR variables were used correctly in commit' \
- 'sed -ne '\''/^\(author\|committer\)/s|>.*|>|p'\'' current |
- cmp - expected'
+ 'sed -ne '\''/^\(author\)/s|>.*|>|p'\'' -e'\''/^\(committer\)/s|>.*|>|p'\''\ current > out && cmp out expected'
unset GIT_DIR
test_expect_success \
@@ -128,7 +127,6 @@
EOF
test_expect_success \
'verify new AUTHOR variables were used correctly in commit.' \
- 'sed -ne '\''/^\(author\|committer\)/s|>.*|>|p'\'' current |
- cmp - expected'
+ 'sed -ne '\''/^\(author\)/s|>.*|>|p'\'' -e'\''/^\(committer\)/s|>.*|>|p'\''\ current > out && cmp out expected'
test_done
Index: t/t3000-ls-files-others.sh
===================================================================
--- 0a6dd114f3cbd19fc9773dc31f19c21b59007800/t/t3000-ls-files-others.sh (mode:100755)
+++ b17eadf351f4d2a9c7f8851863188ddb8e9e3c5a/t/t3000-ls-files-others.sh (mode:100755)
@@ -22,6 +22,7 @@
'git-ls-files --others to show output.' \
'git-ls-files --others >.output'
cat >.expected <<EOF
+.output
path0
path1
path2/file2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Make tests more portable
2005-05-25 4:52 [PATCH] Make tests more portable Mark Allen
@ 2005-05-25 5:11 ` Junio C Hamano
2005-05-26 0:07 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2005-05-25 5:11 UTC (permalink / raw)
To: Mark Allen; +Cc: git
>>>>> "MA" == Mark Allen <mrallen1@yahoo.com> writes:
MA> I made some minor changes to the test suite to make the
MA> tests more portable. The sed on Darwin doesn't understand
MA> extended regex, cmp won't read from '-', and xargs doesn't
MA> have an '-r' command line flag.
Thank you for doing this.
MA> The t3000 test was broken because it wasn't updated when
MA> Linus merged Junio's patch to make git-ls-files show
MA> filenames with leading dots. I fixed that with a trivial
MA> addition.
Not updating the tests to match code was my fault, not Linus.
Thanks again for the fix.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Make tests more portable
2005-05-25 4:52 [PATCH] Make tests more portable Mark Allen
2005-05-25 5:11 ` Junio C Hamano
@ 2005-05-26 0:07 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2005-05-26 0:07 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Mark Allen, git
This is the remainder of testcase fix by Mark Allen to make them
work on his Darwin box. I was using "xargs -r" (GNU) where it
was not needed, sed -ne '/^\(author\|committer\)/s|>.*|>|p'
where his sed does not know what to do with '\|', and "cmp -
file" to compare standard input with a file, which his cmp does
not support.
Another problem his patch fixed has been merged in the tip of
your git.git already.
Author: Mark Allen <mrallen1@yahoo.com>
Author-Date: Tue, 24 May 2005 21:52:28 -0700
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
t/t0000-basic.sh | 2 +-
t/t0110-environment-names-old.sh | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -84,7 +84,7 @@ do
done
test_expect_success \
'adding various types of objects with git-update-cache --add.' \
- 'find path* ! -type d -print0 | xargs -0 -r git-update-cache --add'
+ 'find path* ! -type d -print0 | xargs -0 git-update-cache --add'
# Show them and see that matches what we expect.
test_expect_success \
diff --git a/t/t0110-environment-names-old.sh b/t/t0110-environment-names-old.sh
--- a/t/t0110-environment-names-old.sh
+++ b/t/t0110-environment-names-old.sh
@@ -86,8 +86,7 @@ committer A U Thor <author@example.xz>
EOF
test_expect_success \
'verify old AUTHOR variables were used correctly in commit' \
- 'sed -ne '\''/^\(author\|committer\)/s|>.*|>|p'\'' current |
- cmp - expected'
+ 'sed -ne '\''/^\(author\)/s|>.*|>|p'\'' -e'\''/^\(committer\)/s|>.*|>|p'\''\ current > out && cmp out expected'
unset GIT_DIR
test_expect_success \
@@ -128,7 +127,6 @@ committer R O Htua <rohtua@example.xz>
EOF
test_expect_success \
'verify new AUTHOR variables were used correctly in commit.' \
- 'sed -ne '\''/^\(author\|committer\)/s|>.*|>|p'\'' current |
- cmp - expected'
+ 'sed -ne '\''/^\(author\)/s|>.*|>|p'\'' -e'\''/^\(committer\)/s|>.*|>|p'\''\ current > out && cmp out expected'
test_done
------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-26 0:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-25 4:52 [PATCH] Make tests more portable Mark Allen
2005-05-25 5:11 ` Junio C Hamano
2005-05-26 0:07 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).