diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-09-04 18:30:25 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-09-04 18:30:25 +0000 |
commit | 16e9dd6e28a8a7fb2d611011e7353e042fcb282f (patch) | |
tree | f990763455e874fb887364bbd9c712386824d20d /test/gtest_xml_output_unittest_.cc | |
parent | 56a2e686e915d483cb22db091140130b23814127 (diff) | |
download | googletest-16e9dd6e28a8a7fb2d611011e7353e042fcb282f.tar.gz googletest-16e9dd6e28a8a7fb2d611011e7353e042fcb282f.tar.bz2 googletest-16e9dd6e28a8a7fb2d611011e7353e042fcb282f.zip |
More implementation of the event listener interface (by Vlad Losev); Reduces the stack space usage of assertions by moving AssertHelper's fields to the heap (by Jorg Brown); Makes String faster, smaller, and simpler (by Zhanyong Wan); Fixes a bug in String::Format() (by Chandler); Adds the /MD version of VC projects to the distribution (by Vlad Losev).
Diffstat (limited to 'test/gtest_xml_output_unittest_.cc')
-rw-r--r-- | test/gtest_xml_output_unittest_.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/gtest_xml_output_unittest_.cc b/test/gtest_xml_output_unittest_.cc index d7ce2c6f..bfeda3d8 100644 --- a/test/gtest_xml_output_unittest_.cc +++ b/test/gtest_xml_output_unittest_.cc @@ -40,6 +40,20 @@ #include <gtest/gtest.h> +// TODO(vladl@google.com): Remove this include when the event listener API is +// published and GetUnitTestImpl is no longer needed. +// +// Indicates that this translation unit is part of Google Test's +// implementation. It must come before gtest-internal-inl.h is +// included, or there will be a compiler error. This trick is to +// prevent a user from accidentally including gtest-internal-inl.h in +// his code. +#define GTEST_IMPLEMENTATION_ 1 +#include "src/gtest-internal-inl.h" +#undef GTEST_IMPLEMENTATION_ + +using ::testing::InitGoogleTest; + class SuccessfulTest : public testing::Test { }; @@ -118,3 +132,17 @@ TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty) { TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) { ExternalUtilityThatCallsRecordProperty("key_for_utility_string", "1"); } + +int main(int argc, char** argv) { + InitGoogleTest(&argc, argv); + + if (argc > 1 && strcmp(argv[1], "--shut_down_xml") == 0) { + // TODO(vladl@google.com): Replace GetUnitTestImpl()->listeners() with + // UnitTest::GetInstance()->listeners() when the event listener API is + // published. + ::testing::internal::EventListeners& listeners = + *::testing::internal::GetUnitTestImpl()->listeners(); + delete listeners.Release(listeners.default_xml_generator()); + } + return RUN_ALL_TESTS(); +} |