1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/lib/pthreadpool/wscript_build
Christof Schmitt 8cdb3995ca pthreadpool: Add test for pthread_create failure
This is implemented using cmocka and the __wrap override for
pthread_create.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13170

Signed-off-by: Christof Schmitt <cs@samba.org
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Fri Dec  8 13:54:20 CET 2017 on sn-devel-144
2017-12-08 13:54:20 +01:00

31 lines
1.1 KiB
Python

#!/usr/bin/env python
if bld.env.WITH_PTHREADPOOL:
bld.SAMBA_SUBSYSTEM('PTHREADPOOL',
source='''pthreadpool.c
pthreadpool_pipe.c
pthreadpool_tevent.c
''',
deps='pthread rt replace tevent-util')
else:
bld.SAMBA_SUBSYSTEM('PTHREADPOOL',
source='''pthreadpool_sync.c
pthreadpool_pipe.c
pthreadpool_tevent.c
''',
deps='replace tevent-util')
bld.SAMBA_BINARY('pthreadpooltest',
source='tests.c',
deps='PTHREADPOOL',
enabled=bld.env.WITH_PTHREADPOOL,
install=False)
bld.SAMBA_BINARY('pthreadpooltest_cmocka',
source='tests_cmocka.c',
deps='PTHREADPOOL cmocka',
ldflags='-Wl,--wrap=pthread_create',
enabled=bld.env.WITH_PTHREADPOOL and bld.env['HAVE_LDWRAP'],
install=False)