git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MAMuhammed Dilshad A <dilsheddilu123@gmail.com>
Date
Oct 9, 2026, 15:08 UTC
Message-ID
<cover.1791556668.git.dilsheddilu123@gmail.com>
In-Reply-To
<cover.1791365181.git.dilsheddilu123@gmail.com>

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
-- 
2.55.0
Previous: Muhammed Dilshad ANext: Muhammed Dilshad A
Message 12 of 16 in “test-mergesort: plug memory leaks in sort_stdin()”
  1. test-mergesort: plug memory leaks in sort_stdin()Muhammed Dilshad A, Oct 7, 2026
  2. Patrick SteinhardtOct 7, 2026
  3. Junio C HamanoOct 7, 2026
  4. 0/3 mergesort: move tests to Clar and retire the helperMuhammed Dilshad A, Oct 7, 2026
  5. 1/3 test-mergesort: plug memory leaks in sort_stdin()Muhammed Dilshad A, Oct 7, 2026
  6. 2/3 mergesort: move sorting tests to the unit-test frameworkMuhammed Dilshad A, Oct 7, 2026
  7. Patrick SteinhardtOct 9, 2026
  8. Muhammed Dilshad AOct 9, 2026
  9. 3/3 t: retire the sorting benchmark and mergesort helperMuhammed Dilshad A, Oct 7, 2026
  10. Patrick SteinhardtOct 9, 2026
  11. Muhammed Dilshad AOct 9, 2026
  12. 0/4 mergesort: move tests to Clar and remove the helperMuhammed Dilshad A, Oct 9, 2026
  13. 1/4 mergesort: move sorting tests to ClarMuhammed Dilshad A, Oct 9, 2026
  14. 2/4 mergesort: simplify the unit testsMuhammed Dilshad A, Oct 9, 2026
  15. 3/4 mergesort: cover empty and small listsMuhammed Dilshad A, Oct 9, 2026
  16. 4/4 t: retire the sorting benchmark and mergesort helperMuhammed Dilshad A, Oct 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.