From 532dc2de35f2cef191bc91c3587a9f8f4974756f Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Wed, 17 Jun 2009 21:06:27 +0000 Subject: 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). --- scons/SConscript | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'scons/SConscript') 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). -- cgit v1.2.3