From 88298f97aea570c4a6c976c8fc1a6c2f61a0f2fb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 10 Feb 2012 15:19:05 +1100 Subject: build: Add --enable-coverage option to build with gcov support This allows running lcov over the output. Andrew Bartlett --- selftest/wscript | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'selftest/wscript') 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''' -- cgit