From 89406c24102e50a6ee86b378c7bd5aa0a4bf2cd9 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 11 Jan 2013 22:56:52 +0000 Subject: [PATCH] [SCons] Udated coverage testing to include the Cython module Also, exclude the code in the 'test' and 'test_problems' directories from the coverage statistics. --- interfaces/cython/SConscript | 3 +++ platform/posix/coverage.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interfaces/cython/SConscript b/interfaces/cython/SConscript index 71403a4c4..f2cd3054b 100644 --- a/interfaces/cython/SConscript +++ b/interfaces/cython/SConscript @@ -84,6 +84,9 @@ if localenv['OS'] == 'Windows': compilerOpt = ' --compiler=mingw32' else: compilerOpt = '' + if '-fprofile-arcs' in localenv['CCFLAGS']: + localenv['py_extra_compiler_args'] = repr(['-fprofile-arcs', '-ftest-coverage']) + localenv['py_extra_link_args'] = repr(['-fprofile-arcs', '-ftest-coverage']) dataFiles = localenv.RecursiveInstall('#interfaces/cython/cantera/data', '#build/data') diff --git a/platform/posix/coverage.py b/platform/posix/coverage.py index 6e4a2dc2a..3075b2c0f 100755 --- a/platform/posix/coverage.py +++ b/platform/posix/coverage.py @@ -66,8 +66,9 @@ def collect(): # Filter to remove non-Cantera code subprocess.call(['lcov', '-o', 'coverage.info', - '-r', 'coverage-raw.info', - '/usr/include/*', '*/ext/*']) + '-e', 'coverage-raw.info', + os.getcwd() + '/include/*', + os.getcwd() + '/src/*']) os.remove('coverage-raw.info') def genhtml():