Skip to content

mergesort: move tests to Clar and remove the helper

Muhammed Dilshad A git 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v23 patches 4 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Changes in v3 from the cover letter

* Drop the leak-fix patch, since this series removes the helper.
* Simplify the test inputs and remove the distribution/mode tables.
* Put the additional tests in their own commit.
* Rewrite the commit messages to explain the changes more clearly.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mergesort: move sorting tests to ClarMakefile t/helper/test-mergesort.c t/meson.build +2 more+291 -3562 replies
2/4mergesort: simplify the unit testst/unit-tests/u-mergesort.c+59 -2420 replies
3/4mergesort: cover empty and small listst/unit-tests/u-mergesort.c+63 -00 replies
4/4t: retire the sorting benchmark and mergesort helperMakefile t/helper/meson.build t/helper/test-mergesort.c +4 more+0 -1220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] mergesort: move tests to Clar and remove the helper

Move the mergesort checks from the shell test and helper into Clar, where the tests call the sort functions directly.

Simplify the old distribution/mode grid to direct tests for sorted, reversed, equal-value and repeatable random input. Keep the checks for sorted values, the original order of equal values, and list length. Add empty and small-list cases and a check of the debug hooks separately. The final tests cover fewer input combinations than the old certification test.

Retire p0071, the benchmark used to compare sorting implementations. This removes the last user of the mergesort helper, so remove that too.

The migration, simplification, additional tests and benchmark removal are separate commits.

Changes since v2:

* Drop the leak-fix patch, since this series removes the helper.
* Simplify the test inputs and remove the distribution/mode tables.
* Put the additional tests in their own commit.
* Rewrite the commit messages to explain the changes more clearly.

Muhammed Dilshad A (4):
mergesort: move sorting tests to Clar
mergesort: simplify the unit tests
mergesort: cover empty and small lists
t: retire the sorting benchmark and mergesort helper

 Makefile                   |   2 +-
 t/helper/meson.build       |   1 -
 t/helper/test-mergesort.c  | 408 -------------------------------------
 t/helper/test-tool.c       |   1 -
 t/helper/test-tool.h       |   1 -
 t/meson.build              |   3 +-
 t/perf/p0071-sort.sh       |  52 -----
 t/t0071-sort.sh            |  11 -
 t/unit-tests/u-mergesort.c | 168 +++++++++++++++
 9 files changed, 170 insertions(+), 477 deletions(-)
 delete mode 100644 t/helper/test-mergesort.c
 delete mode 100755 t/perf/p0071-sort.sh
 delete mode 100755 t/t0071-sort.sh
 create mode 100644 t/unit-tests/u-mergesort.c

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd

Signature · 1 line
2.55.0