1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

wscript: mv --enable-coverage option to global

We want to enable gcov for all tasks, move it to global wscript.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joe Guo 2019-04-30 17:21:15 +12:00 committed by Andrew Bartlett
parent b78048524d
commit 21475e9556
2 changed files with 11 additions and 9 deletions

View File

@ -102,6 +102,10 @@ def options(opt):
gr.add_option('--enable-developer',
help=("Turn on developer warnings and debugging"),
action="store_true", dest='developer', 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)
def picky_developer_callback(option, opt_str, value, parser):
parser.values.developer = True
parser.values.picky_developer = True
@ -278,6 +282,13 @@ def configure(conf):
except:
conf.env.ABI_CHECK = False
conf.env.enable_coverage = Options.options.enable_coverage
if conf.env.enable_coverage:
conf.ADD_LDFLAGS('-lgcov', testflags=True)
conf.ADD_CFLAGS('--coverage', testflags=True)
# disable abi check for coverage, otherwise ld will fail
conf.env.ABI_CHECK = False
conf.env.GIT_LOCAL_CHANGES = Options.options.GIT_LOCAL_CHANGES
conf.CHECK_UNAME()

View File

@ -20,10 +20,6 @@ def 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=%s)" % DEFAULT_SELFTEST_PREFIX),
@ -97,11 +93,6 @@ def 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')
if Options.options.enable_selftest or Options.options.developer:
conf.DEFINE('ENABLE_SELFTEST', 1)