]> git.ipfire.org Git - thirdparty/git.git/blob - t/perf/p0071-sort.sh
lib-httpd: extend module location auto-detection
[thirdparty/git.git] / t / perf / p0071-sort.sh
1 #!/bin/sh
2
3 test_description='Basic sort performance tests'
4 . ./perf-lib.sh
5
6 test_perf_default_repo
7
8 test_expect_success 'setup' '
9 git ls-files --stage "*.[ch]" "*.sh" |
10 cut -f2 -d" " |
11 git cat-file --batch >unsorted
12 '
13
14 test_perf 'sort(1) unsorted' '
15 sort <unsorted >sorted
16 '
17
18 test_expect_success 'reverse' '
19 sort -r <unsorted >reversed
20 '
21
22 for file in sorted reversed
23 do
24 test_perf "sort(1) $file" "
25 sort <$file >actual
26 "
27 done
28
29 for file in unsorted sorted reversed
30 do
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 "
39 done
40
41 for file in unsorted sorted reversed
42 do
43 test_perf "llist_mergesort() $file" "
44 test-tool mergesort sort <$file >actual
45 "
46
47 test_expect_success "llist_mergesort() $file sorts like sort(1)" "
48 test_cmp_bin sorted actual
49 "
50 done
51
52 test_done