test-mergesort: add generate subcommand
commit0cecb75531e1ab525f42943be71f4a213d023412
authorRené Scharfe <l.s.r@web.de>
Fri, 1 Oct 2021 09:14:32 +0000 (1 11:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Oct 2021 19:43:08 +0000 (1 12:43 -0700)
tree239f5f0d2332581859a12beeda538df436067c46
parente031e9719d21c11102870b8037bdda995dede5e0
test-mergesort: add generate subcommand

Add a subcommand for printing test data.  It can be used to generate
special test cases and feed them into the sort subcommand or sort(1) for
performance measurements.  It may also be useful to illustrate the
effect of distributions, modes and their parameters.

It generates n integers with the specified distribution and its
distribution-specific parameter m.  E.g. m is the maximum value for
the plateau distribution and the length and height of individual teeth
of the sawtooth distribution.

The generated values are printed as zero-padded eight-digit hexadecimal
numbers to make sure alphabetic and numeric order are the same.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-mergesort.c