From: "Nick Edelen" <sirnot@gmail.com>
To: "Nick Edelen" <sirnot@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Jeff King" <peff@peff.net>, "Sam Vilain" <sam@vilain.net>,
Subject: Re: [PATCH 5/5] full integration of rev-cache into git's revision walker, completed test suite
Date: Fri, 07 Aug 2009 15:47:26 +0200 [thread overview]
Message-ID: <op.uyaolcvttdk399@sirnot.private> (raw)
In-Reply-To: <op.ux8i7ceotdk399@sirnot.private>
A small patch to eliminate the python dependency in rev-cache's test-suite.
This is a holdover for the 'integration' patch until a revised patchset is sent.
Signed-off-by: Nick Edelen <sirnot@gmail.com>
---
I've also implemented name caching, but I'd like to cleanup that (and the docs
;-) up a bit before posting it. I'll have everything ready for public display
by tonight (I've got an appointment for the next several hours).
t/t6015-rev-cache-list.sh | 39 +++++++++++++++++++++------------------
t/t6015-sha1-dump-diff.py | 36 ------------------------------------
2 files changed, 21 insertions(+), 54 deletions(-)
diff --git a/t/t6015-rev-cache-list.sh b/t/t6015-rev-cache-list.sh
index bfd9525..7c3719d 100755
--- a/t/t6015-rev-cache-list.sh
+++ b/t/t6015-rev-cache-list.sh
@@ -3,7 +3,11 @@
test_description='git rev-cache tests'
. ./test-lib.sh
-sha1diff="python $TEST_DIRECTORY/t6015-sha1-dump-diff.py"
+test_cmp_sorted() {
+ grep -io "[a-f0-9]*" $1 | sort >.tmpfile1 &&
+ grep -io "[a-f0-9]*" $2 | sort >.tmpfile2 &&
+ test_cmp .tmpfile1 .tmpfile2
+}
# we want a totally wacked out branch structure...
# we need branching and merging of sizes up through 3, tree
@@ -99,49 +103,49 @@ test_expect_success 'remake cache slice' '
#check core mechanics and rev-list hook for commits
test_expect_success 'test rev-caches walker directly (limited)' '
git-rev-cache walk HEAD --not HEAD~3 >list &&
- test -z `$sha1diff list proper_commit_list_limited`
+ test_cmp_sorted list proper_commit_list_limited
'
test_expect_success 'test rev-caches walker directly (unlimited)' '
git-rev-cache walk HEAD >list &&
- test -z `$sha1diff list proper_commit_list`
+ test_cmp_sorted list proper_commit_list
'
test_expect_success 'test rev-list traversal (limited)' '
git-rev-list HEAD --not HEAD~3 >list &&
- test -z `$sha1diff list proper_commit_list_limited`
+ test_cmp list proper_commit_list_limited
'
test_expect_success 'test rev-list traversal (unlimited)' '
git-rev-list HEAD >list &&
- test -z `$sha1diff list proper_commit_list`
+ test_cmp list proper_commit_list
'
#do the same for objects
test_expect_success 'test rev-caches walker with objects' '
git-rev-cache walk --objects HEAD >list &&
- test -z `$sha1diff list proper_object_list`
+ test_cmp_sorted list proper_object_list
'
test_expect_success 'test rev-list with objects (topo order)' '
git-rev-list --topo-order --objects HEAD >list &&
- test -z `$sha1diff list proper_object_list`
+ test_cmp_sorted list proper_object_list
'
test_expect_success 'test rev-list with objects (no order)' '
git-rev-list --objects HEAD >list &&
- test -z `$sha1diff list proper_object_list`
+ test_cmp_sorted list proper_object_list
'
#verify age limiting
test_expect_success 'test rev-list date limiting (topo order)' '
git-rev-list --topo-order --max-age=$min_date --min-age=$max_date HEAD >list &&
- test -z `$sha1diff list proper_list_date_limited`
+ test_cmp_sorted list proper_list_date_limited
'
test_expect_success 'test rev-list date limiting (no order)' '
git-rev-list --max-age=$min_date --min-age=$max_date HEAD >list &&
- test -z `sha1diff list proper_list_date_limited`
+ test_cmp_sorted list proper_list_date_limited
'
#check partial cache slice
@@ -154,7 +158,7 @@ test_expect_success 'saving old cache and generating partial slice' '
'
test_expect_success 'rev-list with wholly interesting partial slice' '
- git-rev-list --topo-order HEAD >list &&
+ git-rev-list --topo-order HEAD >list &&
test_cmp list proper_commit_list
'
@@ -199,13 +203,13 @@ test_expect_success 'corrupt slice' '
'
test_expect_success 'test rev-list traversal (limited) (corrupt slice)' '
- git-rev-list HEAD --not HEAD~3 >list &&
- test -z `$sha1diff list proper_commit_list_limited`
+ git-rev-list --topo-order HEAD --not HEAD~3 >list &&
+ test_cmp list proper_commit_list_limited
'
test_expect_success 'test rev-list traversal (unlimited) (corrupt slice)' '
git-rev-list HEAD >list &&
- test -z `$sha1diff list proper_commit_list`
+ test_cmp_sorted list proper_commit_list
'
test_expect_success 'corrupt index' '
@@ -213,16 +217,15 @@ test_expect_success 'corrupt index' '
'
test_expect_success 'test rev-list traversal (limited) (corrupt index)' '
- git-rev-list HEAD --not HEAD~3 >list &&
- test -z `$sha1diff list proper_commit_list_limited`
+ git-rev-list --topo-order HEAD --not HEAD~3 >list &&
+ test_cmp list proper_commit_list_limited
'
test_expect_success 'test rev-list traversal (unlimited) (corrupt index)' '
git-rev-list HEAD >list &&
- test -z `$sha1diff list proper_commit_list`
+ test_cmp_sorted list proper_commit_list
'
#test --ignore-size in fuse?
test_done
-
diff --git a/t/t6015-sha1-dump-diff.py b/t/t6015-sha1-dump-diff.py
deleted file mode 100755
index 7fc30e7..0000000
--- a/t/t6015-sha1-dump-diff.py
+++ /dev/null
@@ -1,36 +0,0 @@
-
-import sys, re
-
-if len(sys.argv) < 3 :
- sys.exit(0)
-
-f = open(sys.argv[1], 'r')
-dict = {}
-for line in f :
- if len(line) >= 40 and re.match(r'^[0-9a-fA-F]{40}', line[:40]) != None :
- dict[line[:40]] = 1
-
-f.close()
-
-f = open(sys.argv[2], 'r')
-for line in f :
- if len(line) < 40 :
- continue
-
- hash = line[:40]
- if re.match(r'^[0-9a-fA-F]{40}', hash) == None :
- continue
-
- if hash in dict :
- dict[hash] -= 1
- else :
- dict[hash] = -1
-
-f.close()
-
-for k in dict.keys() :
- if dict[k] == 0 :
- del dict[k]
-
-if len(dict) :
- print dict
---
prev parent reply other threads:[~2009-08-07 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 9:55 [PATCH 5/5] full integration of rev-cache into git's revision walker, completed test suite Nick Edelen
2009-08-07 3:22 ` Sam Vilain
2009-08-07 13:47 ` Nick Edelen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.uyaolcvttdk399@sirnot.private \
--to=sirnot@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sam@vilain.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).