Build test with gtest, correctly
This commit is contained in:
parent
e8a6099158
commit
a5fd16e5b3
2 changed files with 9 additions and 2 deletions
|
@ -83,13 +83,14 @@ charles_lib = env.SConscript(os.path.join(src_dir.path, 'SConscript'),
|
||||||
|
|
||||||
# Build test
|
# Build test
|
||||||
gtest_dir = Dir('#gtest')
|
gtest_dir = Dir('#gtest')
|
||||||
|
gtest_include_dir = Dir('#gtest/include')
|
||||||
gtest = env.SConscript(os.path.join(gtest_dir.path, 'SConscript'),
|
gtest = env.SConscript(os.path.join(gtest_dir.path, 'SConscript'),
|
||||||
exports=['env'],
|
exports=['env'],
|
||||||
variant_dir=os.path.join('build', gtest_dir.path),
|
variant_dir=os.path.join('build', gtest_dir.path),
|
||||||
duplicate=0)
|
duplicate=0)
|
||||||
test_dir = Dir('#test')
|
test_dir = Dir('#test')
|
||||||
env.SConscript(os.path.join(test_dir.path, 'SConscript'),
|
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),
|
variant_dir=os.path.join('build', test_dir.path),
|
||||||
duplicate=0)
|
duplicate=0)
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,16 @@
|
||||||
|
|
||||||
Import('env')
|
Import('env')
|
||||||
Import('gtest')
|
Import('gtest')
|
||||||
|
Import('gtest_include_dir')
|
||||||
Import('charles_lib')
|
Import('charles_lib')
|
||||||
|
|
||||||
files = Split("""
|
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)
|
env.Alias('test', prog)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue