running only selected tests in samba sources

Michael Tokarev mjt at tls.msk.ru
Mon Aug 1 21:04:52 UTC 2022


01.08.2022 20:21, Jeremy Allison via samba-technical wrote:
> On Mon, Aug 01, 2022 at 05:35:15PM +0300, Michael Tokarev via samba-technical wrote:
>> Hi!
>>
>> Is there a way, after successful build of samba source, to run just selected tests
>> without running whole testsuite, *and* without (re)building everything with the
>> --enable-selftest option?
>>
>> Many tests do not require this option to be enabled. For a very simple example,
>> consider lib/ldb/ tests - when ldb is built from its own separate source
>> tarball, it's easy to run its tests. But when it is built as part of whole samba
>> source, an attempt to run ldb tests - even by providing the right test selection -
>> still fails due to main samba wscript checking if --enable-selftest has been enabled.
>>
>> In Debian we used to build libldb from its own source, and running a testsuite there
>> has been useful. But now we build it from main samba source tree and we can't run
>> the testsuite anymore.
>>
>> Many more other tests can be useful without --enable-selftest too.
>>
>> I'm about to patch wscript to omit checks for --enable-selftest options in wscripts..
> 
> make test TESTS=(wildcard test name)

Thank you for the answer Jeremy.

Nope, this is exactly what I tried before thinking about patching the main wscript.

/build/pkg/samba-4.16.4+dfsg$ make test TESTS=ldb*
PYTHONHASHSEED=1 WAF_MAKE=1  ./buildtools/bin/waf test
'test' finished successfully (0.039s)
Waf: Entering directory `/build/pkg/samba-4.16.4+dfsg/bin/default'
	Selected embedded Heimdal build
Waf: Leaving directory `/build/pkg/samba-4.16.4+dfsg/bin/default'
'build' finished successfully (5.712s)
ERROR: You must use --enable-selftest to enable selftest
make: *** [Makefile:16: test] Error 1

Any value for TEST= causes the main selftest/wscript to be run
which, in turn, verifies that --enable-selftest has been enabled
at configure time.  And this is exactly the place I want to patch
out in order to enable *any* test to be run at all.

Thanks,

/mjt



More information about the samba-technical mailing list