now both clang and gcc have coverage without any dumb hacks
This commit is contained in:
parent
d809bbd1a9
commit
4fed9327a4
3 changed files with 9 additions and 7 deletions
|
|
@ -91,7 +91,6 @@ matrix:
|
||||||
language: cpp
|
language: cpp
|
||||||
env: BINDINGS=cpp CC=clang
|
env: BINDINGS=cpp CC=clang
|
||||||
before_install:
|
before_install:
|
||||||
- if [ "$CC" == "clang" ]; then export CC="clang --coverage"; fi
|
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install lcov
|
- sudo apt-get install lcov
|
||||||
- gem install coveralls-lcov
|
- gem install coveralls-lcov
|
||||||
|
|
|
||||||
13
SConstruct
13
SConstruct
|
|
@ -90,14 +90,17 @@ if GetOption("variant") == 'debug':
|
||||||
else:
|
else:
|
||||||
env = opt
|
env = opt
|
||||||
|
|
||||||
|
env["CC"] = os.getenv("CC") or env["CC"]
|
||||||
|
env["CXX"] = os.getenv("CXX") or env["CXX"]
|
||||||
|
|
||||||
if GetOption("coverage"):
|
if GetOption("coverage"):
|
||||||
env.Append(CFLAGS=["--coverage"],
|
env.Append(CFLAGS=["--coverage"],
|
||||||
CXXFLAGS=["--coverage"],
|
CXXFLAGS=["--coverage"],
|
||||||
LDFLAGS=["--coverage"],
|
LDFLAGS=["--coverage"])
|
||||||
LIBS=['gcov'])
|
if env["CC"] == "gcc":
|
||||||
|
env.Append(LIBS=['gcov'])
|
||||||
env["CC"] = os.getenv("CC") or env["CC"]
|
else:
|
||||||
env["CXX"] = os.getenv("CXX") or env["CXX"]
|
env.ParseConfig('llvm-config --ldflags')
|
||||||
|
|
||||||
if os.getenv("CC") == "clang" or env['PLATFORM'] == 'darwin':
|
if os.getenv("CC") == "clang" or env['PLATFORM'] == 'darwin':
|
||||||
env.Replace(CC="clang",
|
env.Replace(CC="clang",
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ env.Install("$pkgconfigpath", "../../../libhammer.pc")
|
||||||
testenv = env.Clone()
|
testenv = env.Clone()
|
||||||
testenv.ParseConfig('pkg-config --cflags --libs glib-2.0')
|
testenv.ParseConfig('pkg-config --cflags --libs glib-2.0')
|
||||||
testenv.Append(LIBS=['hammer'], LIBPATH=['.'])
|
testenv.Append(LIBS=['hammer'], LIBPATH=['.'])
|
||||||
ctestexec = testenv.Program('test_suite', ctests + ['test_suite.c'])
|
ctestexec = testenv.Program('test_suite', ctests + ['test_suite.c'], LINKFLAGS="--coverage" if testenv.GetOption("coverage") else None)
|
||||||
ctest = Alias('testc', [ctestexec], "".join(["env LD_LIBRARY_PATH=", os.path.dirname(ctestexec[0].path), " ", ctestexec[0].path]))
|
ctest = Alias('testc', [ctestexec], "".join(["env LD_LIBRARY_PATH=", os.path.dirname(ctestexec[0].path), " ", ctestexec[0].path]))
|
||||||
AlwaysBuild(ctest)
|
AlwaysBuild(ctest)
|
||||||
testruns.append(ctest)
|
testruns.append(ctest)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue