Allow optional collection of code coverage information with gcc
This commit is contained in:
parent
cf80213e6b
commit
4ab232da44
2 changed files with 17 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -25,3 +25,5 @@ config.log
|
|||
.pydevproject
|
||||
.settings
|
||||
Cantera/matlab/build_cantera.m
|
||||
*.gcda
|
||||
*.gcno
|
||||
|
|
|
|||
15
SConstruct
15
SConstruct
|
|
@ -222,6 +222,11 @@ opts.AddVariables(
|
|||
'debug',
|
||||
"""Enable extra printing code to aid in debugging.""",
|
||||
False),
|
||||
BoolVariable(
|
||||
'coverage',
|
||||
"""Enable collection of code coverage information with gcov.
|
||||
Available only when compiling with gcc.""",
|
||||
False),
|
||||
BoolVariable(
|
||||
'with_lattice_solid',
|
||||
"""Include thermodynamic model for lattice solids in the
|
||||
|
|
@ -709,6 +714,16 @@ else:
|
|||
env['CCFLAGS'] = listify(env['cc_flags']) + listify(env['debug_flags'])
|
||||
env['LINKFLAGS'] += listify(defaults.debugLinkFlags)
|
||||
|
||||
if env['coverage']:
|
||||
if env['CC'] == 'gcc':
|
||||
env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage'])
|
||||
env.Append(LINKFLAGS=['-fprofile-arcs', '-ftest-coverage'])
|
||||
# ipdb()
|
||||
|
||||
else:
|
||||
print 'Error: coverage testing is only available with GCC'
|
||||
exit(0)
|
||||
|
||||
# **************************************
|
||||
# *** Set options needed in config.h ***
|
||||
# **************************************
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue