[Libguestfs] [PATCH 06/27] daemon: Add unit tests of the ‘Utils’ module.

Pino Toscano ptoscano at redhat.com
Thu Jul 20 07:48:52 UTC 2017


On Wednesday, 19 July 2017 16:33:39 CEST Richard W.M. Jones wrote:
> On Wed, Jul 19, 2017 at 02:29:33PM +0200, Pino Toscano wrote:
> > On Wednesday, 19 July 2017 14:21:51 CEST Richard W.M. Jones wrote:
> > > On Wed, Jul 19, 2017 at 12:57:08PM +0200, Pino Toscano wrote:
> > > > Would it be possible to use oUnit too?
> > > 
> > > I'm not clear on what benefit oUnit gives us which is worth the extra
> > > dependency it pulls in.
> > 
> > I was referring to OUnit2, which we already have an optional dependency
> > for almost all the OCaml tests.
> 
> Sure, understood.  But what would we lose by converting those to
> simple programs that just ran a series of "assert"s?  If a single
> test fails we have to fix it anyway.

The assert means that you will just get the failure, and you will need
to edit the test just to see what was the actual failure.  Sure, it is
doable, but it adds extra steps to debugging.

> If the lack of oUnit2 means that other users are skipping
> those tests, oUnit2 may be a negative.

I'm not sure I follow this.  We already implemented in the past tests
using OUnit (then converted to OUnit2), which means we sort of agreed
to use a (relatively simple) unit test framework.  Most of the OCaml
tests use it already, so the logic that follows here would be to keep
using it.

If the problem is "this test is already sent for review as series of
assert", then I can volunteer to rewrite it to OUnit2.  Otherwise,
I'd like to know what are the reasons against using something that
already discussed in the past, approved, and established.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170720/2828f55d/attachment.sig>


More information about the Libguestfs mailing list