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

Re: [RFC PATCH 2/2] unit test: add basic example

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 27, 2023, 18:47 UTC
Message-ID
<xmqqedo5jh6a.fsf@gitster.g>
In-Reply-To
<20230427175007.902278-3-calvinwan@google.com>
Calvin Wan <calvinwan@google.com> writes:
Show 8 quoted lines
> Although this commit doesn't showcase unit tests running against
> anything in Git, locally, I have a smaller set of Git files compiling
> into a library with unit tests running against it using this C TAP
> harness.
>
> However, you can run `make ctap` to get an idea of how the output looks
> and use it as a baseline to play around with the other features of the
> library.
My aging eyes first read it as "make crap" ;-).

Should we ove most of it to some other Makefile that lives in t/tap and keep it outside the primary Makefile? This is adding about half a dozen lines to support a sample unit-test.c file to be tested, and if we are going to have 200 of them would we add a thousand or more lines?

As a technology demonstration, such a hello-world test may be fine, but I would have liked to see a more realistic sample that links with reasonably isolated part of Git codebase, perhaps testing say functions from <quote.h>.

THanks.
Previous: Calvin WanNext: Felipe Contreras
Message 22 of 29 in “add an external testing library for unit tests”
  1. 0/2 add an external testing library for unit testsCalvin Wan, Apr 27, 2023
  2. 1/2 Add C TAP harnessCalvin Wan, Apr 27, 2023
  3. SZEDER GáborApr 27, 2023
  4. Calvin WanApr 27, 2023
  5. Phillip WoodApr 27, 2023
  6. Calvin WanApr 28, 2023
  7. Felipe ContrerasMay 2, 2023
  8. Phillip WoodMay 10, 2023
  9. Glen ChooMay 11, 2023
  10. Phillip WoodMay 18, 2023
  11. Linus ArverJun 21, 2023
  12. Phillip WoodJun 26, 2023
  13. Linus ArverJun 28, 2023
  14. Oswald BuddenhagenJun 29, 2023
  15. Phillip WoodJun 30, 2023
  16. Felipe ContrerasMay 2, 2023
  17. Ævar Arnfjörð BjarmasonMay 2, 2023
  18. Felipe ContrerasMay 2, 2023
  19. Ævar Arnfjörð BjarmasonMay 2, 2023
  20. Phillip WoodMay 10, 2023
  21. 2/2 unit test: add basic exampleCalvin Wan, Apr 27, 2023
  22. Junio C HamanoApr 27, 2023
  23. Felipe ContrerasMay 2, 2023
  24. Junio C HamanoApr 27, 2023
  25. Calvin WanApr 27, 2023
  26. brian m. carlsonApr 27, 2023
  27. Felipe ContrerasMay 2, 2023
  28. Ævar Arnfjörð BjarmasonMay 2, 2023
  29. Felipe ContrerasMay 2, 2023

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.