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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx/

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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux