[Test] Build tests with optimization disabled

Compiling the tests takes longer than running them, so it actually saves time to
compile the tests with optimizations disabled.
This commit is contained in:
Ray Speth 2014-10-01 17:52:18 +00:00
parent b0085eb58e
commit 4544fd3392
2 changed files with 14 additions and 0 deletions

View file

@ -10,6 +10,13 @@ localenv.Prepend(CPPPATH=['#ext/gtest/include', '#include'],
localenv.Append(LIBS=['gtest'] + localenv['cantera_libs'], localenv.Append(LIBS=['gtest'] + localenv['cantera_libs'],
CCFLAGS=env['warning_flags']) CCFLAGS=env['warning_flags'])
# Turn of optimization to speed up compilation
ccflags = localenv['CCFLAGS']
for optimize_flag in ('-O3', '-O2', '/O2'):
if optimize_flag in ccflags:
ccflags.remove(optimize_flag)
localenv['CCFLAGS'] = ccflags
localenv['ENV']['CANTERA_DATA'] = Dir('#build/data').abspath localenv['ENV']['CANTERA_DATA'] = Dir('#build/data').abspath
PASSED_FILES = {} PASSED_FILES = {}

View file

@ -5,6 +5,13 @@ localenv = env.Clone()
localenv.Prepend(CPPPATH=['#include', '#src', 'shared']) localenv.Prepend(CPPPATH=['#include', '#src', 'shared'])
localenv.Append(CCFLAGS=env['warning_flags']) localenv.Append(CCFLAGS=env['warning_flags'])
# Turn of optimization to speed up compilation
ccflags = localenv['CCFLAGS']
for optimize_flag in ('-O3', '-O2', '/O2'):
if optimize_flag in ccflags:
ccflags.remove(optimize_flag)
localenv['CCFLAGS'] = ccflags
if localenv['python_package'] in ('full', 'minimal'): if localenv['python_package'] in ('full', 'minimal'):
localenv['ENV']['PYTHONPATH'] = localenv['pythonpath_build2'] localenv['ENV']['PYTHONPATH'] = localenv['pythonpath_build2']
localenv['ENV']['PYTHON_CMD'] = localenv.subst('$python_cmd') localenv['ENV']['PYTHON_CMD'] = localenv.subst('$python_cmd')