From 4544fd33926826e9ca6a24b975f7ce680ff061a5 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 1 Oct 2014 17:52:18 +0000 Subject: [PATCH] [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. --- test/SConscript | 7 +++++++ test_problems/SConscript | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/test/SConscript b/test/SConscript index 8bda81f3d..49c5a719d 100644 --- a/test/SConscript +++ b/test/SConscript @@ -10,6 +10,13 @@ localenv.Prepend(CPPPATH=['#ext/gtest/include', '#include'], localenv.Append(LIBS=['gtest'] + localenv['cantera_libs'], 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 PASSED_FILES = {} diff --git a/test_problems/SConscript b/test_problems/SConscript index 91fc58856..95134699a 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -5,6 +5,13 @@ localenv = env.Clone() localenv.Prepend(CPPPATH=['#include', '#src', 'shared']) 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'): localenv['ENV']['PYTHONPATH'] = localenv['pythonpath_build2'] localenv['ENV']['PYTHON_CMD'] = localenv.subst('$python_cmd')