libcli/dns/cmocka-tests waf scripting

David Disseldorp ddiss at samba.org
Sun Aug 20 23:21:47 UTC 2017


Hi Dimitris,

On Sat, 19 Aug 2017 18:26:23 +0300, Dimitris Gravanis via samba-technical wrote:

> In my Samba fork 
> <https://github.com/dimgrav/samba/tree/master/libcli/dns>, in 
> libcli/dns/cmocka-tests/, I've written a wscript to configure and build 
> the unit tests in the directory. The script is attached below.
> 
> Running |wax configure| completes successfully, |wax build| results in 
> this error:
> 
> |AttributeError: 'BuildContext' object has no attribute 'SAMBA_BINARY'|
> 
> The wscript_build in libcli/dns (top level) is:
> 
> |bld.SAMBA_SUBSYSTEM('clidns',||
> ||        source='cli_dns.c',||
> ||        public_deps='LIBTSOCKET tevent-util')|
> 
> Can anyone help me fix the script to properly use SAMBA_BINARY as an 
> object attribute? I looked into testsuites/unittests/ and The Waf Book 
> to figure out Waf scripting for cmocka unit tests, I've also gone 
> through top level wscript and wscript_build scripts, as well as almost 
> every other in Samba, I believe I have understood the recursive building 
> concept well enough, but obviously I lack significant background in Waf 
> and its Samba implementations :).

You're looking in the right places :). You just need to get waf to
recurse to your cmocka-tests directory as part of the top level build
 e.g.
--- a/wscript_build
+++ b/wscript_build
@@ -120,6 +120,7 @@ bld.RECURSE('libcli/lsarpc')
 bld.RECURSE('libcli/drsuapi')
 bld.RECURSE('libcli/echo')
 bld.RECURSE('libcli/dns')
+bld.RECURSE('libcli/dns/cmocka-tests')

Cheers, David



More information about the samba-technical mailing list