Added coverage support
This commit is contained in:
parent
59c8944ed9
commit
04ba15d9f2
3 changed files with 19 additions and 1 deletions
12
SConstruct
12
SConstruct
|
|
@ -12,6 +12,12 @@ AddOption("--variant",
|
|||
action="store",
|
||||
help="Build variant (debug or opt)")
|
||||
|
||||
AddOption("--coverage",
|
||||
dest="coverage",
|
||||
default=False,
|
||||
action="store_true",
|
||||
help="Build with coverage instrumentation")
|
||||
|
||||
env['BUILDDIR'] = 'build/$VARIANT'
|
||||
|
||||
dbg = env.Clone(VARIANT='debug')
|
||||
|
|
@ -25,6 +31,12 @@ if GetOption("variant") == 'debug':
|
|||
else:
|
||||
env = opt
|
||||
|
||||
if GetOption("coverage"):
|
||||
env.Append(CFLAGS=["-fprofile-arcs", "-ftest-coverage"],
|
||||
CXXFLAGS=["-fprofile-arcs", "-ftest-coverage"],
|
||||
LDFLAGS=["-fprofile-arcs", "-ftest-coverage"],
|
||||
LIBS=['gcov'])
|
||||
|
||||
if os.getenv("CC") == "clang":
|
||||
env.Replace(CC="clang",
|
||||
CXX="clang++")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue