From a5fd16e5b3befe38d0885121b6e36dddfd68977d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 13 Sep 2013 11:09:20 -0700 Subject: [PATCH] Build test with gtest, correctly --- SConstruct | 3 ++- test/SConscript | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index bbd5505..53a9caf 100644 --- a/SConstruct +++ b/SConstruct @@ -83,13 +83,14 @@ charles_lib = env.SConscript(os.path.join(src_dir.path, 'SConscript'), # Build test gtest_dir = Dir('#gtest') +gtest_include_dir = Dir('#gtest/include') gtest = env.SConscript(os.path.join(gtest_dir.path, 'SConscript'), exports=['env'], variant_dir=os.path.join('build', gtest_dir.path), duplicate=0) test_dir = Dir('#test') env.SConscript(os.path.join(test_dir.path, 'SConscript'), - exports=['env', 'gtest', 'charles_lib'], + exports=['env', 'gtest', 'gtest_include_dir', 'charles_lib'], variant_dir=os.path.join('build', test_dir.path), duplicate=0) diff --git a/test/SConscript b/test/SConscript index db2c354..beac28b 100644 --- a/test/SConscript +++ b/test/SConscript @@ -7,10 +7,16 @@ Import('env') Import('gtest') +Import('gtest_include_dir') Import('charles_lib') files = Split(""" + test_basics.cc + test_charles.cc """) -prog = env.Program('test_charles', [gtest, charles, files]) +test_env = env.Clone() +test_env.Append(CPPPATH=[gtest_include_dir]) +test_env.Append(CPPDEFINES='GTEST_USE_OWN_TR1_TUPLE') +prog = test_env.Program('test_charles', [gtest, charles_lib, files]) env.Alias('test', prog)