[Libguestfs] [nbdkit PATCH] RFC tests: Avoid odd test behavior under NDEBUG

Eric Blake eblake at redhat.com
Tue Jul 7 20:54:26 UTC 2020


On 7/7/20 11:27 AM, Richard W.M. Jones wrote:
> On Tue, Jul 07, 2020 at 09:51:53AM -0500, Eric Blake wrote:
>> While we support compilation with CFLAGS=-DNDEBUG for the brave user
>> desiring to avoid assertion overhead, this causes the tests to be less
>> powerful.  Fortunately, a quick test of './configure CFLAGS=-DNDEBUG'
>> didn't hit any test failures, but it seems better to just ensure that
>> assertions always work in our tests, even if they are turned off for
>> the main binary.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>
>> I don't know if I like this one.  Since 'make check' passed in a build
>> with CFLAGS=-DNDEBUG, I'm not sure we need it.
> 
> I think we actually do need it.  The tests "fail open" if someone
> compiles with -DNDEBUG so we should ensure that something is being
> tested even under these conditions.
> 
> ACK

Okay, I'll push it, then.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list