Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH 0/7] unittests: add CUnit based unittests
@ 2018-10-26 16:35 Tomohiro Kusumi
  2018-10-26 16:27 ` Jens Axboe
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Tomohiro Kusumi @ 2018-10-26 16:35 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

This series of patches introduce CUnit based unittests,
plus fix bugs found in the test cases.

CUnit is C version of *unit framework to help write test cases.
https://sourceforge.net/projects/cunit/

Having builtin unittest functionality for newly added code
as well as exsiting code if possible helps prevent regression.

Most of the code under lib/ and oslib/ (and os/) work as stand
alone *.o files or inline functions with no dependencies on fio
itself, so these are relatively easy to write unittests.

Summary of patches
1/7: Add basic CUnit framework
2/7: Add unittest suite for lib/memalign.c as an example
3/7: Add unittest suite for lib/strntol.c as an example
4/7: Add unittest suite for oslib/strlcat.c as an example
5/7: Add unittest suite for oslib/strndup.c as an example
6/7: Fix lib/strntol.c which caused test failure in patch 3/7
7/7: Fix oslib/strlcat.c which caused test failure in patch 4/7

Tomohiro Kusumi (7):
  unittests: add CUnit based unittest framework
  unittests: add unittest suite for lib/memalign.c
  unittests: add unittest suite for lib/strntol.c
  unittests: add unittest suite for oslib/strlcat.c
  unittests: add unittest suite for oslib/strndup.c
  lib: fix strntol's end pointer when str has leading spaces
  oslib: fix strlcat's incorrect copying

 .gitignore                |    1 +
 Makefile                  |   26 +++++++++++++++-
 configure                 |   26 ++++++++++++++++
 lib/strntol.c             |    2 +-
 oslib/strlcat.c           |   69 +++++++++++++++++++++++++++++++------------
 oslib/strlcat.h           |    2 +-
 unittests/lib/memalign.c  |   27 +++++++++++++++++
 unittests/lib/strntol.c   |   59 +++++++++++++++++++++++++++++++++++++
 unittests/oslib/strlcat.c |   52 +++++++++++++++++++++++++++++++++
 unittests/oslib/strndup.c |   63 +++++++++++++++++++++++++++++++++++++++
 unittests/unittest.c      |   71 +++++++++++++++++++++++++++++++++++++++++++++
 unittests/unittest.h      |   26 ++++++++++++++++
 12 files changed, 400 insertions(+), 24 deletions(-)
 create mode 100644 unittests/lib/memalign.c
 create mode 100644 unittests/lib/strntol.c
 create mode 100644 unittests/oslib/strlcat.c
 create mode 100644 unittests/oslib/strndup.c
 create mode 100644 unittests/unittest.c
 create mode 100644 unittests/unittest.h



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-10-27  0:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-26 16:35 [PATCH 0/7] unittests: add CUnit based unittests Tomohiro Kusumi
2018-10-26 16:27 ` Jens Axboe
2018-10-26 16:35 ` [PATCH 1/7] unittests: add CUnit based unittest framework Tomohiro Kusumi
2018-10-26 16:35 ` [PATCH 2/7] unittests: add unittest suite for lib/memalign.c Tomohiro Kusumi
2018-10-26 16:35 ` [PATCH 3/7] unittests: add unittest suite for lib/strntol.c Tomohiro Kusumi
2018-10-26 16:35 ` [PATCH 4/7] unittests: add unittest suite for oslib/strlcat.c Tomohiro Kusumi
2018-10-26 16:35 ` [PATCH 5/7] unittests: add unittest suite for oslib/strndup.c Tomohiro Kusumi
2018-10-26 16:35 ` [PATCH 6/7] lib: fix strntol's end pointer when str has leading spaces Tomohiro Kusumi
2018-10-26 16:35 ` [PATCH 7/7] oslib: fix strlcat's incorrect copying Tomohiro Kusumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox