aboutsummaryrefslogtreecommitdiffstats
path: root/scons/SConscript
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-17 21:06:27 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-17 21:06:27 +0000
commit532dc2de35f2cef191bc91c3587a9f8f4974756f (patch)
tree1dd721d45ddd731134dda23f8368781979dc0b09 /scons/SConscript
parent210ea10e7ad6e27342c7d9a46c2844a9bcbad396 (diff)
downloadgoogletest-532dc2de35f2cef191bc91c3587a9f8f4974756f.tar.gz
googletest-532dc2de35f2cef191bc91c3587a9f8f4974756f.tar.bz2
googletest-532dc2de35f2cef191bc91c3587a9f8f4974756f.zip
Implements a subset of TR1 tuple needed by gtest and gmock (by Zhanyong Wan); cleaned up the Python tests (by Vlad Losev); made run_tests.py invokable from any directory (by Vlad Losev).
Diffstat (limited to 'scons/SConscript')
-rw-r--r--scons/SConscript39
1 files changed, 39 insertions, 0 deletions
diff --git a/scons/SConscript b/scons/SConscript
index c409dcb2..0d384996 100644
--- a/scons/SConscript
+++ b/scons/SConscript
@@ -125,6 +125,11 @@ if env_with_exceptions['PLATFORM'] == 'win32':
cppdefines = env_with_exceptions['CPPDEFINES']
if '_TYPEINFO_' in cppdefines:
cppdefines.remove('_TYPEINFO_')
+else:
+ env_with_exceptions.Append(CCFLAGS='-fexceptions')
+ ccflags = env_with_exceptions['CCFLAGS']
+ if '-fno-exceptions' in ccflags:
+ ccflags.remove('-fno-exceptions')
env_without_rtti = env.Clone()
if env_without_rtti['PLATFORM'] == 'win32':
@@ -133,6 +138,9 @@ else:
env_without_rtti.Append(CCFLAGS = ['-fno-rtti'])
env_without_rtti.Append(CPPDEFINES = 'GTEST_HAS_RTTI=0')
+env_use_own_tuple = env.Clone()
+env_use_own_tuple.Append(CPPDEFINES = 'GTEST_USE_OWN_TR1_TUPLE=1')
+
gtest_ex_obj = env_with_exceptions.Object(target='gtest_ex',
source=gtest_source)
gtest_main_ex_obj = env_with_exceptions.Object(target='gtest_main_ex',
@@ -258,6 +266,37 @@ GtestBinary(env_without_rtti,
gtest_all_no_rtti_obj +
gtest_main_no_rtti_obj)
+# Builds a test for gtest's own TR1 tuple implementation.
+gtest_all_use_own_tuple_obj = env_use_own_tuple.Object(
+ target='gtest_all_use_own_tuple',
+ source='../src/gtest-all.cc')
+gtest_main_use_own_tuple_obj = env_use_own_tuple.Object(
+ target='gtest_main_use_own_tuple',
+ source='../src/gtest_main.cc')
+GtestBinary(env_use_own_tuple,
+ 'gtest-tuple_test',
+ [],
+ ['../test/gtest-tuple_test.cc',
+ gtest_all_use_own_tuple_obj,
+ gtest_main_use_own_tuple_obj])
+
+# Builds a test for gtest features that use tuple.
+gtest_param_test_test_use_own_tuple_obj = env_use_own_tuple.Object(
+ target='gtest_param_test_test_use_own_tuple',
+ source='../test/gtest-param-test_test.cc')
+gtest_param_test2_test_use_own_tuple_obj = env_use_own_tuple.Object(
+ target='gtest_param_test2_test_use_own_tuple',
+ source='../test/gtest-param-test2_test.cc')
+GtestBinary(env_use_own_tuple,
+ 'gtest_use_own_tuple_test',
+ [],
+ gtest_param_test_test_use_own_tuple_obj +
+ gtest_param_test2_test_use_own_tuple_obj +
+ gtest_all_use_own_tuple_obj)
+
+# TODO(wan@google.com): simplify the definition of build targets that
+# use alternative environments.
+
# We need to disable some optimization flags for some tests on
# Windows; otherwise the redirection of stdout does not work
# (apparently because of a compiler bug).