add COVERAGE configure option - only set coverage flags on libmapnik and plugins - refs #3344

This commit is contained in:
Dane Springmeyer 2016-03-03 14:19:12 -08:00
parent fde36984de
commit 833703026d
6 changed files with 23 additions and 7 deletions

View file

@ -81,6 +81,8 @@ clean:
@find ./src/ -name "*.so" -exec rm {} \; @find ./src/ -name "*.so" -exec rm {} \;
@find ./ -name "*.o" -exec rm {} \; @find ./ -name "*.o" -exec rm {} \;
@find ./src/ -name "*.a" -exec rm {} \; @find ./src/ -name "*.a" -exec rm {} \;
@find ./ -name "*.gcda" -exec rm {} \;
@find ./ -name "*.gcno" -exec rm {} \;
distclean: distclean:
if test -e "config.py"; then mv "config.py" "config.py.backup"; fi if test -e "config.py"; then mv "config.py" "config.py.backup"; fi

View file

@ -293,6 +293,7 @@ opts.AddVariables(
EnumVariable('OPTIMIZATION','Set compiler optimization level','3', ['0','1','2','3','4','s']), EnumVariable('OPTIMIZATION','Set compiler optimization level','3', ['0','1','2','3','4','s']),
# Note: setting DEBUG=True will override any custom OPTIMIZATION level # Note: setting DEBUG=True will override any custom OPTIMIZATION level
BoolVariable('DEBUG', 'Compile a debug version of Mapnik', 'False'), BoolVariable('DEBUG', 'Compile a debug version of Mapnik', 'False'),
BoolVariable('COVERAGE', 'Compile a libmapnik and plugins with --coverage', 'False'),
BoolVariable('DEBUG_UNDEFINED', 'Compile a version of Mapnik using clang/llvm undefined behavior asserts', 'False'), BoolVariable('DEBUG_UNDEFINED', 'Compile a version of Mapnik using clang/llvm undefined behavior asserts', 'False'),
BoolVariable('DEBUG_SANITIZE', 'Compile a version of Mapnik using clang/llvm address sanitation', 'False'), BoolVariable('DEBUG_SANITIZE', 'Compile a version of Mapnik using clang/llvm address sanitation', 'False'),
ListVariable('INPUT_PLUGINS','Input drivers to include',DEFAULT_PLUGINS,PLUGINS.keys()), ListVariable('INPUT_PLUGINS','Input drivers to include',DEFAULT_PLUGINS,PLUGINS.keys()),
@ -1139,6 +1140,9 @@ if not preconfigured:
else: else:
mode = 'release mode' mode = 'release mode'
if env['COVERAGE']:
mode += ' (with coverage)'
env['PLATFORM'] = platform.uname()[0] env['PLATFORM'] = platform.uname()[0]
color_print(4,"Configuring on %s in *%s*..." % (env['PLATFORM'],mode)) color_print(4,"Configuring on %s in *%s*..." % (env['PLATFORM'],mode))
@ -1891,6 +1895,10 @@ if not HELP_REQUESTED:
plugin_base = env.Clone() plugin_base = env.Clone()
if env['COVERAGE']:
plugin_base.Append(LINKFLAGS='--coverage')
plugin_base.Append(CXXFLAGS='--coverage')
Export('plugin_base') Export('plugin_base')
if env['FAST']: if env['FAST']:

View file

@ -82,8 +82,7 @@ config_override () {
configure () { configure () {
if enabled ${COVERAGE}; then if enabled ${COVERAGE}; then
./configure "$@" PGSQL2SQLITE=False SVG2PNG=False SVG_RENDERER=False \ ./configure "$@" PGSQL2SQLITE=False SVG2PNG=False SVG_RENDERER=False \
CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' \ COVERAGE=True DEBUG=True
CUSTOM_CFLAGS='--coverage' DEBUG=True
elif enabled ${MASON_PUBLISH}; then elif enabled ${MASON_PUBLISH}; then
export MASON_NAME=mapnik export MASON_NAME=mapnik
export MASON_VERSION=latest export MASON_VERSION=latest
@ -101,9 +100,10 @@ configure () {
coverage () { coverage () {
./mason_packages/.link/bin/cpp-coveralls \ ./mason_packages/.link/bin/cpp-coveralls \
--build-root . --gcov-options '\-lp' --exclude mason_packages \ --build-root . --gcov-options '\-lp' \
--exclude mason_packages \
--exclude .sconf_temp --exclude benchmark --exclude deps \ --exclude .sconf_temp --exclude benchmark --exclude deps \
--exclude scons --exclude test --exclude demo --exclude docs \ --exclude scons --exclude test --exclude demo --exclude docs \
--exclude fonts --exclude utils \ --exclude fonts \
> /dev/null > /dev/null
} }

View file

@ -62,6 +62,10 @@ system = 'boost_system%s' % env['BOOST_APPEND']
lib_env['LIBS'] = [filesystem, lib_env['LIBS'] = [filesystem,
regex] regex]
if env['COVERAGE']:
lib_env.Append(LINKFLAGS='--coverage')
lib_env.Append(CXXFLAGS='--coverage')
if env['HAS_CAIRO']: if env['HAS_CAIRO']:
lib_env.Append(LIBS=env['CAIRO_ALL_LIBS']) lib_env.Append(LIBS=env['CAIRO_ALL_LIBS'])

View file

@ -24,8 +24,9 @@ import glob
from copy import copy from copy import copy
Import ('env') Import ('env')
Import ('plugin_base')
program_env = env.Clone() program_env = plugin_base.Clone()
source = Split( source = Split(
""" """
@ -36,7 +37,6 @@ source = Split(
""" """
) )
#headers = ['#plugins/input/shape'] + env['CPPPATH']
headers = env['CPPPATH'] headers = env['CPPPATH']
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND'] boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']

View file

@ -25,7 +25,9 @@ from copy import copy
Import ('env') Import ('env')
program_env = env.Clone() Import ('plugin_base')
program_env = plugin_base.Clone()
source = Split( source = Split(
""" """