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

[RFC PATCH 0/3] test: new testing framework for libification

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 2, 2023, 04:11 UTC
Message-ID
<20230502041113.103385-1-felipe.contreras@gmail.com>

Calvin Wan proposed a new testing framework for unit tests written in C, and while I agree unit tests can be useful, there's no need to write everything in C.

I'm of the belief that one should pick the language that best fit the task, not write everything in the language that you happen to be already using.

A modern testing framework written in Ruby is much simpler, and more powerful than whatever can be written in C. This patch series shows an example of what can be achieved with just 68 lines of Ruby code, plus a git library with Ruby bindings.

[1] https://lore.kernel.org/git/20230427175007.902278-1-calvinwan@google.com/
Felipe Contreras (3):
  test: add simple shared library
  test: add basic unit testing framework
  test: add basic unit test
 .gitignore       |  1 +
 t/Makefile       | 22 ++++++++++++++++
 t/lib/git.c      |  6 +++++
 t/lib/git.h      |  6 +++++
 t/ruby/git.c     | 13 +++++++++
 t/ruby/testox.rb | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
 t/unit-test.t    | 14 ++++++++++
 7 files changed, 130 insertions(+)
 create mode 100644 t/lib/git.c
 create mode 100644 t/lib/git.h
 create mode 100644 t/ruby/git.c
 create mode 100644 t/ruby/testox.rb
 create mode 100644 t/unit-test.t
-- 
2.40.0+fc1
Next: Felipe Contreras
Message 1 of 4 in “test: new testing framework for libification”
  1. 0/3 test: new testing framework for libificationFelipe Contreras, May 2, 2023
  2. 1/3 test: add simple shared libraryFelipe Contreras, May 2, 2023
  3. 2/3 test: add basic unit testing frameworkFelipe Contreras, May 2, 2023
  4. 3/3 test: add basic unit testFelipe Contreras, May 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.