summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-01-16 00:50:35 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-01-16 00:50:35 -0500
commitdc2b3dd7bf19e5cef5f0940f01de2fd48f0850cc (patch)
tree29b960ae0fbdc3ac43f4768e201326f987fc863d /SConstruct
parent102e29d16c3fd9b414eeac53c794302f902ae8da (diff)
downloadgpsd-dc2b3dd7bf19e5cef5f0940f01de2fd48f0850cc.tar.gz
Attempt to set up for coverage testing. Diesn't work yet...
...fails wuth unresolved gcov symbols.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct11
1 files changed, 10 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 0124e850..91069af9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -151,6 +151,7 @@ boolopts = (
("python", True, "build Python support and modules."),
("debug", False, "include debug information in build"),
("profiling", False, "build with profiling enabled"),
+ ("coveraging", False, "build with code coveraging enabled"),
("strip", True, "build with stripping of binaries enabled"),
("chrpath", True, "use chrpath to edit library load paths"),
)
@@ -241,6 +242,10 @@ for key, value in os.environ.iteritems():
if key.startswith('CCC_'):
env.Append(ENV={key:value})
+# FIXME: Set up compilation for gcov - doesn't work yet.
+if env['coveraging']:
+ env['CFLAGS'].append(['-fprofile-arcs', '-ftest-coverage'])
+
# Placeholder so we can kluge together something like VPATH builds.
# $SRCDIR replaces occurrences for $(srcdir) in the autotools build.
env['SRCDIR'] = '.'
@@ -902,6 +907,10 @@ gpsmon_sources = [
if not env['shared'] or not env["implicit_link"]:
env.MergeFlags("-lm")
+# FIXME: Part of an attempt to support coverage testing.
+if env['coveraging']:
+ env.MergeFlags("-lgcov")
+
gpsd_env = env.Clone()
gpsd_env.MergeFlags("-pthread")
@@ -1173,7 +1182,7 @@ if manbuilder:
build = env.Alias('build', [libraries, binaries, python_built_extensions, "gpsd.php", manpage_targets])
env.Clean(build,
- map(glob.glob,("*.[oa]", "*.os", "*.os.*", "*.pyc", "gps/*.pyc")) + \
+ map(glob.glob,("*.[oa]", "*.os", "*.os.*", "*.gcno", "*.pyc", "gps/*.pyc")) + \
generated_sources + \
map(lambda f: f[:-3], templated) + \
[".sconf_temp"])