summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2021-06-03 13:05:46 +0200
committerAndreas Schneider <asn@cryptomilk.org>2021-07-07 05:07:30 +0000
commit5203e70ada0d5727591e80a11f941828a0bbadda (patch)
tree5ed5d66cd20677a4b99b3d23447dc1059fdd7ff7 /lib/tevent
parent740a217264f10c5f3a9ecac8aab8727e45ff885d (diff)
downloadsamba-5203e70ada0d5727591e80a11f941828a0bbadda.tar.gz
tevent: add support for cmocka unit tests
This adds a placeholder for new cmocka tests for tevent. Tests are added in individual commits. Signed-off-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/wscript29
1 files changed, 26 insertions, 3 deletions
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 93af416f583..bc28f7cbb46 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -15,9 +15,12 @@ out = 'bin'
import wafsamba
from wafsamba import samba_dist, samba_utils
-from waflib import Options, Logs, Context
+from waflib import Options, Logs, Context, Errors
-samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools third_party/waf:third_party/waf')
+samba_dist.DIST_DIRS('''lib/tevent:. lib/replace:lib/replace
+ lib/talloc:lib/talloc buildtools:buildtools
+ third_party/cmocka:third_party/cmocka
+ third_party/waf:third_party/waf''')
def options(opt):
opt.BUILTIN_DEFAULT('replace')
@@ -30,6 +33,14 @@ def configure(conf):
conf.RECURSE('lib/replace')
conf.RECURSE('lib/talloc')
+ if conf.CHECK_FOR_THIRD_PARTY():
+ conf.RECURSE('third_party/cmocka')
+ else:
+ if not conf.CHECK_CMOCKA():
+ raise Errors.WafError('cmocka development package have not been found.\nIf third_party is installed, check that it is in the proper place.')
+ else:
+ conf.define('USING_SYSTEM_CMOCKA', 1)
+
conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
if not conf.env.standalone_tevent:
@@ -71,6 +82,9 @@ def build(bld):
bld.RECURSE('lib/replace')
bld.RECURSE('lib/talloc')
+ if bld.CHECK_FOR_THIRD_PARTY():
+ bld.RECURSE('third_party/cmocka')
+
SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
tevent_queue.c tevent_req.c tevent_wrapper.c
tevent_poll.c tevent_threads.c
@@ -130,8 +144,17 @@ def test(ctx):
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
pyret = samba_utils.RUN_PYTHON_TESTS(['bindings.py'])
- sys.exit(pyret)
+ unit_test_ret = 0
+ unit_tests = [
+
+ ]
+
+ for unit_test in unit_tests:
+ unit_test_cmd = os.path.join(Context.g_module.out, unit_test)
+ unit_test_ret = unit_test_ret or samba_utils.RUN_COMMAND(unit_test_cmd)
+
+ sys.exit(pyret or unit_test_ret)
def dist():
'''makes a tarball for distribution'''