Unverified Commit 76bce79a authored by Andy Soffer's avatar Andy Soffer Committed by GitHub
Browse files

Merge branch 'main' into fixes_std_pair_diff

parents 6f1c4b3d f345b2ca
......@@ -32,13 +32,14 @@
#include "gtest/gtest-test-part.h"
#include <ostream>
#include <string>
#include "gtest/internal/gtest-port.h"
#include "src/gtest-internal-inl.h"
namespace testing {
using internal::GetUnitTestImpl;
// Gets the summary of the failure message by omitting the stack trace
// in it.
std::string TestPartResult::ExtractSummary(const char* message) {
......
......@@ -29,6 +29,10 @@
#include "gtest/gtest-typed-test.h"
#include <set>
#include <string>
#include <vector>
#include "gtest/gtest.h"
namespace testing {
......@@ -90,7 +94,7 @@ const char* TypedTestSuitePState::VerifyRegisteredTestNames(
}
const std::string& errors_str = errors.GetString();
if (errors_str != "") {
if (!errors_str.empty()) {
fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
errors_str.c_str());
fflush(stderr);
......
This diff is collapsed.
......@@ -31,10 +31,10 @@
#include "gtest/gtest.h"
#if GTEST_OS_ESP8266 || GTEST_OS_ESP32
#if defined(GTEST_OS_ESP8266) || defined(GTEST_OS_ESP32)
// Arduino-like platforms: program entry points are setup/loop instead of main.
#if GTEST_OS_ESP8266
#ifdef GTEST_OS_ESP8266
extern "C" {
#endif
......@@ -42,11 +42,11 @@ void setup() { testing::InitGoogleTest(); }
void loop() { RUN_ALL_TESTS(); }
#if GTEST_OS_ESP8266
#ifdef GTEST_OS_ESP8266
}
#endif
#elif GTEST_OS_QURT
#elif defined(GTEST_OS_QURT)
// QuRT: program entry point is main, but argc/argv are unusable.
GTEST_API_ int main() {
......
......@@ -39,7 +39,7 @@
#include "gtest/gtest.h"
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
#include <stdlib.h>
#include <windows.h>
#endif
......@@ -49,7 +49,7 @@ namespace {
// A test that's expected to fail.
TEST(Foo, Bar) { EXPECT_EQ(2, 3); }
#if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
#if GTEST_HAS_SEH && !defined(GTEST_OS_WINDOWS_MOBILE)
// On Windows Mobile global exception handlers are not supported.
LONG WINAPI
ExitWithExceptionCode(struct _EXCEPTION_POINTERS* exception_pointers) {
......@@ -60,12 +60,12 @@ ExitWithExceptionCode(struct _EXCEPTION_POINTERS* exception_pointers) {
} // namespace
int main(int argc, char** argv) {
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
// Suppresses display of the Windows error dialog upon encountering
// a general protection fault (segment violation).
SetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS);
#if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
#if GTEST_HAS_SEH && !defined(GTEST_OS_WINDOWS_MOBILE)
// The default unhandled exception filter does not always exit
// with the exception code as exit code - for example it exits with
......
......@@ -37,9 +37,9 @@
using testing::internal::AlwaysFalse;
using testing::internal::AlwaysTrue;
#if GTEST_HAS_DEATH_TEST
#ifdef GTEST_HAS_DEATH_TEST
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
#include <direct.h> // For chdir().
#include <fcntl.h> // For O_BINARY
#include <io.h>
......@@ -52,7 +52,10 @@ using testing::internal::AlwaysTrue;
#include <signal.h>
#include <stdio.h>
#if GTEST_OS_LINUX
#include <string>
#include <vector>
#ifdef GTEST_OS_LINUX
#include <sys/time.h>
#endif // GTEST_OS_LINUX
......@@ -200,7 +203,7 @@ int DieInDebugElse12(int* sideeffect) {
return 12;
}
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
// Death in dbg due to Windows CRT assertion failure, not opt.
int DieInCRTDebugElse12(int* sideeffect) {
......@@ -220,7 +223,7 @@ int DieInCRTDebugElse12(int* sideeffect) {
#endif // GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
#if defined(GTEST_OS_WINDOWS) || defined(GTEST_OS_FUCHSIA)
// Tests the ExitedWithCode predicate.
TEST(ExitStatusPredicateTest, ExitedWithCode) {
......@@ -374,7 +377,7 @@ TEST_F(TestForDeathTest, FastDeathTestInChangedDir) {
ASSERT_DEATH(_exit(1), "");
}
#if GTEST_OS_LINUX
#ifdef GTEST_OS_LINUX
void SigprofAction(int, siginfo_t*, void*) { /* no op */
}
......@@ -641,7 +644,7 @@ TEST_F(TestForDeathTest, TestExpectDebugDeath) {
#endif
}
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
// https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode
// In debug mode, the calls to _CrtSetReportMode and _CrtSetReportFile enable
......@@ -693,7 +696,7 @@ void ExpectDebugDeathHelper(bool* aborted) {
*aborted = false;
}
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
TEST(PopUpDeathTest, DoesNotShowPopUpOnAbort) {
printf(
"This test should be considered failing if it shows "
......@@ -805,14 +808,14 @@ static void TestExitMacros() {
EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
ASSERT_EXIT(_exit(42), testing::ExitedWithCode(42), "");
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
// Of all signals effects on the process exit code, only those of SIGABRT
// are documented on Windows.
// See https://msdn.microsoft.com/en-us/query-bi/m/dwwzkt4c.
EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
#elif !GTEST_OS_FUCHSIA
#elif !defined(GTEST_OS_FUCHSIA)
// Fuchsia has no unix signals.
EXPECT_EXIT(raise(SIGKILL), testing::KilledBySignal(SIGKILL), "") << "foo";
......@@ -1177,7 +1180,7 @@ TEST(GetLastErrnoDescription, GetLastErrnoDescriptionWorks) {
EXPECT_STREQ("", GetLastErrnoDescription().c_str());
}
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
TEST(AutoHandleTest, AutoHandleWorks) {
HANDLE handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
ASSERT_NE(INVALID_HANDLE_VALUE, handle);
......@@ -1204,7 +1207,7 @@ TEST(AutoHandleTest, AutoHandleWorks) {
}
#endif // GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
typedef unsigned __int64 BiggestParsable;
typedef signed __int64 BiggestSignedParsable;
#else
......@@ -1301,7 +1304,7 @@ TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
EXPECT_EQ(123, char_result);
}
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
TEST(EnvironmentTest, HandleFitsIntoSizeT) {
ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
}
......@@ -1353,7 +1356,7 @@ void DieWithMessage(const char* message) {
TEST(MatcherDeathTest, DoesNotBreakBareRegexMatching) {
// googletest tests this, of course; here we ensure that including googlemock
// has not broken it.
#if GTEST_USES_POSIX_RE
#ifdef GTEST_USES_POSIX_RE
EXPECT_DEATH(DieWithMessage("O, I die, Horatio."), "I d[aeiou]e");
#else
EXPECT_DEATH(DieWithMessage("O, I die, Horatio."), "I di?e");
......
......@@ -33,7 +33,7 @@
#include "gtest/gtest-death-test.h"
#include "gtest/gtest.h"
#if GTEST_HAS_DEATH_TEST
#ifdef GTEST_HAS_DEATH_TEST
#if GTEST_HAS_SEH
#include <windows.h> // For RaiseException().
......
......@@ -41,9 +41,9 @@
#include "gtest/internal/gtest-filepath.h"
#include "src/gtest-internal-inl.h"
#if GTEST_OS_WINDOWS_MOBILE
#ifdef GTEST_OS_WINDOWS_MOBILE
#include <windows.h> // NOLINT
#elif GTEST_OS_WINDOWS
#elif defined(GTEST_OS_WINDOWS)
#include <direct.h> // NOLINT
#endif // GTEST_OS_WINDOWS_MOBILE
......@@ -51,7 +51,7 @@ namespace testing {
namespace internal {
namespace {
#if GTEST_OS_WINDOWS_MOBILE
#ifdef GTEST_OS_WINDOWS_MOBILE
// Windows CE doesn't have the remove C function.
int remove(const char* path) {
......@@ -80,7 +80,7 @@ TEST(GetCurrentDirTest, ReturnsCurrentDir) {
const FilePath cwd = FilePath::GetCurrentDir();
posix::ChDir(original_dir.c_str());
#if GTEST_OS_WINDOWS || GTEST_OS_OS2
#if defined(GTEST_OS_WINDOWS) || defined(GTEST_OS_OS2)
// Skips the ":".
const char* const cwd_without_drive = strchr(cwd.c_str(), ':');
......@@ -174,7 +174,7 @@ TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileNameForAlternateSeparator) {
// RemoveFileName "" -> "./"
TEST(RemoveFileNameTest, EmptyName) {
#if GTEST_OS_WINDOWS_MOBILE
#ifdef GTEST_OS_WINDOWS_MOBILE
// On Windows CE, we use the root as the current directory.
EXPECT_EQ(GTEST_PATH_SEP_, FilePath("").RemoveFileName().string());
#else
......@@ -357,7 +357,7 @@ TEST(RemoveTrailingPathSeparatorTest, ShouldReturnUnmodified) {
}
TEST(DirectoryTest, RootDirectoryExists) {
#if GTEST_OS_WINDOWS // We are on Windows.
#ifdef GTEST_OS_WINDOWS // We are on Windows.
char current_drive[_MAX_PATH]; // NOLINT
current_drive[0] = static_cast<char>(_getdrive() + 'A' - 1);
current_drive[1] = ':';
......@@ -369,7 +369,7 @@ TEST(DirectoryTest, RootDirectoryExists) {
#endif // GTEST_OS_WINDOWS
}
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
TEST(DirectoryTest, RootOfWrongDriveDoesNotExists) {
const int saved_drive_ = _getdrive();
// Find a drive that doesn't exist. Start with 'Z' to avoid common ones.
......@@ -387,7 +387,7 @@ TEST(DirectoryTest, RootOfWrongDriveDoesNotExists) {
}
#endif // GTEST_OS_WINDOWS
#if !GTEST_OS_WINDOWS_MOBILE
#ifndef GTEST_OS_WINDOWS_MOBILE
// Windows CE _does_ consider an empty directory to exist.
TEST(DirectoryTest, EmptyPathDirectoryDoesNotExist) {
EXPECT_FALSE(FilePath("").DirectoryExists());
......@@ -395,7 +395,7 @@ TEST(DirectoryTest, EmptyPathDirectoryDoesNotExist) {
#endif // !GTEST_OS_WINDOWS_MOBILE
TEST(DirectoryTest, CurrentDirectoryExists) {
#if GTEST_OS_WINDOWS // We are on Windows.
#ifdef GTEST_OS_WINDOWS // We are on Windows.
#ifndef _WIN32_CE // Windows CE doesn't have a current directory.
EXPECT_TRUE(FilePath(".").DirectoryExists());
......@@ -423,7 +423,7 @@ TEST(NormalizeTest, MultipleConsecutiveSeparatorsInMidstring) {
// "/bar" == //bar" == "///bar"
TEST(NormalizeTest, MultipleConsecutiveSeparatorsAtStringStart) {
EXPECT_EQ(GTEST_PATH_SEP_ "bar", FilePath(GTEST_PATH_SEP_ "bar").string());
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
EXPECT_EQ(GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar",
FilePath(GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").string());
#else
......@@ -515,7 +515,7 @@ class DirectoryCreationTest : public Test {
}
// Strings representing a directory and a file, with identical paths
// except for the trailing separator character that distinquishes
// except for the trailing separator character that distinguishes
// a directory named 'test' from a file named 'test'. Example names:
FilePath testdata_path_; // "/tmp/directory_creation/test/"
FilePath testdata_file_; // "/tmp/directory_creation/test"
......@@ -620,7 +620,7 @@ TEST(FilePathTest, IsDirectory) {
TEST(FilePathTest, IsAbsolutePath) {
EXPECT_FALSE(FilePath("is" GTEST_PATH_SEP_ "relative").IsAbsolutePath());
EXPECT_FALSE(FilePath("").IsAbsolutePath());
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
EXPECT_TRUE(
FilePath("c:\\" GTEST_PATH_SEP_ "is_not" GTEST_PATH_SEP_ "relative")
.IsAbsolutePath());
......@@ -638,7 +638,7 @@ TEST(FilePathTest, IsAbsolutePath) {
}
TEST(FilePathTest, IsRootDirectory) {
#if GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
EXPECT_TRUE(FilePath("a:\\").IsRootDirectory());
EXPECT_TRUE(FilePath("Z:/").IsRootDirectory());
EXPECT_TRUE(FilePath("e://").IsRootDirectory());
......
......@@ -88,20 +88,20 @@ EXPECTED_2 = {
'time': '*',
'timestamp': '*',
'testsuite': [{
'name': 'TestInt64Properties',
'name': 'TestInt64ConvertibleProperties',
'file': 'gtest_xml_outfile2_test_.cc',
'line': 41,
'line': 43,
'status': 'RUN',
'result': 'COMPLETED',
'timestamp': '*',
'time': '*',
'classname': 'PropertyTwo',
'SetUpProp': '2',
'TestFloatProperty': '3',
'TestDoubleProperty': '4',
'TestFloatProperty': '3.25',
'TestDoubleProperty': '4.75',
'TestSizetProperty': '5',
'TestBoolProperty': '1',
'TestCharProperty': '65',
'TestBoolProperty': 'true',
'TestCharProperty': 'A',
'TestInt16Property': '6',
'TestInt32Property': '7',
'TestInt64Property': '8',
......
......@@ -54,7 +54,7 @@ SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
if SUPPORTS_STACK_TRACES:
STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
else:
STACK_TRACE_TEMPLATE = ''
STACK_TRACE_TEMPLATE = '\n'
EXPECTED_NON_EMPTY = {
'tests': 26,
......@@ -77,7 +77,7 @@ EXPECTED_NON_EMPTY = {
'testsuite': [{
'name': 'Succeeds',
'file': 'gtest_xml_output_unittest_.cc',
'line': 51,
'line': 53,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -96,7 +96,7 @@ EXPECTED_NON_EMPTY = {
'testsuite': [{
'name': 'Fails',
'file': 'gtest_xml_output_unittest_.cc',
'line': 59,
'line': 61,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -124,7 +124,7 @@ EXPECTED_NON_EMPTY = {
'testsuite': [{
'name': 'DISABLED_test_not_run',
'file': 'gtest_xml_output_unittest_.cc',
'line': 66,
'line': 68,
'status': 'NOTRUN',
'result': 'SUPPRESSED',
'time': '*',
......@@ -144,7 +144,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'Skipped',
'file': 'gtest_xml_output_unittest_.cc',
'line': 73,
'line': 75,
'status': 'RUN',
'result': 'SKIPPED',
'time': '*',
......@@ -154,7 +154,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'SkippedWithMessage',
'file': 'gtest_xml_output_unittest_.cc',
'line': 77,
'line': 79,
'status': 'RUN',
'result': 'SKIPPED',
'time': '*',
......@@ -164,7 +164,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'SkippedAfterFailure',
'file': 'gtest_xml_output_unittest_.cc',
'line': 81,
'line': 83,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -194,7 +194,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'Succeeds',
'file': 'gtest_xml_output_unittest_.cc',
'line': 86,
'line': 88,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -204,7 +204,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'Fails',
'file': 'gtest_xml_output_unittest_.cc',
'line': 91,
'line': 93,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -234,7 +234,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'DISABLED_test',
'file': 'gtest_xml_output_unittest_.cc',
'line': 96,
'line': 98,
'status': 'NOTRUN',
'result': 'SUPPRESSED',
'time': '*',
......@@ -254,7 +254,7 @@ EXPECTED_NON_EMPTY = {
'testsuite': [{
'name': 'OutputsCData',
'file': 'gtest_xml_output_unittest_.cc',
'line': 100,
'line': 102,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -282,7 +282,7 @@ EXPECTED_NON_EMPTY = {
'testsuite': [{
'name': 'InvalidCharactersInMessage',
'file': 'gtest_xml_output_unittest_.cc',
'line': 107,
'line': 109,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -313,7 +313,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'OneProperty',
'file': 'gtest_xml_output_unittest_.cc',
'line': 119,
'line': 121,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -324,7 +324,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'IntValuedProperty',
'file': 'gtest_xml_output_unittest_.cc',
'line': 123,
'line': 125,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -335,7 +335,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'ThreeProperties',
'file': 'gtest_xml_output_unittest_.cc',
'line': 127,
'line': 129,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -348,7 +348,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'TwoValuesForOneKeyUsesLastValue',
'file': 'gtest_xml_output_unittest_.cc',
'line': 133,
'line': 135,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -370,7 +370,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'RecordProperty',
'file': 'gtest_xml_output_unittest_.cc',
'line': 138,
'line': 140,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -381,7 +381,7 @@ EXPECTED_NON_EMPTY = {
{
'name': 'ExternalUtilityThatCallsRecordIntValuedProperty',
'file': 'gtest_xml_output_unittest_.cc',
'line': 151,
'line': 153,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -394,7 +394,7 @@ EXPECTED_NON_EMPTY = {
'ExternalUtilityThatCallsRecordStringValuedProperty'
),
'file': 'gtest_xml_output_unittest_.cc',
'line': 155,
'line': 157,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -416,7 +416,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'int',
'file': 'gtest_xml_output_unittest_.cc',
'line': 171,
'line': 173,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -436,7 +436,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'long',
'file': 'gtest_xml_output_unittest_.cc',
'line': 171,
'line': 173,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -456,7 +456,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'int',
'file': 'gtest_xml_output_unittest_.cc',
'line': 178,
'line': 180,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -476,7 +476,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasTypeParamAttribute',
'type_param': 'long',
'file': 'gtest_xml_output_unittest_.cc',
'line': 178,
'line': 180,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -497,7 +497,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasValueParamAttribute/0',
'value_param': '33',
'file': 'gtest_xml_output_unittest_.cc',
'line': 162,
'line': 164,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -508,7 +508,7 @@ EXPECTED_NON_EMPTY = {
'name': 'HasValueParamAttribute/1',
'value_param': '42',
'file': 'gtest_xml_output_unittest_.cc',
'line': 162,
'line': 164,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -519,7 +519,7 @@ EXPECTED_NON_EMPTY = {
'name': 'AnotherTestThatHasValueParamAttribute/0',
'value_param': '33',
'file': 'gtest_xml_output_unittest_.cc',
'line': 163,
'line': 165,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -530,7 +530,7 @@ EXPECTED_NON_EMPTY = {
'name': 'AnotherTestThatHasValueParamAttribute/1',
'value_param': '42',
'file': 'gtest_xml_output_unittest_.cc',
'line': 163,
'line': 165,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......@@ -562,7 +562,7 @@ EXPECTED_FILTERED = {
'testsuite': [{
'name': 'Succeeds',
'file': 'gtest_xml_output_unittest_.cc',
'line': 51,
'line': 53,
'status': 'RUN',
'result': 'COMPLETED',
'time': '*',
......
......@@ -36,6 +36,9 @@
// This program will be invoked from a Python unit test.
// Don't run it directly.
#include <ostream>
#include <string>
#include "gtest/gtest.h"
// Several different test cases and tests that will be listed.
......
......@@ -32,19 +32,14 @@
// This file verifies Google Test event listeners receive events at the
// right times.
#include <string>
#include <vector>
#include "gtest/gtest.h"
#include "gtest/internal/custom/gtest.h"
using ::testing::AddGlobalTestEnvironment;
using ::testing::Environment;
using ::testing::InitGoogleTest;
using ::testing::Test;
using ::testing::TestEventListener;
using ::testing::TestInfo;
using ::testing::TestPartResult;
using ::testing::TestSuite;
using ::testing::UnitTest;
// Used by tests to register their events.
......@@ -278,7 +273,7 @@ int main(int argc, char** argv) {
AddGlobalTestEnvironment(new EnvironmentInvocationCatcher);
GTEST_CHECK_(events.size() == 0)
GTEST_CHECK_(events.empty())
<< "AddGlobalTestEnvironment should not generate any events itself.";
GTEST_FLAG_SET(repeat, 2);
......
This diff is collapsed.
......@@ -132,7 +132,7 @@ def RemoveStackTraces(output):
"""Removes all traces of stack traces from a Google Test program's output."""
# *? means "find the shortest string that matches".
return re.sub(r'Stack trace:(.|\n)*?\n\n', '', output)
return re.sub(r'Stack trace:(.|\n)*?\n', '', output)
def RemoveTime(output):
......
This diff is collapsed.
......@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string>
#include "gtest/gtest.h"
namespace {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment