diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2017-01-04 23:06:03 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2017-01-04 23:06:03 +0000 |
commit | a977582dead2c6696ff5e273efe84a3878bb6e61 (patch) | |
tree | 819e3b0d9df8ea8814310febaa6188bc3ba23477 /llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h | |
parent | dbf7ca9ce61faee8b21b53d0d414bf1e939bb881 (diff) | |
download | bcm5719-llvm-a977582dead2c6696ff5e273efe84a3878bb6e61.tar.gz bcm5719-llvm-a977582dead2c6696ff5e273efe84a3878bb6e61.zip |
[gtest] Upgrade googletest to version 1.8.0, minimizing local changes.
This required re-working the streaming support and lit's support for
'--gtest_list_tests' but otherwise seems to be a clean upgrade.
Differential Revision: https://reviews.llvm.org/D28154
llvm-svn: 291029
Diffstat (limited to 'llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h')
-rw-r--r-- | llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h index 04c676ce5ff..01b5d5ebc90 100644 --- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h +++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h @@ -79,7 +79,7 @@ class GTEST_API_ DeathTest { static bool Create(const char* statement, const RE* regex, const char* file, int line, DeathTest** test); DeathTest(); - virtual ~DeathTest(); + virtual ~DeathTest() { } // A helper class that aborts a death test when it's deleted. class ReturnSentinel { @@ -127,11 +127,11 @@ class GTEST_API_ DeathTest { // the last death test. static const char* LastMessage(); - static void set_last_death_test_message(const String& message); + static void set_last_death_test_message(const std::string& message); private: // A string containing a description of the outcome of the last death test. - static String last_death_test_message_; + static std::string last_death_test_message_; GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); }; @@ -139,7 +139,7 @@ class GTEST_API_ DeathTest { // Factory interface for death tests. May be mocked out for testing. class DeathTestFactory { public: - virtual ~DeathTestFactory(); + virtual ~DeathTestFactory() { } virtual bool Create(const char* statement, const RE* regex, const char* file, int line, DeathTest** test) = 0; }; @@ -147,8 +147,8 @@ class DeathTestFactory { // A concrete DeathTestFactory implementation for normal use. class DefaultDeathTestFactory : public DeathTestFactory { public: - bool Create(const char *statement, const RE *regex, const char *file, - int line, DeathTest **test) override; + virtual bool Create(const char* statement, const RE* regex, + const char* file, int line, DeathTest** test); }; // Returns true if exit_status describes a process that was terminated @@ -215,12 +215,23 @@ GTEST_API_ bool ExitedUnsuccessfully(int exit_status); // The symbol "fail" here expands to something into which a message // can be streamed. +// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in +// NDEBUG mode. In this case we need the statements to be executed, the regex is +// ignored, and the macro must accept a streamed message even though the message +// is never printed. +# define GTEST_EXECUTE_STATEMENT_(statement, regex) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } else \ + ::testing::Message() + // A class representing the parsed contents of the // --gtest_internal_run_death_test flag, as it existed when // RUN_ALL_TESTS was called. class InternalRunDeathTestFlag { public: - InternalRunDeathTestFlag(const String& a_file, + InternalRunDeathTestFlag(const std::string& a_file, int a_line, int an_index, int a_write_fd) @@ -232,13 +243,13 @@ class InternalRunDeathTestFlag { posix::Close(write_fd_); } - String file() const { return file_; } + const std::string& file() const { return file_; } int line() const { return line_; } int index() const { return index_; } int write_fd() const { return write_fd_; } private: - String file_; + std::string file_; int line_; int index_; int write_fd_; |