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

[GSoC][PATCH v3 0/7] t: port reftable/merged_test.c to the unit testing framework

From
CPChandra Pratap <chandrapratap3519@gmail.com>
Date
Jul 11, 2024, 03:58 UTC
Message-ID
<20240711040854.4602-1-chandrapratap3519@gmail.com>
In-Reply-To
<20240709053847.4453-1-chandrapratap3519@gmail.com>

In the recent codebase update (commit 8bf6fbd, 2023-12-09), a new unit testing framework written entirely in C was introduced to the Git project aimed at simplifying testing and reducing test run times. Currently, tests for the reftable refs-backend are performed by a custom testing framework defined by reftable/test_framework.{c, h}. Port reftable/merged_test.c to the unit testing framework and improve upon the ported test.

The first patch in the series moves the test to the unit testing framework, and the rest of the patches improve upon the ported test.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
---
Changes in v3:
- Remove merged_test_main() from reftable/reftable-tests.h
- Fix a typo in patch 7
CI/PR: https://github.com/gitgitgadget/git/pull/1755

Chandra Pratap (7): [PATCH 1/7] t: move reftable/merged_test.c to the unit testing framework [PATCH 2/7] t: harmonize t-reftable-merged.c with coding guidelines [PATCH 3/7] t-reftable-merged: improve the test for t_merged_single_record() [PATCH 4/7] t-reftable-merged: improve the const-correctness of helper functions [PATCH 5/7] t-reftable-merged: add tests for reftable_merged_table_max_update_index [PATCH 6/7] t-reftable-merged: use reftable_ref_record_equal to compare ref records [PATCH 7/7] t-reftable-merged: add test for REFTABLE_FORMAT_ERROR

Makefile | 2 +- t/helper/test-reftable.c | 1 - reftable/reftable-tests.h | 1 - reftable/merged_test.c => t/unit-tests/t-reftable-merged.c | 202 +++++++++++++++---------------- 4 files changed, 103 insertions(+), 103 deletions(-)

Range-diff against v2:
1:  0d71deffad ! 1:  9c9fbaf75c t: move reftable/merged_test.c to the unit testing framework
    @@ Makefile: REFTABLE_OBJS += reftable/writer.o
      REFTABLE_TEST_OBJS += reftable/record_test.o
      REFTABLE_TEST_OBJS += reftable/readwrite_test.o
    + ## reftable/reftable-tests.h ##
    +@@ reftable/reftable-tests.h: license that can be found in the LICENSE file or at
    +
    + int basics_test_main(int argc, const char **argv);
    + int block_test_main(int argc, const char **argv);
    +-int merged_test_main(int argc, const char **argv);
    + int pq_test_main(int argc, const char **argv);
    + int record_test_main(int argc, const char **argv);
    + int readwrite_test_main(int argc, const char **argv);
    +
      ## t/helper/test-reftable.c ##
     @@ t/helper/test-reftable.c: int cmd__reftable(int argc, const char **argv)
      	tree_test_main(argc, argv);
2:  a449e2edcf = 2:  08c993f5f6 t: harmonize t-reftable-merged.c with coding guidelines
3:  20fb20bb59 = 3:  fa3085bd9b t-reftable-merged: improve the test t_merged_single_record()
4:  617f668b08 = 4:  d491c1f383 t-reftable-merged: improve the const-correctness of helper functions
5:  bf51af687f = 5:  ee9909f7ce t-reftable-merged: add tests for reftable_merged_table_max_update_index
6:  e2b8f6b3fe = 6:  5ce16e9cfc t-reftable-merged: use reftable_ref_record_equal to compare ref records
7:  b606d67ee7 ! 7:  d090e9ca5b t-reftable-merged: add test for REFTABLE_FORMAT_ERROR
    @@ Commit message
         t-reftable-merged: add test for REFTABLE_FORMAT_ERROR
         When calling reftable_new_merged_table(), if the hash ID of the
    -    passsed reftable_table parameter doesn't match the passed hash_id
    +    passed reftable_table parameter doesn't match the passed hash_id
         parameter, a REFTABLE_FORMAT_ERROR is thrown. This case is
         currently left unexercised, so add a test for the same.
