Skip to content
Snippets Groups Projects
Commit 04ba15d9 authored by Dan Hirsch's avatar Dan Hirsch
Browse files

Added coverage support

parent 59c8944e
No related branches found
No related tags found
No related merge requests found
...@@ -17,3 +17,4 @@ TAGS ...@@ -17,3 +17,4 @@ TAGS
docs/milestone2.dot.pdf docs/milestone2.dot.pdf
*.dot.pdf *.dot.pdf
Session.vim Session.vim
*.gcov
...@@ -2,6 +2,11 @@ language: c ...@@ -2,6 +2,11 @@ language: c
compiler: compiler:
- gcc - gcc
- clang - clang
script: scons before_install:
- sudo pip install cpp-coveralls --use-mirrors
script:
- scons --coverage
after_success:
- coveralls
notifications: notifications:
irc: "irc.upstandinghackers.com#hammer" irc: "irc.upstandinghackers.com#hammer"
...@@ -12,6 +12,12 @@ AddOption("--variant", ...@@ -12,6 +12,12 @@ AddOption("--variant",
action="store", action="store",
help="Build variant (debug or opt)") help="Build variant (debug or opt)")
AddOption("--coverage",
dest="coverage",
default=False,
action="store_true",
help="Build with coverage instrumentation")
env['BUILDDIR'] = 'build/$VARIANT' env['BUILDDIR'] = 'build/$VARIANT'
dbg = env.Clone(VARIANT='debug') dbg = env.Clone(VARIANT='debug')
...@@ -25,6 +31,12 @@ if GetOption("variant") == 'debug': ...@@ -25,6 +31,12 @@ if GetOption("variant") == 'debug':
else: else:
env = opt 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": if os.getenv("CC") == "clang":
env.Replace(CC="clang", env.Replace(CC="clang",
CXX="clang++") CXX="clang++")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment