ldb cmocka tests

Andreas Schneider asn at samba.org
Fri Apr 7 09:51:54 UTC 2017


On Friday, 7 April 2017 11:42:20 CEST Andrew Bartlett wrote:
> On Fri, 2017-04-07 at 11:01 +0200, Andreas Schneider wrote:
> > On Thursday, 6 April 2017 23:39:44 CEST Andrew Bartlett wrote:
> > > On Thu, 2017-04-06 at 17:04 +1200, Andrew Bartlett via samba-
> > > technical
> > > 
> > > wrote:
> > > > I thought I was using that, I tried to install a copy from
> > > > source. 
> > > > 
> > > > As correct cmocka versions are not yet widely installed in
> > > > distributions, would it make sense to put it in third_party?  It
> > > > would
> > > > be very helpful if the right version was in the tree to test
> > > > with.  
> > > > 
> > > > I don't like us having to bundle a lot of software, but if we
> > > > want to
> > > > write tests in a framework, we should have the framework in our
> > > > tree
> > > > or
> > > > available on all of current debian/ubuntu LTS/fedora.
> > > 
> > > I had tried to install cmokca from Debian Unstable, but that isn't
> > > recent enough.  However that was enough to break the test, as it
> > > doesn't link strongly against the version in /usr/local/lib.  I had
> > > to
> > > use LD_LIBRARY_PATH to override it.
> > 
> > This sounds like a waf issue, or you need to point pkg-config to the
> > right 
> > location to find the newer version first.
> 
> I think it is just standard linker rules, as both are 'system' paths.
> However I notice that cmocka uses -L but not -rpath:
> 
> Name: cmocka
> Description: The cmocka unit testing library
> Version: 1.1.0
> Libs: -L/usr/local/lib -lcmocka
> Cflags: -I/usr/local/include
> 
> Particularly for non-system paths, you might want to look at this for
> what we do for ndr.pc when installed in a custom prefix:
> 
> prefix=/data/samba/samba4/prefix
> exec_prefix=${prefix}
> libdir=${prefix}/lib
> includedir=${prefix}/include
> 
> Name: ndr
> Description: Network Data Representation Core Library
> Requires: samba-util talloc
> Version: 0.0.8
> Libs: -Wl,-rpath,/data/samba/samba4/prefix/lib -L${libdir} -lndr
> Cflags: -I${includedir}  -DHAVE_IMMEDIATE_STRUCTURES=1 -D_GNU_SOURCE=1
> 
> I hope this helps.
> 
> > Bundling will work for the cmocka tests we have in testsuite/unittest
> > but I 
> > don't think it will work for a ldb build!
> 
> I'm not quite sure what you mean, how would it be any different to tdb?

I will look into adding it to third_party.

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list