Thread (4 messages) 4 messages, 1 author, 2023-05-02
STALE1177d

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

From: Felipe Contreras <hidden>
Date: 2023-05-02 04:11:20

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/ (local)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help