diff options
Diffstat (limited to 't/perf')
-rw-r--r-- | t/perf/Makefile | 3 | ||||
-rwxr-xr-x | t/perf/p0005-status.sh | 12 | ||||
-rwxr-xr-x | t/perf/p0006-read-tree-checkout.sh | 20 | ||||
-rwxr-xr-x | t/perf/p0007-write-cache.sh | 4 | ||||
-rwxr-xr-x | t/perf/p0100-globbing.sh | 4 | ||||
-rwxr-xr-x | t/perf/p1400-update-ref.sh | 4 | ||||
-rwxr-xr-x | t/perf/p1451-fsck-skip-list.sh | 2 | ||||
-rwxr-xr-x | t/perf/p2000-sparse-operations.sh | 3 | ||||
-rwxr-xr-x | t/perf/p3400-rebase.sh | 2 | ||||
-rwxr-xr-x | t/perf/p4002-diff-color-moved.sh | 57 | ||||
-rwxr-xr-x | t/perf/p5302-pack-index.sh | 4 | ||||
-rwxr-xr-x | t/perf/p5303-many-packs.sh | 10 | ||||
-rwxr-xr-x | t/perf/p7519-fsmonitor.sh | 8 | ||||
-rw-r--r-- | t/perf/perf-lib.sh | 2 |
14 files changed, 99 insertions, 36 deletions
diff --git a/t/perf/Makefile b/t/perf/Makefile index 2465770a78..e4808aebed 100644 --- a/t/perf/Makefile +++ b/t/perf/Makefile @@ -1,3 +1,6 @@ +# Import tree-wide shared Makefile behavior and libraries +include ../../shared.mak + -include ../../config.mak export GIT_TEST_OPTIONS diff --git a/t/perf/p0005-status.sh b/t/perf/p0005-status.sh index 0b0aa9858f..ca58d6c9b5 100755 --- a/t/perf/p0005-status.sh +++ b/t/perf/p0005-status.sh @@ -24,17 +24,17 @@ test_perf_default_repo test_expect_success "setup repo" ' if git rev-parse --verify refs/heads/p0006-ballast^{commit} then - echo Assuming synthetic repo from many-files.sh - git branch br_base master - git branch br_ballast p0006-ballast - git config --local core.sparsecheckout 1 + echo Assuming synthetic repo from many-files.sh && + git branch br_base master && + git branch br_ballast p0006-ballast && + git config --local core.sparsecheckout 1 && cat >.git/info/sparse-checkout <<-EOF /* !ballast/* EOF else - echo Assuming non-synthetic repo... - git branch br_base $(git rev-list HEAD | tail -n 1) + echo Assuming non-synthetic repo... && + git branch br_base $(git rev-list HEAD | tail -n 1) && git branch br_ballast HEAD fi && git checkout -q br_ballast && diff --git a/t/perf/p0006-read-tree-checkout.sh b/t/perf/p0006-read-tree-checkout.sh index 78cc23fe2f..900b385c4b 100755 --- a/t/perf/p0006-read-tree-checkout.sh +++ b/t/perf/p0006-read-tree-checkout.sh @@ -24,21 +24,21 @@ test_perf_default_repo test_expect_success "setup repo" ' if git rev-parse --verify refs/heads/p0006-ballast^{commit} then - echo Assuming synthetic repo from many-files.sh - git branch br_base master - git branch br_ballast p0006-ballast^ - git branch br_ballast_alias p0006-ballast^ - git branch br_ballast_plus_1 p0006-ballast - git config --local core.sparsecheckout 1 + echo Assuming synthetic repo from many-files.sh && + git branch br_base master && + git branch br_ballast p0006-ballast^ && + git branch br_ballast_alias p0006-ballast^ && + git branch br_ballast_plus_1 p0006-ballast && + git config --local core.sparsecheckout 1 && cat >.git/info/sparse-checkout <<-EOF /* !ballast/* EOF else - echo Assuming non-synthetic repo... - git branch br_base $(git rev-list HEAD | tail -n 1) - git branch br_ballast HEAD^ || error "no ancestor commit from current head" - git branch br_ballast_alias HEAD^ + echo Assuming non-synthetic repo... && + git branch br_base $(git rev-list HEAD | tail -n 1) && + git branch br_ballast HEAD^ || error "no ancestor commit from current head" && + git branch br_ballast_alias HEAD^ && git branch br_ballast_plus_1 HEAD fi && git checkout -q br_ballast && diff --git a/t/perf/p0007-write-cache.sh b/t/perf/p0007-write-cache.sh index 09595264f0..25d8ff7443 100755 --- a/t/perf/p0007-write-cache.sh +++ b/t/perf/p0007-write-cache.sh @@ -9,8 +9,8 @@ test_perf_default_repo test_expect_success "setup repo" ' if git rev-parse --verify refs/heads/p0006-ballast^{commit} then - echo Assuming synthetic repo from many-files.sh - git config --local core.sparsecheckout 1 + echo Assuming synthetic repo from many-files.sh && + git config --local core.sparsecheckout 1 && cat >.git/info/sparse-checkout <<-EOF /* !ballast/* diff --git a/t/perf/p0100-globbing.sh b/t/perf/p0100-globbing.sh index dd18a9ce2b..439e9c8e3c 100755 --- a/t/perf/p0100-globbing.sh +++ b/t/perf/p0100-globbing.sh @@ -19,9 +19,9 @@ test_expect_success 'setup' ' printf "a" >>refname && for j in $(test_seq 1 $i) do - printf "a*" >>refglob.$i + printf "a*" >>refglob.$i || return 1 done && - echo b >>refglob.$i + echo b >>refglob.$i || return 1 done && test_commit test $(cat refname).t "" $(cat refname).t ' diff --git a/t/perf/p1400-update-ref.sh b/t/perf/p1400-update-ref.sh index dda8a74866..a75969cbb1 100755 --- a/t/perf/p1400-update-ref.sh +++ b/t/perf/p1400-update-ref.sh @@ -13,7 +13,7 @@ test_expect_success "setup" ' do printf "start\ncreate refs/heads/%d PRE\ncommit\n" $i && printf "start\nupdate refs/heads/%d POST PRE\ncommit\n" $i && - printf "start\ndelete refs/heads/%d POST\ncommit\n" $i + printf "start\ndelete refs/heads/%d POST\ncommit\n" $i || return 1 done >instructions ' @@ -22,7 +22,7 @@ test_perf "update-ref" ' do git update-ref refs/heads/branch PRE && git update-ref refs/heads/branch POST PRE && - git update-ref -d refs/heads/branch + git update-ref -d refs/heads/branch || return 1 done ' diff --git a/t/perf/p1451-fsck-skip-list.sh b/t/perf/p1451-fsck-skip-list.sh index c2b97d2487..f767d834f2 100755 --- a/t/perf/p1451-fsck-skip-list.sh +++ b/t/perf/p1451-fsck-skip-list.sh @@ -15,7 +15,7 @@ test_expect_success "setup $n bad commits" ' echo "committer C <c@example.com> 1234567890 +0000" && echo "data <<EOF" && echo "$i.Q." && - echo "EOF" + echo "EOF" || return 1 done | q_to_nul | git fast-import ' diff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh index cb777c74a2..382716cfca 100755 --- a/t/perf/p2000-sparse-operations.sh +++ b/t/perf/p2000-sparse-operations.sh @@ -117,5 +117,8 @@ test_perf_on_all git diff test_perf_on_all git diff --cached test_perf_on_all git blame $SPARSE_CONE/a test_perf_on_all git blame $SPARSE_CONE/f3/a +test_perf_on_all git read-tree -mu HEAD +test_perf_on_all git checkout-index -f --all +test_perf_on_all git update-index --add --remove $SPARSE_CONE/a test_done diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh index 43d5a34e8c..e6b0277729 100755 --- a/t/perf/p3400-rebase.sh +++ b/t/perf/p3400-rebase.sh @@ -22,7 +22,7 @@ test_expect_success 'setup rebasing on top of a lot of changes' ' git add unrelated-file$i && test_tick && git commit -m commit$i-reverse unrelated-file$i || - break + return 1 done && git checkout to-rebase && test_commit our-patch interesting-file diff --git a/t/perf/p4002-diff-color-moved.sh b/t/perf/p4002-diff-color-moved.sh new file mode 100755 index 0000000000..ab2af931c0 --- /dev/null +++ b/t/perf/p4002-diff-color-moved.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +test_description='Tests diff --color-moved performance' +. ./perf-lib.sh + +test_perf_default_repo + +# The endpoints of the diff can be customized by setting TEST_REV_A +# and TEST_REV_B in the environment when running this test. + +rev="${TEST_REV_A:-v2.28.0}" +if ! rev_a="$(git rev-parse --quiet --verify "$rev")" +then + skip_all="skipping because '$rev' was not found. \ + Use TEST_REV_A and TEST_REV_B to set the revs to use" + test_done +fi +rev="${TEST_REV_B:-v2.29.0}" +if ! rev_b="$(git rev-parse --quiet --verify "$rev")" +then + skip_all="skipping because '$rev' was not found. \ + Use TEST_REV_A and TEST_REV_B to set the revs to use" + test_done +fi + +GIT_PAGER_IN_USE=1 +test_export GIT_PAGER_IN_USE rev_a rev_b + +test_perf 'diff --no-color-moved --no-color-moved-ws large change' ' + git diff --no-color-moved --no-color-moved-ws $rev_a $rev_b +' + +test_perf 'diff --color-moved --no-color-moved-ws large change' ' + git diff --color-moved=zebra --no-color-moved-ws $rev_a $rev_b +' + +test_perf 'diff --color-moved-ws=allow-indentation-change large change' ' + git diff --color-moved=zebra --color-moved-ws=allow-indentation-change \ + $rev_a $rev_b +' + +test_perf 'log --no-color-moved --no-color-moved-ws' ' + git log --no-color-moved --no-color-moved-ws --no-merges --patch \ + -n1000 $rev_b +' + +test_perf 'log --color-moved --no-color-moved-ws' ' + git log --color-moved=zebra --no-color-moved-ws --no-merges --patch \ + -n1000 $rev_b +' + +test_perf 'log --color-moved-ws=allow-indentation-change' ' + git log --color-moved=zebra --color-moved-ws=allow-indentation-change \ + --no-merges --patch -n1000 $rev_b +' + +test_done diff --git a/t/perf/p5302-pack-index.sh b/t/perf/p5302-pack-index.sh index 228593d9ad..c16f6a3ff6 100755 --- a/t/perf/p5302-pack-index.sh +++ b/t/perf/p5302-pack-index.sh @@ -21,8 +21,8 @@ test_expect_success 'set up thread-counting tests' ' threads= && while test $t -gt 0 do - threads="$t $threads" - t=$((t / 2)) + threads="$t $threads" && + t=$((t / 2)) || return 1 done ' diff --git a/t/perf/p5303-many-packs.sh b/t/perf/p5303-many-packs.sh index 35c0cbdf49..af173a7b73 100755 --- a/t/perf/p5303-many-packs.sh +++ b/t/perf/p5303-many-packs.sh @@ -126,11 +126,11 @@ done # Measure pack loading with 10,000 packs. test_expect_success 'generate lots of packs' ' for i in $(test_seq 10000); do - echo "blob" - echo "data <<EOF" - echo "blob $i" - echo "EOF" - echo "checkpoint" + echo "blob" && + echo "data <<EOF" && + echo "blob $i" && + echo "EOF" && + echo "checkpoint" || return 1 done | git -c fastimport.unpackLimit=0 fast-import ' diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index 5eb5044a10..c8be58f3c7 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -119,10 +119,10 @@ test_expect_success "one time repo setup" ' fi && mkdir 1_file 10_files 100_files 1000_files 10000_files && - for i in $(test_seq 1 10); do touch 10_files/$i; done && - for i in $(test_seq 1 100); do touch 100_files/$i; done && - for i in $(test_seq 1 1000); do touch 1000_files/$i; done && - for i in $(test_seq 1 10000); do touch 10000_files/$i; done && + for i in $(test_seq 1 10); do touch 10_files/$i || return 1; done && + for i in $(test_seq 1 100); do touch 100_files/$i || return 1; done && + for i in $(test_seq 1 1000); do touch 1000_files/$i || return 1; done && + for i in $(test_seq 1 10000); do touch 10000_files/$i || return 1; done && git add 1_file 10_files 100_files 1000_files 10000_files && git commit -qm "Add files" && diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index 780a7402d5..407252bac7 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -161,7 +161,7 @@ test_run_perf_ () { test_cleanup=: test_export_="test_cleanup" export test_cleanup test_export_ - "$GTIME" -f "%E %U %S" -o test_time.$i "$SHELL" -c ' + "$GTIME" -f "%E %U %S" -o test_time.$i "$TEST_SHELL_PATH" -c ' . '"$TEST_DIRECTORY"/test-lib-functions.sh' test_export () { test_export_="$test_export_ $*" |