[PATCH v4 24/24] perf: add partial writing test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a test that uses update-index and exercises the partial writing code
path.
---
 t/perf/p0003-index.sh | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/t/perf/p0003-index.sh b/t/perf/p0003-index.sh
index 5360175..d1f590b 100755
--- a/t/perf/p0003-index.sh
+++ b/t/perf/p0003-index.sh
@@ -5,6 +5,7 @@ test_description="Tests index versions [23]/4/5"
 . ./perf-lib.sh
 
 test_perf_large_repo
+test_checkout_worktree
 
 test_expect_success "convert to v3" "
 	git update-index --index-version=2
@@ -15,6 +16,7 @@ test_perf "v[23]: update-index" "
 "
 
 subdir=$(git ls-files | sed 's#/[^/]*$##' | grep -v '^$' | uniq | tail -n 30 | head -1)
+file=$(git ls-files | tail -n 30 | head -1)
 
 test_perf "v[23]: grep nonexistent -- subdir" "
 	test_must_fail git grep nonexistent -- $subdir >/dev/null
@@ -24,6 +26,16 @@ test_perf "v[23]: ls-files -- subdir" "
 	git ls-files $subdir >/dev/null
 "
 
+test_expect_success "v[23] update-index prepare" "
+	echo x >$file
+"
+
+test_perf_cleanup "v[23] update-index" "
+	git update-index $file
+" "
+	git reset
+"
+
 test_expect_success "convert to v4" "
 	git update-index --index-version=4
 "
@@ -40,6 +52,17 @@ test_perf "v4: ls-files -- subdir" "
 	git ls-files $subdir >/dev/null
 "
 
+test_expect_success "v4 update-index prepare" "
+	echo x >$file
+"
+
+test_perf_cleanup "v4 update-index" "
+	git update-index $file
+" "
+	git reset
+"
+
+
 test_expect_success "convert to v5" "
 	git update-index --index-version=5
 "
@@ -60,4 +83,14 @@ test_perf "v5: ls-files -- subdir" "
 	git ls-files $subdir >/dev/null
 "
 
+test_expect_success "v5 update-index prepare" "
+	echo x >$file
+"
+
+test_perf_cleanup "v5 update-index" "
+	git update-index $file
+" "
+	git reset
+"
+
 test_done
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]