1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

build: Add --enable-coverage option to build with gcov support

This allows running lcov over the output.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2012-02-10 15:19:05 +11:00
parent 45e681d416
commit 88298f97ae

View File

@ -12,6 +12,9 @@ def set_options(opt):
opt.add_option('--enable-selftest',
help=("enable options necessary for selftest (default=no)"),
action="store_true", dest='enable_selftest', default=False)
opt.add_option('--enable-coverage',
help=("enable options necessary for code coverage reporting on selftest (default=no)"),
action="store_true", dest='enable_coverage', default=False)
opt.add_option('--with-selftest-prefix',
help=("specify location of selftest directory (default=./st)"),
action="store", dest='SELFTEST_PREFIX', default='./st')
@ -69,6 +72,10 @@ def set_options(opt):
def configure(conf):
conf.env.SELFTEST_PREFIX = Options.options.SELFTEST_PREFIX
conf.env.enable_coverage = Options.options.enable_coverage
if conf.env.enable_coverage:
conf.ADD_LDFLAGS('-lgcov', testflags=True)
conf.ADD_CFLAGS('--coverage')
def cmd_testonly(opt):
'''run tests without doing a build first'''