Previous: Junio C HamanoNext: Chandra Pratap
Message 24 of 41 in “t: port reftable/merged_test.c to the unit testing framework”
  1. Chandra PratapJul 3, 2024
  2. 1/5 t: move reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 3, 2024
  3. Karthik NayakJul 5, 2024
  4. Chandra PratapJul 6, 2024
  5. 2/5 t: harmonize t-reftable-merged.c with coding guidelinesChandra Pratap, Jul 3, 2024
  6. Karthik NayakJul 5, 2024
  7. 3/5 t-reftable-merged: add tests for reftable_merged_table_max_update_indexChandra Pratap, Jul 3, 2024
  8. 4/5 t-reftable-merged: use reftable_ref_record_equal to compare ref recordsChandra Pratap, Jul 3, 2024
  9. Karthik NayakJul 5, 2024
  10. 5/5 t-reftable-merged: add test for REFTABLE_FORMAT_ERRORChandra Pratap, Jul 3, 2024
  11. Karthik NayakJul 5, 2024
  12. [GSoC][PATCH v2 0/7] t: port reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 9, 2024
  13. 1/7 t: move reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 9, 2024
  14. Justin ToblerJul 9, 2024
  15. 2/7 t: harmonize t-reftable-merged.c with coding guidelinesChandra Pratap, Jul 9, 2024
  16. 3/7 t-reftable-merged: improve the test t_merged_single_record()Chandra Pratap, Jul 9, 2024
  17. 4/7 t-reftable-merged: improve the const-correctness of helper functionsChandra Pratap, Jul 9, 2024
  18. 5/7 t-reftable-merged: add tests for reftable_merged_table_max_update_indexChandra Pratap, Jul 9, 2024
  19. 6/7 t-reftable-merged: use reftable_ref_record_equal to compare ref recordsChandra Pratap, Jul 9, 2024
  20. 7/7 t-reftable-merged: add test for REFTABLE_FORMAT_ERRORChandra Pratap, Jul 9, 2024
  21. Karthik NayakJul 10, 2024
  22. Karthik NayakJul 10, 2024
  23. Junio C HamanoJul 11, 2024
  24. [GSoC][PATCH v3 0/7] t: port reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 11, 2024
  25. 1/7 t: move reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 11, 2024
  26. 2/7 t: harmonize t-reftable-merged.c with coding guidelinesChandra Pratap, Jul 11, 2024
  27. Junio C HamanoJul 11, 2024
  28. 3/7 t-reftable-merged: improve the test t_merged_single_record()Chandra Pratap, Jul 11, 2024
  29. 4/7 t-reftable-merged: improve the const-correctness of helper functionsChandra Pratap, Jul 11, 2024
  30. 5/7 t-reftable-merged: add tests for reftable_merged_table_max_update_indexChandra Pratap, Jul 11, 2024
  31. 6/7 t-reftable-merged: use reftable_ref_record_equal to compare ref recordsChandra Pratap, Jul 11, 2024
  32. 7/7 t-reftable-merged: add test for REFTABLE_FORMAT_ERRORChandra Pratap, Jul 11, 2024
  33. [GSoC][PATCH v4 0/7] t: port reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 12, 2024
  34. 1/7 t: move reftable/merged_test.c to the unit testing frameworkChandra Pratap, Jul 12, 2024
  35. 2/7 t: harmonize t-reftable-merged.c with coding guidelinesChandra Pratap, Jul 12, 2024
  36. 3/7 t-reftable-merged: improve the test t_merged_single_record()Chandra Pratap, Jul 12, 2024
  37. 4/7 t-reftable-merged: improve the const-correctness of helper functionsChandra Pratap, Jul 12, 2024
  38. Patrick SteinhardtJul 24, 2024
  39. 5/7 t-reftable-merged: add tests for reftable_merged_table_max_update_indexChandra Pratap, Jul 12, 2024
  40. 6/7 t-reftable-merged: use reftable_ref_record_equal to compare ref recordsChandra Pratap, Jul 12, 2024
  41. 7/7 t-reftable-merged: add test for REFTABLE_FORMAT_ERRORChandra Pratap, Jul 12, 2024

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.