summaryrefslogtreecommitdiff
path: root/selftest/wscript
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-10 15:19:05 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-10 16:45:11 +1100
commit88298f97aea570c4a6c976c8fc1a6c2f61a0f2fb (patch)
treebcc825359e53ced90d947ec1ff9604e8f0a5ef61 /selftest/wscript
parent45e681d416bbb0e23b9884f5697234a69bb7f06e (diff)
downloadsamba-88298f97aea570c4a6c976c8fc1a6c2f61a0f2fb.tar.gz
samba-88298f97aea570c4a6c976c8fc1a6c2f61a0f2fb.tar.bz2
samba-88298f97aea570c4a6c976c8fc1a6c2f61a0f2fb.zip
build: Add --enable-coverage option to build with gcov support
This allows running lcov over the output. Andrew Bartlett
Diffstat (limited to 'selftest/wscript')
-rw-r--r--selftest/wscript7
1 files changed, 7 insertions, 0 deletions
diff --git a/selftest/wscript b/selftest/wscript
index 1bfa9f3d47..ab08c62ce3 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -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'''