]> git.ipfire.org Git - thirdparty/git.git/blame - t/perf/p0071-sort.sh
Merge branch 'rs/bisect-start-leakfix' into maint-2.38
[thirdparty/git.git] / t / perf / p0071-sort.sh
CommitLineData
564e94e6
RS
1#!/bin/sh
2
3test_description='Basic sort performance tests'
4. ./perf-lib.sh
5
6test_perf_default_repo
7
8test_expect_success 'setup' '
9 git ls-files --stage "*.[ch]" "*.sh" |
10 cut -f2 -d" " |
11 git cat-file --batch >unsorted
12'
13
84edc406
RS
14test_perf 'sort(1) unsorted' '
15 sort <unsorted >sorted
564e94e6
RS
16'
17
84edc406
RS
18test_expect_success 'reverse' '
19 sort -r <unsorted >reversed
564e94e6
RS
20'
21
84edc406
RS
22for file in sorted reversed
23do
24 test_perf "sort(1) $file" "
25 sort <$file >actual
26 "
27done
28
29for file in unsorted sorted reversed
30do
31
32 test_perf "string_list_sort() $file" "
33 test-tool string-list sort <$file >actual
34 "
35
36 test_expect_success "string_list_sort() $file sorts like sort(1)" "
37 test_cmp_bin sorted actual
38 "
39done
564e94e6 40
40bc872a
RS
41for file in unsorted sorted reversed
42do
b378c2ff 43 test_perf "DEFINE_LIST_SORT $file" "
40bc872a
RS
44 test-tool mergesort sort <$file >actual
45 "
46
b378c2ff 47 test_expect_success "DEFINE_LIST_SORT $file sorts like sort(1)" "
40bc872a
RS
48 test_cmp_bin sorted actual
49 "
50done
51
564e94e6 52test_done