mbox series

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

Message ID 20230502041113.103385-1-felipe.contreras@gmail.com (mailing list archive)
Headers show
Series test: new testing framework for libification | expand

Message

Felipe Contreras May 2, 2023, 4:11 a.m. UTC
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