Update gtest to e3f0319d89f4cbf32993de595d984183b1a9fc57

I’m most interested in picking up 1b3eb6ef3462, “Explicitly define copy
constructors used in googletest tests.”

This also reorganizes files and rewrites text to refer to this project
as Google Test and googletest (and Google Mock and googlemock), as it
prefers to be known. Some filenames are left at gtest_* following the
precedent set by gtest itself. For example, #include "gtest/gtest.h" is
still used, so #include "test/gtest_death.h" is retained too.
gtest_all_test OutputFileHelpersTest.GetCurrentExecutableName hard-codes
the expected executable name as gtest_all_test among other options that
do not include googletest_all_test, so test executables retain their
names as well.

fb19f57880f6 Add GTEST_BRIEF option
3549237957a1 Ensure that gtest/gmock pkgconfig requirements specify
             version
189299e957bb Merge branch 'master' into quiet-flag
5504ded3ab5c Fix a typo in .travis.yml
6ed4e7168f54 Replace the last instance of `throw()` with `noexcept`. NFC
879fd9b45299 Remove duplicate codes existed in get-nprocessors.sh
644f3a992c28 gtest-unittest-api_test - fix warning in clang build
0b6d567619fe Remove redundant .c_str()
be3ac45cf673 fix signed/unsigned comparison issue (on OpenBSD)
b51a49e0cb82 Merge pull request #2773 from Quuxplusone:replace-noexcept
c2032090f373 Merge pull request #2772 from Quuxplusone:travis
4fe5ac53337e Merge pull request #2756 from Conan-Kudo:fix-pkgconfig-reqs
373d72b6986f Googletest export
4c8e6a9fe1c8 Merge pull request #2810 from ptahmose:master
71d5df6c6b67 Merge pull request #2802 from e-i-n-s:fix_clang_warning
dcc92d0ab6c4 Merge pull request #2805 from pepsiman:patch-1
4f002f1e236c VariadicMatcher needs a non-defaulted move constructor for
             compile-time performance
9d580ea80592 Enable protobuf printing for open-source proto messages
766ac2e1a413 Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_
11b3cec177b1 Fix a -Wdeprecated warning
01c0ff5e2373 Fix a -Wdeprecated warning
c7d8ec72cc4b Fix a -Wdeprecated warning
1b066f4edfd5 Add -Wdeprecated to the build configuration
4bab55dc54b4 Removed a typo in README.md
a67701056425 Googletest export
fb5d9b66c5b0 Googletest export
1b3eb6ef3462 Googletest export
b0e53e2d64db Merge pull request #2797 from Jyun-Neng:master
d7ca9af0049e Googletest export
955552518b4e Googletest export
ef25d27d4604 Merge pull request #2815 from Quuxplusone:simple
129329787429 Googletest export
b99b421d8d68 Merge pull request #2818 from inazarenko:master
472cd8fd8b1c Merge pull request #2818 from inazarenko:master
3cfb4117f7e5 Googletest export
0eea2e9fc634 Googletest export
a9f6c1ed1401 Googletest export
1a9c3e441407 Merge pull request #2830 from keshavgbpecdelhi:patch-1
e589a3371705 Merge pull request #2751 from calumr:quiet-flag

Change-Id: Id788a27aa884ef68a21bae6c178cd456f5f6f2b0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2186009
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2020-05-06 20:39:19 -04:00 committed by Commit Bot
parent 95b4e62768
commit a45eea40fc
69 changed files with 986 additions and 996 deletions

2
.gitignore vendored
View File

@ -29,7 +29,7 @@
/third_party/fuchsia/clang
/third_party/fuchsia/qemu
/third_party/fuchsia/sdk
/third_party/gtest/gtest
/third_party/googletest/googletest
/third_party/libfuzzer
/third_party/linux/.cipd
/third_party/linux/clang

View File

@ -28,7 +28,7 @@ config("disable_ubsan") {
visibility = [
"snapshot:snapshot",
"minidump:minidump_test",
"third_party/gtest:gtest",
"third_party/googletest:googletest",
"util:util",
]
}
@ -38,7 +38,7 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
deps = [
"client:client_test",
"minidump:minidump_test",
"test:gmock_main",
"test:googlemock_main",
"test:test_test",
]
if (!crashpad_is_ios) {
@ -173,14 +173,14 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_client_test") {
deps = [
"client:client_test",
"test:gmock_main",
"test:googlemock_main",
]
}
test("crashpad_handler_test") {
deps = [
"handler:handler_test",
"test:gtest_main",
"test:googletest_main",
]
if (crashpad_is_ios || crashpad_is_fuchsia) {
deps -= [ "handler:handler_test" ]
@ -190,14 +190,14 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_minidump_test") {
deps = [
"minidump:minidump_test",
"test:gtest_main",
"test:googletest_main",
]
}
test("crashpad_snapshot_test") {
deps = [
"snapshot:snapshot_test",
"test:gtest_main",
"test:googletest_main",
]
if (crashpad_is_ios) {
deps -= [ "snapshot:snapshot_test" ]
@ -206,14 +206,14 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_test_test") {
deps = [
"test:gmock_main",
"test:googlemock_main",
"test:test_test",
]
}
test("crashpad_util_test") {
deps = [
"test:gmock_main",
"test:googlemock_main",
"util:util_test",
]
}

4
DEPS
View File

@ -31,9 +31,9 @@ deps = {
'243fc89ae95b24717d41f3786f6a9abeeef87c92',
'condition': 'checkout_ios',
},
'crashpad/third_party/gtest/gtest':
'crashpad/third_party/googletest/googletest':
Var('chromium_git') + '/external/github.com/google/googletest@' +
'e3f0319d89f4cbf32993de595d984183b1a9fc57',
'e589a337170554c48bc658cc857cf15080c9eacc',
'crashpad/third_party/gyp/gyp':
Var('chromium_git') + '/external/gyp@' +
'8bee09f4a57807136593ddc906b0b213c21f9014',

View File

@ -17,11 +17,12 @@
# by the crashpad_standalone GYP variable. It may have these values:
# standalone
# A “standalone” Crashpad build, where the dependencies are in the
# Crashpad tree. third_party/mini_chromium and third_party/gtest provide
# the base and gtest libraries.
# Crashpad tree. third_party/mini_chromium and third_party/googletest
# provide the base and Google Test libraries.
# external
# A build with external dependencies. mini_chromium provides the base
# library, but its located outside of the Crashpad tree, as is gtest.
# library, but its located outside of the Crashpad tree, as is Google
# Test.
#
# In order for Crashpads .gyp files to reference the correct versions
# depending on how dependencies are being provided, include this .gypi file
@ -29,7 +30,7 @@
#
# Note that Crashpads in-Chromium build uses GN instead of GYP, and
# Chromiums GN build configures Crashpad to use Chromiums own base library
# and its copy of the gtest library.
# and its copy of the Google Test library.
'variables': {
# When with external dependencies, build/gyp_crashpad.py sets

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>${IOS_BUNDLE_ID_PREFIX}.gtest.${GTEST_BUNDLE_ID_SUFFIX:rfc1034identifier}</string>
<string>${IOS_BUNDLE_ID_PREFIX}.googletest.${GTEST_BUNDLE_ID_SUFFIX:rfc1034identifier}</string>
<key>UIApplicationDelegate</key>
<string>CrashpadUnitTestDelegate</string>
</dict>

View File

@ -289,11 +289,11 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
# environment.
#
# Because the test will not run with its standard output attached to a
# pseudo-terminal device, gtest will not normally enable colored output,
# so mimic gtests own logic for deciding whether to enable color by
# checking this scripts own standard output connection. The whitelist
# of TERM values comes from gtest googletest/src/gtest.cc
# testing::internal::ShouldUseColor().
# pseudo-terminal device, Google Test will not normally enable colored
# output, so mimic Google Tests own logic for deciding whether to
# enable color by checking this scripts own standard output connection.
# The whitelist of TERM values comes from Google Tests
# googletest/src/gtest.cc testing::internal::ShouldUseColor().
env = {'CRASHPAD_TEST_DATA_ROOT': device_temp_dir}
gtest_color = os.environ.get('GTEST_COLOR')
if gtest_color in ('auto', None):
@ -525,8 +525,9 @@ def main(args):
parser = argparse.ArgumentParser(description='Run Crashpad unittests.')
parser.add_argument('binary_dir', help='Root of build dir')
parser.add_argument('test', nargs='*', help='Specific test(s) to run.')
parser.add_argument('--gtest_filter',
help='GTest filter applied to GTest binary runs.')
parser.add_argument(
'--gtest_filter',
help='Google Test filter applied to Google Test binary runs.')
args = parser.parse_args()
# Tell 64-bit Windows tests where to find 32-bit test executables, for

View File

@ -157,8 +157,8 @@ source_set("client_test") {
"../compat",
"../snapshot",
"../test",
"../third_party/gtest:gmock",
"../third_party/gtest:gtest",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]

View File

@ -25,10 +25,10 @@
'../compat/compat.gyp:crashpad_compat',
'../handler/handler.gyp:crashpad_handler',
'../snapshot/snapshot.gyp:crashpad_snapshot',
'../test/test.gyp:crashpad_gmock_main',
'../test/test.gyp:crashpad_googlemock_main',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gmock.gyp:gmock',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googlemock.gyp:googlemock',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],

View File

@ -36,19 +36,19 @@ TEST_F(CrashpadIOSClient, DumpWithoutCrash) {
client.DumpWithoutCrash(&context);
}
// This test is covered by a similar XCUITest, but for development purposes
// it's sometimes easier and faster to run as a gtest. However, there's no
// way to correctly run this as a gtest. Leave the test here, disabled, for use
// This test is covered by a similar XCUITest, but for development purposes it's
// sometimes easier and faster to run in Google Test. However, there's no way
// to correctly run this in Google Test. Leave the test here, disabled, for use
// during development only.
TEST_F(CrashpadIOSClient, DISABLED_ThrowNSException) {
CrashpadClient client;
client.StartCrashpadInProcessHandler();
[NSException raise:@"GtestNSException" format:@"ThrowException"];
[NSException raise:@"GoogleTestNSException" format:@"ThrowException"];
}
// This test is covered by a similar XCUITest, but for development purposes
// it's sometimes easier and faster to run as a gtest. However, there's no
// way to correctly run this as a gtest. Leave the test here, disabled, for use
// This test is covered by a similar XCUITest, but for development purposes it's
// sometimes easier and faster to run in Google Test. However, there's no way
// to correctly run this in Google Test. Leave the test here, disabled, for use
// during development only.
TEST_F(CrashpadIOSClient, DISABLED_ThrowException) {
CrashpadClient client;

View File

@ -53,7 +53,7 @@ class MockDatabase : public CrashReportDatabase {
MOCK_METHOD1(DeleteReport, OperationStatus(const UUID&));
MOCK_METHOD1(RequestUpload, OperationStatus(const UUID&));
// gmock doesn't support mocking methods with non-copyable types such as
// Google Mock doesn't support mocking methods with non-copyable types such as
// unique_ptr.
OperationStatus FinishedWritingCrashReport(std::unique_ptr<NewReport> report,
UUID* uuid) override {

View File

@ -114,7 +114,7 @@ source_set("handler_test") {
"../snapshot",
"../snapshot:test_support",
"../test",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]
@ -231,7 +231,7 @@ if (crashpad_is_win) {
deps = [
"../client",
"../test",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
]
}

View File

@ -50,7 +50,7 @@ void StartAndCrashWithExtendedHandler(const base::FilePath& temp_dir) {
false,
false));
// It appears that the GoogleTest fixture will catch and handle exceptions
// It appears that the Google Test fixture will catch and handle exceptions
// from here. Hence the fabricated crash in favor of raising an exception.
EXCEPTION_RECORD exception_record = {kExpectedExitCode,
EXCEPTION_NONCONTINUABLE};

View File

@ -27,9 +27,9 @@
'../compat/compat.gyp:crashpad_compat',
'../snapshot/snapshot.gyp:crashpad_snapshot',
'../snapshot/snapshot_test.gyp:crashpad_snapshot_test_lib',
'../test/test.gyp:crashpad_gtest_main',
'../test/test.gyp:crashpad_googletest_main',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],
@ -86,7 +86,7 @@
'dependencies': [
'../client/client.gyp:crashpad_client',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],

View File

@ -135,7 +135,7 @@ static_library("test_support") {
deps = [
"../snapshot:test_support",
"../test",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]
@ -178,7 +178,7 @@ source_set("minidump_test") {
":test_support",
"../snapshot:test_support",
"../test",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]

View File

@ -61,7 +61,7 @@ void GetExceptionStream(const std::string& file_contents,
}
// The MINIDUMP_EXCEPTION_STREAMs |expected| and |observed| are compared against
// each other using gtest assertions. The context will be recovered from
// each other using Google Test assertions. The context will be recovered from
// |file_contents| and stored in |context|.
void ExpectExceptionStream(const MINIDUMP_EXCEPTION_STREAM* expected,
const MINIDUMP_EXCEPTION_STREAM* observed,

View File

@ -22,7 +22,7 @@
'type': 'static_library',
'dependencies': [
'minidump.gyp:crashpad_minidump',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
],
'include_dirs': [
@ -54,9 +54,9 @@
'crashpad_minidump_test_lib',
'minidump.gyp:crashpad_minidump',
'../snapshot/snapshot_test.gyp:crashpad_snapshot_test_lib',
'../test/test.gyp:crashpad_gtest_main',
'../test/test.gyp:crashpad_googletest_main',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],

View File

@ -97,7 +97,7 @@ TEST(MinidumpThreadWriter, EmptyThreadList) {
}
// The MINIDUMP_THREADs |expected| and |observed| are compared against each
// other using gtest assertions. If |stack| is not nullptr, |observed| is
// other using Google Test assertions. If |stack| is not nullptr, |observed| is
// expected to contain a populated MINIDUMP_MEMORY_DESCRIPTOR in its Stack
// field, otherwise, its Stack field is expected to be zeroed out. The memory
// descriptor will be placed in |stack|. |observed| must contain a populated

View File

@ -274,7 +274,7 @@ void InitializeMinidumpContextMIPS64(MinidumpContextMIPS64* context,
namespace {
// Using gtest assertions, compares |expected| to |observed|. This is
// Using Google Test assertions, compares |expected| to |observed|. This is
// templatized because the CPUContextX86::Fxsave and CPUContextX86_64::Fxsave
// are nearly identical but have different sizes for the members |xmm|,
// |reserved_4|, and |available|.

View File

@ -49,8 +49,8 @@ void InitializeMinidumpContextMIPS64(MinidumpContextMIPS* context,
uint32_t seed);
//! \}
//! \brief Verifies, via gtest assertions, that a context structure contains
//! expected values.
//! \brief Verifies, via Google Test assertions, that a context structure
//! contains expected values.
//!
//! \param[in] expect_seed The seed value used to initialize a context
//! structure. This is the seed value used with

View File

@ -33,17 +33,17 @@ namespace test {
//! \param[in] file_contents The contents of the minidump file.
//! \param[out] directory The MINIDUMP_DIRECTORY referenced by the
//! MINIDUMP_HEADER. If the MINIDUMP_HEADER does not reference a
//! MINIDUMP_DIRECTORY, `nullptr` without raising a gtest assertion. If the
//! referenced MINIDUMP_DIRECTORY is not valid, `nullptr` with a gtest
//! assertion raised. On failure, `nullptr`.
//! MINIDUMP_DIRECTORY, `nullptr` without raising a Google Test assertion.
//! If the referenced MINIDUMP_DIRECTORY is not valid, `nullptr` with a
//! Google Test assertion raised. On failure, `nullptr`.
//!
//! \return On success, the MINIDUMP_HEADER at the beginning of the minidump
//! file. On failure, raises a gtest assertion and returns `nullptr`.
//! file. On failure, raises a Google Test assertion and returns `nullptr`.
const MINIDUMP_HEADER* MinidumpHeaderAtStart(
const std::string& file_contents,
const MINIDUMP_DIRECTORY** directory);
//! \brief Verifies, via gtest assertions, that a MINIDUMP_HEADER contains
//! \brief Verifies, via Google Test assertions, that a MINIDUMP_HEADER contains
//! expected values.
//!
//! All fields in the MINIDUMP_HEADER will be evaluated except for the Signature

View File

@ -48,8 +48,8 @@ class TestMinidumpMemoryWriter final : public SnapshotMinidumpMemoryWriter {
DISALLOW_COPY_AND_ASSIGN(TestMinidumpMemoryWriter);
};
//! \brief Verifies, via gtest assertions, that a MINIDUMP_MEMORY_DESCRIPTOR
//! structure contains expected values.
//! \brief Verifies, via Google Test assertions, that a
//! MINIDUMP_MEMORY_DESCRIPTOR structure contains expected values.
//!
//! In \a expected and \a observed,
//! MINIDUMP_MEMORY_DESCRIPTOR::StartOfMemoryRange and
@ -64,10 +64,10 @@ class TestMinidumpMemoryWriter final : public SnapshotMinidumpMemoryWriter {
void ExpectMinidumpMemoryDescriptor(const MINIDUMP_MEMORY_DESCRIPTOR* expected,
const MINIDUMP_MEMORY_DESCRIPTOR* observed);
//! \brief Verifies, via gtest assertions, that a MINIDUMP_MEMORY_DESCRIPTOR
//! structure contains expected values, and that the memory region it points
//! to contains expected values assuming it was written by a
//! TestMinidumpMemoryWriter object.
//! \brief Verifies, via Google Test assertions, that a
//! MINIDUMP_MEMORY_DESCRIPTOR structure contains expected values, and that
//! the memory region it points to contains expected values assuming it was
//! written by a TestMinidumpMemoryWriter object.
//!
//! \a expected and \a observed are compared by
//! ExpectMinidumpMemoryDescriptor().

View File

@ -34,7 +34,7 @@ namespace test {
//! file_contents.
//!
//! \return On success, the MinidumpRVAList at the beginning of the file. On
//! failure, raises a gtest assertion and returns `nullptr`.
//! failure, raises a Google Test assertion and returns `nullptr`.
const MinidumpRVAList* MinidumpRVAListAtStart(const std::string& file_contents,
size_t count);

View File

@ -39,7 +39,7 @@ namespace test {
//! MINIDUMP_STRING.
//!
//! \return On success, a pointer to the MINIDUMP_STRING in \a file_contents. On
//! failure, raises a gtest assertion and returns `nullptr`.
//! failure, raises a Google Test assertion and returns `nullptr`.
//!
//! \sa MinidumpStringAtRVAAsString()
//! \sa MinidumpUTF8StringAtRVA()
@ -58,7 +58,7 @@ const MINIDUMP_STRING* MinidumpStringAtRVA(const std::string& file_contents,
//! MinidumpUTF8String.
//!
//! \return On success, a pointer to the MinidumpUTF8String in \a file_contents.
//! On failure, raises a gtest assertion and returns `nullptr`.
//! On failure, raises a Google Test assertion and returns `nullptr`.
//!
//! \sa MinidumpUTF8StringAtRVAAsString()
//! \sa MinidumpStringAtRVA()
@ -76,7 +76,7 @@ const MinidumpUTF8String* MinidumpUTF8StringAtRVA(
//! MINIDUMP_STRING.
//!
//! \return On success, the string read from \a file_writer at offset \a rva. On
//! failure, raises a gtest assertion and returns an empty string.
//! failure, raises a Google Test assertion and returns an empty string.
//!
//! \sa MinidumpUTF8StringAtRVAAsString()
base::string16 MinidumpStringAtRVAAsString(const std::string& file_contents,
@ -92,7 +92,7 @@ base::string16 MinidumpStringAtRVAAsString(const std::string& file_contents,
//! MinidumpUTF8String.
//!
//! \return On success, the string read from \a file_writer at offset \a rva. On
//! failure, raises a gtest assertion and returns an empty string.
//! failure, raises a Google Test assertion and returns an empty string.
//!
//! \sa MinidumpStringAtRVAAsString()
std::string MinidumpUTF8StringAtRVAAsString(const std::string& file_contents,

View File

@ -35,7 +35,7 @@ namespace {
//! \param[in] rva The offset within the minidump file of the desired object.
//!
//! \return If \a rva is within the range of \a file_contents, returns a pointer
//! into \a file_contents at offset \a rva. Otherwise, raises a gtest
//! into \a file_contents at offset \a rva. Otherwise, raises a Google Test
//! assertion failure and returns `nullptr`.
//!
//! Do not call this function. Use the typed version, MinidumpWritableAtRVA<>(),

View File

@ -49,7 +49,7 @@ namespace test {
//!
//! \return If the size of \a location is agrees with \a expected_size, and if
//! \a location is within the range of \a file_contents, returns a pointer
//! into \a file_contents at offset \a rva. Otherwise, raises a gtest
//! into \a file_contents at offset \a rva. Otherwise, raises a Google Test
//! assertion failure and returns `nullptr`.
//!
//! Do not call this function. Use the typed version,
@ -159,7 +159,7 @@ const T* TMinidumpWritableAtLocationDescriptor(
//! \return If the size of \a location is at least as big as the size of the
//! requested object, and if \a location is within the range of \a
//! file_contents, returns a pointer into \a file_contents at offset \a rva.
//! Otherwise, raises a gtest assertion failure and returns `nullptr`.
//! Otherwise, raises a Google Test assertion failure and returns `nullptr`.
//!
//! \sa MinidumpWritableAtRVA()
template <typename T>
@ -259,8 +259,8 @@ MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
//!
//! \return If \a rva plus the size of an object of type \a T is within the
//! range of \a file_contents, returns a pointer into \a file_contents at
//! offset \a rva. Otherwise, raises a gtest assertion failure and returns
//! `nullptr`.
//! offset \a rva. Otherwise, raises a Google Test assertion failure and
//! returns `nullptr`.
//!
//! \sa MinidumpWritableAtLocationDescriptor<>()
template <typename T>

View File

@ -428,7 +428,7 @@ source_set("snapshot_test") {
"../compat",
"../minidump:format",
"../test",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]

View File

@ -59,9 +59,9 @@
'snapshot.gyp:crashpad_snapshot',
'../client/client.gyp:crashpad_client',
'../compat/compat.gyp:crashpad_compat',
'../test/test.gyp:crashpad_gtest_main',
'../test/test.gyp:crashpad_googletest_main',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],

View File

@ -124,7 +124,7 @@ static_library("test") {
deps = [
"../compat",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]
@ -203,8 +203,8 @@ source_set("test_test") {
deps = [
":test",
"../compat",
"../third_party/gtest:gmock",
"../third_party/gtest:gtest",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]
@ -224,15 +224,15 @@ if (!crashpad_is_ios) {
}
}
static_library("gmock_main") {
static_library("googlemock_main") {
testonly = true
sources = [ "gtest_main.cc" ]
configs += [ "../build:crashpad_is_in_chromium" ]
defines = [ "CRASHPAD_TEST_LAUNCHER_GMOCK" ]
defines = [ "CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK" ]
deps = [
":test",
"../third_party/gtest:gmock",
"../third_party/gtest:gtest",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../third_party/mini_chromium:base_test_support",
]
@ -244,14 +244,14 @@ static_library("gmock_main") {
}
}
static_library("gtest_main") {
static_library("googletest_main") {
testonly = true
sources = [ "gtest_main.cc" ]
configs += [ "../build:crashpad_is_in_chromium" ]
defines = [ "CRASHPAD_TEST_LAUNCHER_GTEST" ]
defines = [ "CRASHPAD_TEST_LAUNCHER_GOOGLETEST" ]
deps = [
":test",
"../third_party/gtest:gtest",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../third_party/mini_chromium:base_test_support",
]

View File

@ -24,12 +24,12 @@ namespace test {
// These functions format messages in a similar way to the PLOG and PCHECK
// family of logging macros in base/logging.h. They exist to interoperate with
// gtest assertions, which dont interoperate with logging but can be streamed
// to.
// Google Test assertions, which dont interoperate with logging but can be
// streamed to.
//
// Where non-test code could do:
// PCHECK(rv == 0) << "close";
// gtest-based test code can do:
// Google Test-based test code can do:
// EXPECT_EQ(rv, 0) << ErrnoMessage("close");
//! \brief Formats an error message using an `errno` value.

View File

@ -27,7 +27,7 @@ namespace test {
//!
//! \return `true` if \a path exists. `false` if it does not exist. If an error
//! other than “file not found” occurs when searching for \a path, returns
//! `false` with a gtest failure added.
//! `false` with a Google Test failure added.
bool FileExists(const base::FilePath& path);
//! \brief Determines the size of a file.
@ -36,7 +36,7 @@ bool FileExists(const base::FilePath& path);
//!
//! \return The size of the file at \a path. If the file does not exist, or an
//! error occurs when attempting to determine its size, returns `-1` with a
//! gtest failure added.
//! Google Test failure added.
FileOffset FileSize(const base::FilePath& path);
} // namespace test

View File

@ -27,7 +27,7 @@
#if (defined(OS_MACOSX) && !defined(OS_IOS)) || DOXYGEN
//! \brief Wraps the gtest `ASSERT_DEATH_IF_SUPPORTED()` macro to make
//! \brief Wraps the Google Test `ASSERT_DEATH_IF_SUPPORTED()` macro to make
//! assertions about death caused by crashes.
//!
//! On macOS, this macro prevents the systems crash reporter from handling
@ -35,10 +35,10 @@
//! systems crash reporter, but it is undesirable for intentional
//! ASSERT_DEATH_CRASH() crashes to be handled by any crash reporter.
//!
//! `ASSERT_DEATH_IF_SUPPORTED()` is used instead of `ASSERT_DEATH()` to
//! support platforms where death tests are not implemented by gtest (e.g.
//! Fuchsia). On platforms where death tests are not implemented, a warning
//! will be logged and the remainder of the test body skipped.
//! `ASSERT_DEATH_IF_SUPPORTED()` is used instead of `ASSERT_DEATH()` to support
//! platforms where death tests are not implemented by Google Test (e.g.
//! Fuchsia). On platforms where death tests are not implemented, a warning will
//! be logged and the remainder of the test body skipped.
//!
//! \sa ASSERT_DEATH_CHECK()
//! \sa EXPECT_DEATH_CRASH()
@ -50,7 +50,7 @@
{ statement; }, regex); \
} while (false)
//! \brief Wraps the gtest `EXPECT_DEATH_IF_SUPPORTED()` macro to make
//! \brief Wraps the Google Test `EXPECT_DEATH_IF_SUPPORTED()` macro to make
//! assertions about death caused by crashes.
//!
//! On macOS, this macro prevents the systems crash reporter from handling
@ -58,10 +58,10 @@
//! systems crash reporter, but it is undesirable for intentional
//! EXPECT_DEATH_CRASH() crashes to be handled by any crash reporter.
//!
//! `EXPECT_DEATH_IF_SUPPORTED()` is used instead of `EXPECT_DEATH()` to
//! support platforms where death tests are not implemented by gtest (e.g.
//! Fuchsia). On platforms where death tests are not implemented, a warning
//! will be logged and the remainder of the test body skipped.
//! `EXPECT_DEATH_IF_SUPPORTED()` is used instead of `EXPECT_DEATH()` to support
//! platforms where death tests are not implemented by Google Test (e.g.
//! Fuchsia). On platforms where death tests are not implemented, a warning will
//! be logged and the remainder of the test body skipped.
//!
//! \sa EXPECT_DEATH_CHECK()
//! \sa ASSERT_DEATH_CRASH()

View File

@ -17,9 +17,9 @@
#include "test/main_arguments.h"
#include "test/multiprocess_exec.h"
#if defined(CRASHPAD_TEST_LAUNCHER_GMOCK)
#if defined(CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK)
#include "gmock/gmock.h"
#endif // CRASHPAD_TEST_LAUNCHER_GMOCK
#endif // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
#if defined(OS_ANDROID)
#include "util/linux/initial_signal_dispositions.h"
@ -77,7 +77,7 @@ int main(int argc, char* argv[]) {
#if defined(OS_WIN)
// Chromiums test launcher interferes with WinMultiprocess-based tests. Allow
// their child processes to be launched by the standard gtest-based test
// their child processes to be launched by the standard Google Test-based test
// runner.
const bool use_chromium_test_launcher =
!crashpad::test::WinChildProcess::IsChildProcess();
@ -99,13 +99,14 @@ int main(int argc, char* argv[]) {
#endif // CRASHPAD_IS_IN_CHROMIUM
#if defined(CRASHPAD_TEST_LAUNCHER_GMOCK)
#if defined(CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK)
testing::InitGoogleMock(&argc, argv);
#elif defined(CRASHPAD_TEST_LAUNCHER_GTEST)
#elif defined(CRASHPAD_TEST_LAUNCHER_GOOGLETEST)
testing::InitGoogleTest(&argc, argv);
#else // CRASHPAD_TEST_LAUNCHER_GMOCK
#error #define CRASHPAD_TEST_LAUNCHER_GTEST or CRASHPAD_TEST_LAUNCHER_GMOCK
#endif // CRASHPAD_TEST_LAUNCHER_GMOCK
#else // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
#error #define CRASHPAD_TEST_LAUNCHER_GOOGLETEST or \
CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
#endif // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK
#if defined(OS_IOS)
// iOS needs to run tests within the context of an app, so call a helper that

View File

@ -56,7 +56,7 @@ source_set("google_test_setup") {
deps = [
":google_test_runner_shared_headers",
"../../build:ios_enable_arc",
"../../third_party/gtest:gtest",
"../../third_party/googletest:googletest",
"../../third_party/mini_chromium:base",
]
libs = [ "UIKit.framework" ]

View File

@ -17,12 +17,12 @@
@protocol CPTestGoogleTestRunnerDelegate
// Returns YES if this delegate supports running GoogleTests via a call to
// Returns YES if this delegate supports running Google Test tests via a call to
// |runGoogleTests|.
@property(nonatomic, readonly, assign)
BOOL supportsRunningGoogleTestsWithXCTest;
// Runs GoogleTests and returns the final exit code.
// Runs Google Test tests and returns the final exit code.
- (int)runGoogleTests;
@end

View File

@ -30,8 +30,8 @@
namespace {
// The iOS watchdog timer will kill an app that doesn't spin the main event
// loop often enough. This uses a Gtest TestEventListener to spin the current
// The iOS watchdog timer will kill an app that doesn't spin the main event loop
// often enough. This uses a Google Test TestEventListener to spin the current
// loop after each test finishes. However, if any individual test takes too
// long, it is still possible that the app will get killed.
class IOSRunLoopListener : public testing::EmptyTestEventListener {

View File

@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${IOS_BUNDLE_ID_PREFIX}.gtest.${EXECUTABLE_NAME:rfc1034identifier}</string>
<string>${IOS_BUNDLE_ID_PREFIX}.googletest.${EXECUTABLE_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -117,9 +117,9 @@ ExceptionSwallower::ExceptionSwallower() : exception_swallower_thread_() {
if (CheckedGetenv(kServiceEnvironmentVariable)) {
// The environment variable is already set, so just proceed with the
// existing service. This normally happens when the gtest “threadsafe” death
// test style is chosen, because the test child process will re-execute code
// already run in the test parent process. See
// existing service. This normally happens when the Google Test “threadsafe”
// death test style is chosen, because the test child process will
// re-execute code already run in the test parent process. See
// https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#death-test-styles.
return;
}

View File

@ -23,12 +23,12 @@ namespace crashpad {
namespace test {
// This function formats messages in a similar way to the Mach error logging
// macros in base/mac/mach_logging.h. It exists to interoperate with gtest
// macros in base/mac/mach_logging.h. It exists to interoperate with Google Test
// assertions, which dont interoperate with logging but can be streamed to.
//
// Where non-test code could do:
// MACH_CHECK(kr == KERN_SUCCESS, kr) << "vm_deallocate";
// gtest-based test code can do:
// Google Test-based test code can do:
// EXPECT_EQ(kr, KERN_SUCCESS) << MachErrorMessage(kr, "vm_deallocate");
//! \brief Formats a Mach error message.

View File

@ -84,7 +84,7 @@ class MachMultiprocess : public Multiprocess {
//! \brief Runs the child side of the test.
//!
//! This method establishes the childs environment and calls
//! MachMultiprocessChild(). If any failure (via fatal or nonfatal gtest
//! MachMultiprocessChild(). If any failure (via fatal or nonfatal Google Test
//! assertion) is detected, the child will exit with a failure status.
//!
//! Subclasses must override MachMultiprocessChild() instead of this method.
@ -92,8 +92,8 @@ class MachMultiprocess : public Multiprocess {
//! \brief The subclass-provided parent routine.
//!
//! Test failures should be reported via gtest: `EXPECT_*()`, `ASSERT_*()`,
//! `FAIL()`, etc.
//! Test failures should be reported via Google Test: `EXPECT_*()`,
//! `ASSERT_*()`, `FAIL()`, etc.
//!
//! This method must not use a `wait()`-family system call to wait for the
//! child process to exit, as this is handled by the superclass.
@ -103,8 +103,8 @@ class MachMultiprocess : public Multiprocess {
//! \brief The subclass-provided child routine.
//!
//! Test failures should be reported via gtest: `EXPECT_*()`, `ASSERT_*()`,
//! `FAIL()`, etc.
//! Test failures should be reported via Google Test: `EXPECT_*()`,
//! `ASSERT_*()`, `FAIL()`, etc.
//!
//! Subclasses must implement this method to define how the child operates.
virtual void MachMultiprocessChild() = 0;

View File

@ -60,7 +60,7 @@ class Multiprocess {
//! \brief The child terminated by signal.
//!
//! Signal termination happens as a result of a crash, a call to `abort()`,
//! assertion failure (including gtest assertions), etc.
//! assertion failure (including Google Test assertions), etc.
kTerminationSignal,
#endif // !defined(OS_FUCHSIA)
};
@ -73,12 +73,13 @@ class Multiprocess {
//! PreFork(), then calls `fork()`. In the parent process, it calls
//! RunParent(), and in the child process, it calls RunChild().
//!
//! This method uses gtest assertions to validate the testing environment. If
//! the testing environment cannot be set up properly, it is possible that
//! MultiprocessParent() or MultiprocessChild() will not be called. In the
//! parent process, this method also waits for the child process to exit after
//! MultiprocessParent() returns, and verifies that it exited in accordance
//! with the expectations set by SetExpectedChildTermination().
//! This method uses Google Test assertions to validate the testing
//! environment. If the testing environment cannot be set up properly, it is
//! possible that MultiprocessParent() or MultiprocessChild() will not be
//! called. In the parent process, this method also waits for the child
//! process to exit after MultiprocessParent() returns, and verifies that it
//! exited in accordance with the expectations set by
//! SetExpectedChildTermination().
void Run();
//! \brief Sets the expected termination reason and code.
@ -126,7 +127,7 @@ class Multiprocess {
//! \endcode
//!
//! Subclass implementations may signal failure by raising their own fatal
//! gtest assertions.
//! Google Test assertions.
virtual void PreFork()
#if defined(OS_WIN) || defined(OS_FUCHSIA)
= 0
@ -190,14 +191,14 @@ class Multiprocess {
//!
//! This method establishes the childs environment, calls
//! MultiprocessChild(), and exits cleanly by calling `_exit(0)`. However, if
//! any failure (via fatal or nonfatal gtest assertion) is detected, the child
//! will exit with a failure status.
//! any failure (via fatal or nonfatal Google Test assertion) is detected, the
//! child will exit with a failure status.
void RunChild();
//! \brief The subclass-provided parent routine.
//!
//! Test failures should be reported via gtest: `EXPECT_*()`, `ASSERT_*()`,
//! `FAIL()`, etc.
//! Test failures should be reported via Google Test: `EXPECT_*()`,
//! `ASSERT_*()`, `FAIL()`, etc.
//!
//! This method must not use a `wait()`-family system call to wait for the
//! child process to exit, as this is handled by this class.
@ -207,8 +208,8 @@ class Multiprocess {
//! \brief The subclass-provided child routine.
//!
//! Test failures should be reported via gtest: `EXPECT_*()`, `ASSERT_*()`,
//! `FAIL()`, etc.
//! Test failures should be reported via Google Test: `EXPECT_*()`,
//! `ASSERT_*()`, `FAIL()`, etc.
//!
//! Subclasses must implement this method to define how the child operates.
//! Subclasses may exit with a failure status by using `LOG(FATAL)`,

View File

@ -111,8 +111,8 @@ class MultiprocessExec : public Multiprocess {
//!
//! This uses the same launch mechanism as SetChildCommand(), but coordinates
//! with test/gtest_main.cc to allow for simple registration of a child
//! processes' entry point via the helper macro, rather than needing to
//! create a separate build target.
//! processes' entry point via the helper macro, rather than needing to create
//! a separate build target.
//!
//! \param[in] function_name The name of the function as passed to
//! CRASHPAD_CHILD_TEST_MAIN().

View File

@ -107,7 +107,7 @@ void MultiprocessExec::MultiprocessChild() {
ASSERT_EQ(fileno(stdout), STDOUT_FILENO);
// Make a copy of the original stdout file descriptor so that in case theres
// an execv() failure, the original stdout can be restored so that gtest
// an execv() failure, the original stdout can be restored so that Google Test
// messages directed to stdout go to the right place. Mark it as
// close-on-exec, so that the child wont see it after a successful exec(),
// but it will still be available in this process after an unsuccessful

View File

@ -35,7 +35,8 @@ class TestMultiprocessExec final : public MultiprocessExec {
private:
void MultiprocessParent() override {
// Use Logging*File() instead of Checked*File() so that the test can fail
// gracefully with a gtest assertion if the child does not execute properly.
// gracefully with a Google Test assertion if the child does not execute
// properly.
char c = 'z';
ASSERT_TRUE(LoggingWriteFile(WritePipeHandle(), &c, 1));

View File

@ -92,8 +92,8 @@ void Multiprocess::Run() {
RunParent();
// Waiting for the child happens here instead of in RunParent() because even
// if RunParent() returns early due to a gtest fatal assertion failure, the
// child should still be reaped.
// if RunParent() returns early due to a Google Test fatal assertion
// failure, the child should still be reaped.
// This will make the parent hang up on the child as much as would be
// visible from the childs perspective. The childs side of the pipe will

View File

@ -47,7 +47,7 @@ class ScopedTempDir {
//! \brief Removes all files and subdirectories at the given \a path,
//! including the \a path itself.
//!
//! Failures are recorded by gtest expectations.
//! Failures are recorded by Google Test expectations.
//!
//! \param[in] path The path to delete, along with its contents. This must
//! reference a directory.

View File

@ -22,7 +22,7 @@
'type': 'static_library',
'dependencies': [
'../compat/compat.gyp:crashpad_compat',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],
@ -114,37 +114,37 @@
],
},
{
'target_name': 'crashpad_gmock_main',
'target_name': 'crashpad_googlemock_main',
'type': 'static_library',
'dependencies': [
'crashpad_test',
'../third_party/gtest/gmock.gyp:gmock',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googlemock.gyp:googlemock',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
],
'include_dirs': [
'..',
],
'defines': [
'CRASHPAD_TEST_LAUNCHER_GMOCK=1',
'CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK=1',
],
'sources': [
'gtest_main.cc',
],
},
{
'target_name': 'crashpad_gtest_main',
'target_name': 'crashpad_googletest_main',
'type': 'static_library',
'dependencies': [
'crashpad_test',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
],
'include_dirs': [
'..',
],
'defines': [
'CRASHPAD_TEST_LAUNCHER_GTEST=1',
'CRASHPAD_TEST_LAUNCHER_GOOGLETEST=1',
],
'sources': [
'gtest_main.cc',

View File

@ -22,11 +22,11 @@
'type': 'executable',
'dependencies': [
'crashpad_test_test_multiprocess_exec_test_child',
'test.gyp:crashpad_gmock_main',
'test.gyp:crashpad_googlemock_main',
'test.gyp:crashpad_test',
'../compat/compat.gyp:crashpad_compat',
'../third_party/gtest/gmock.gyp:gmock',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googlemock.gyp:googlemock',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',
],

View File

@ -25,7 +25,7 @@
namespace crashpad {
namespace test {
//! \brief Creates a child process for testing. Uses gtest `ASSERT_*` to
//! \brief Creates a child process for testing. Uses Google Test `ASSERT_*` to
//! indicate failure. The child's output is passed through a pipe and is
//! available via stdout_read_handle(), and the child's input is attached to
//! a second pipe available via stdin_write_handle().
@ -41,8 +41,8 @@ class ChildLauncher {
//! \brief Starts the child process, after which the handle functions below
//! will be valid.
//!
//! Errors are signaled via gtest assertions. This method may be invoked via
//! `ASSERT_NO_FATAL_FAILURE()` to assert that it succeeds.
//! Errors are signaled via Google Test assertions. This method may be invoked
//! via `ASSERT_NO_FATAL_FAILURE()` to assert that it succeeds.
void Start();
//! \brief Waits for the child process to exit.

View File

@ -63,7 +63,8 @@ class WinChildProcess {
//! \brief Launches a child process and returns the Handles for that process.
//! The process is guaranteed to be executing by the time this method
//! returns. Returns null and logs a GTest failure in case of failure.
//! returns. Returns `nullptr` and logs a Google Test failure in case of
//! failure.
static std::unique_ptr<Handles> Launch();
protected:

View File

@ -160,8 +160,8 @@ class WinMultiprocess {
//! \brief The subclass-provided parent routine.
//!
//! Test failures should be reported via gtest: `EXPECT_*()`, `ASSERT_*()`,
//! `FAIL()`, etc.
//! Test failures should be reported via Google Test: `EXPECT_*()`,
//! `ASSERT_*()`, `FAIL()`, etc.
//!
//! This method need not use `WaitForSingleObject()`-family call to wait for
//! the child process to exit, as this is handled by this class.
@ -185,8 +185,8 @@ class WinMultiprocess {
//! \brief The subclass-provided child routine.
//!
//! Test failures should be reported via gtest: `EXPECT_*()`, `ASSERT_*()`,
//! `FAIL()`, etc.
//! Test failures should be reported via Google Test: `EXPECT_*()`,
//! `ASSERT_*()`, `FAIL()`, etc.
//!
//! Subclasses must implement this method to define how the child operates.
//! Subclasses may exit with a failure status by using `LOG(FATAL)`,

372
third_party/googletest/BUILD.gn vendored Normal file
View File

@ -0,0 +1,372 @@
# Copyright 2017 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../build/crashpad_buildconfig.gni")
import("../../build/test.gni")
if (crashpad_is_in_chromium) {
group("googletest") {
testonly = true
public_deps = [ "//testing/googletest" ]
}
group("googlemock") {
testonly = true
public_deps = [ "//testing/googlemock" ]
}
} else if (crashpad_is_in_dart || crashpad_is_in_fuchsia) {
group("googletest") {
testonly = true
public_deps = [ "//third_party/googletest:googletest" ]
public_configs = [ "../..:disable_ubsan" ]
}
group("googlemock") {
testonly = true
public_deps = [ "//third_party/googletest:googlemock" ]
}
} else if (crashpad_is_standalone) {
config("googletest_private_config") {
visibility = [ ":*" ]
include_dirs = [ "googletest/googletest" ]
defines = [ "GUNIT_NO_GOOGLE3=1" ]
}
config("googletest_public_config") {
include_dirs = [ "googletest/googletest/include" ]
}
static_library("googletest") {
testonly = true
sources = [
"googletest/googletest/include/gtest/gtest-death-test.h",
"googletest/googletest/include/gtest/gtest-matchers.h",
"googletest/googletest/include/gtest/gtest-message.h",
"googletest/googletest/include/gtest/gtest-param-test.h",
"googletest/googletest/include/gtest/gtest-printers.h",
"googletest/googletest/include/gtest/gtest-spi.h",
"googletest/googletest/include/gtest/gtest-test-part.h",
"googletest/googletest/include/gtest/gtest-typed-test.h",
"googletest/googletest/include/gtest/gtest.h",
"googletest/googletest/include/gtest/gtest_pred_impl.h",
"googletest/googletest/include/gtest/gtest_prod.h",
"googletest/googletest/include/gtest/internal/custom/gtest-port.h",
"googletest/googletest/include/gtest/internal/custom/gtest-printers.h",
"googletest/googletest/include/gtest/internal/custom/gtest.h",
"googletest/googletest/include/gtest/internal/gtest-death-test-internal.h",
"googletest/googletest/include/gtest/internal/gtest-filepath.h",
"googletest/googletest/include/gtest/internal/gtest-internal.h",
"googletest/googletest/include/gtest/internal/gtest-param-util.h",
"googletest/googletest/include/gtest/internal/gtest-port-arch.h",
"googletest/googletest/include/gtest/internal/gtest-port.h",
"googletest/googletest/include/gtest/internal/gtest-string.h",
"googletest/googletest/include/gtest/internal/gtest-type-util.h",
"googletest/googletest/src/gtest-all.cc",
"googletest/googletest/src/gtest-death-test.cc",
"googletest/googletest/src/gtest-filepath.cc",
"googletest/googletest/src/gtest-internal-inl.h",
"googletest/googletest/src/gtest-matchers.cc",
"googletest/googletest/src/gtest-port.cc",
"googletest/googletest/src/gtest-printers.cc",
"googletest/googletest/src/gtest-test-part.cc",
"googletest/googletest/src/gtest-typed-test.cc",
"googletest/googletest/src/gtest.cc",
]
sources -= [ "googletest/googletest/src/gtest-all.cc" ]
public_configs = [ ":googletest_public_config" ]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":googletest_private_config" ]
if (crashpad_is_fuchsia) {
deps = [ "../fuchsia" ]
}
}
static_library("googletest_main") {
# Tests outside of this file should use ../../test:googletest_main instead.
visibility = [ ":*" ]
testonly = true
sources = [ "googletest/googletest/src/gtest_main.cc" ]
deps = [ ":googletest" ]
}
test("gtest_all_test") {
sources = [
"googletest/googletest/test/googletest-death-test-test.cc",
"googletest/googletest/test/googletest-filepath-test.cc",
"googletest/googletest/test/googletest-message-test.cc",
"googletest/googletest/test/googletest-options-test.cc",
"googletest/googletest/test/googletest-port-test.cc",
"googletest/googletest/test/googletest-printers-test.cc",
"googletest/googletest/test/googletest-test-part-test.cc",
"googletest/googletest/test/gtest-typed-test2_test.cc",
"googletest/googletest/test/gtest-typed-test_test.cc",
"googletest/googletest/test/gtest-typed-test_test.h",
"googletest/googletest/test/gtest_main_unittest.cc",
"googletest/googletest/test/gtest_pred_impl_unittest.cc",
"googletest/googletest/test/gtest_prod_test.cc",
"googletest/googletest/test/gtest_skip_test.cc",
"googletest/googletest/test/gtest_unittest.cc",
"googletest/googletest/test/production.cc",
"googletest/googletest/test/production.h",
]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":googletest_private_config" ]
deps = [
":googletest",
":googletest_main",
]
if (crashpad_is_win) {
cflags = [ "/wd4702" ] # unreachable code
}
}
test("gtest_environment_test") {
sources = [ "googletest/googletest/test/gtest_environment_test.cc" ]
configs += [ ":googletest_private_config" ]
deps = [ ":googletest" ]
}
test("gtest_listener_test") {
sources = [ "googletest/googletest/test/googletest-listener-test.cc" ]
deps = [ ":googletest" ]
}
test("gtest_macro_stack_footprint_test") {
sources = [
"googletest/googletest/test/gtest_test_macro_stack_footprint_test.cc",
]
deps = [ ":googletest" ]
}
test("gtest_no_test") {
sources = [ "googletest/googletest/test/gtest_no_test_unittest.cc" ]
deps = [ ":googletest" ]
}
test("gtest_param_test") {
sources = [
"googletest/googletest/test/googletest-param-test-test.cc",
"googletest/googletest/test/googletest-param-test-test.h",
"googletest/googletest/test/googletest-param-test2-test.cc",
]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":googletest_private_config" ]
deps = [ ":googletest" ]
if (crashpad_is_clang) {
cflags_cc = [
# For googletest/googlemock/test/gmock-matchers_test.ccs
# Unstreamable::value_.
"-Wno-unused-private-field",
]
}
}
test("gtest_premature_exit_test") {
sources = [ "googletest/googletest/test/gtest_premature_exit_test.cc" ]
deps = [ ":googletest" ]
}
test("gtest_repeat_test") {
sources = [ "googletest/googletest/test/gtest_repeat_test.cc" ]
configs += [ ":googletest_private_config" ]
deps = [ ":googletest" ]
}
test("gtest_skip_in_environment_setup_test") {
sources =
[ "googletest/googletest/test/gtest_skip_in_environment_setup_test.cc" ]
deps = [ ":googletest" ]
}
test("gtest_sole_header_test") {
sources = [ "googletest/googletest/test/gtest_sole_header_test.cc" ]
deps = [
":googletest",
":googletest_main",
]
}
test("gtest_stress_test") {
sources = [ "googletest/googletest/test/gtest_stress_test.cc" ]
configs += [ ":googletest_private_config" ]
deps = [ ":googletest" ]
}
test("gtest_unittest_api_test") {
sources = [ "googletest/googletest/test/gtest-unittest-api_test.cc" ]
deps = [ ":googletest" ]
}
group("googletest_all_tests") {
testonly = true
deps = [
":gtest_all_test",
":gtest_environment_test",
":gtest_listener_test",
":gtest_macro_stack_footprint_test",
":gtest_no_test",
":gtest_param_test",
":gtest_premature_exit_test",
":gtest_repeat_test",
":gtest_skip_in_environment_setup_test",
":gtest_sole_header_test",
":gtest_stress_test",
":gtest_unittest_api_test",
]
}
config("googlemock_private_config") {
visibility = [ ":*" ]
include_dirs = [ "googletest/googlemock" ]
}
config("googlemock_public_config") {
include_dirs = [ "googletest/googlemock/include" ]
if (crashpad_is_clang) {
cflags_cc = [
# The MOCK_METHODn() macros do not specify “override”, which triggers
# this warning in users: “error: 'Method' overrides a member function
# but is not marked 'override'
# [-Werror,-Winconsistent-missing-override]”. Suppress these warnings
# until https://github.com/google/googletest/issues/533 is fixed.
"-Wno-inconsistent-missing-override",
]
}
}
static_library("googlemock") {
testonly = true
sources = [
"googletest/googlemock/include/gmock/gmock-actions.h",
"googletest/googlemock/include/gmock/gmock-cardinalities.h",
"googletest/googlemock/include/gmock/gmock-function-mocker.h",
"googletest/googlemock/include/gmock/gmock-generated-actions.h",
"googletest/googlemock/include/gmock/gmock-matchers.h",
"googletest/googlemock/include/gmock/gmock-more-actions.h",
"googletest/googlemock/include/gmock/gmock-more-matchers.h",
"googletest/googlemock/include/gmock/gmock-nice-strict.h",
"googletest/googlemock/include/gmock/gmock-spec-builders.h",
"googletest/googlemock/include/gmock/gmock.h",
"googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h",
"googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h",
"googletest/googlemock/include/gmock/internal/custom/gmock-port.h",
"googletest/googlemock/include/gmock/internal/gmock-internal-utils.h",
"googletest/googlemock/include/gmock/internal/gmock-port.h",
"googletest/googlemock/include/gmock/internal/gmock-pp.h",
"googletest/googlemock/src/gmock-all.cc",
"googletest/googlemock/src/gmock-cardinalities.cc",
"googletest/googlemock/src/gmock-internal-utils.cc",
"googletest/googlemock/src/gmock-matchers.cc",
"googletest/googlemock/src/gmock-spec-builders.cc",
"googletest/googlemock/src/gmock.cc",
]
sources -= [ "googletest/googlemock/src/gmock-all.cc" ]
public_configs = [ ":googlemock_public_config" ]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":googlemock_private_config" ]
deps = [ ":googletest" ]
}
static_library("googlemock_main") {
# Tests outside of this file should use ../../test:googlemock_main instead.
visibility = [ ":*" ]
testonly = true
sources = [ "googletest/googlemock/src/gmock_main.cc" ]
deps = [
":googlemock",
":googletest",
]
}
test("gmock_all_test") {
sources = [
"googletest/googlemock/test/gmock-actions_test.cc",
"googletest/googlemock/test/gmock-cardinalities_test.cc",
"googletest/googlemock/test/gmock-function-mocker_test.cc",
"googletest/googlemock/test/gmock-generated-actions_test.cc",
"googletest/googlemock/test/gmock-generated-matchers_test.cc",
"googletest/googlemock/test/gmock-internal-utils_test.cc",
"googletest/googlemock/test/gmock-matchers_test.cc",
"googletest/googlemock/test/gmock-more-actions_test.cc",
"googletest/googlemock/test/gmock-nice-strict_test.cc",
"googletest/googlemock/test/gmock-port_test.cc",
"googletest/googlemock/test/gmock-pp-string_test.cc",
"googletest/googlemock/test/gmock-pp_test.cc",
"googletest/googlemock/test/gmock-spec-builders_test.cc",
"googletest/googlemock/test/gmock_test.cc",
]
configs += [
":googlemock_private_config",
":googletest_private_config",
]
deps = [
":googlemock",
":googlemock_main",
":googletest",
]
if (crashpad_is_clang) {
cflags_cc = [
# For googletest/googlemock/test/gmock-matchers_test.ccs
# testing::googlemock_matchers_test::Unprintable::c_.
"-Wno-unused-private-field",
]
}
}
test("gmock_link_test") {
sources = [
"googletest/googlemock/test/gmock_link2_test.cc",
"googletest/googlemock/test/gmock_link_test.cc",
"googletest/googlemock/test/gmock_link_test.h",
]
configs += [ ":googlemock_private_config" ]
deps = [
":googlemock",
":googlemock_main",
":googletest",
]
}
test("gmock_stress_test") {
sources = [ "googletest/googlemock/test/gmock_stress_test.cc" ]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":googlemock_private_config" ]
deps = [
":googlemock",
":googletest",
]
}
group("googlemock_all_tests") {
testonly = true
deps = [
":gmock_all_test",
":gmock_link_test",
":gmock_stress_test",
]
}
}

View File

@ -1,9 +1,9 @@
Name: Google Test (googletest)
Short Name: gtest
Name: Google Test
Short Name: googletest
URL: https://github.com/google/googletest/
Revision: See DEPS
License: BSD 3-clause
License File: gtest/googletest/LICENSE
License File: googletest/googletest/LICENSE
Security Critical: no
Description:

View File

@ -21,17 +21,17 @@
'variables': {
'conditions': [
['crashpad_dependencies=="standalone"', {
'gmock_dir': 'gtest/googlemock',
'googlemock_dir': 'googletest/googlemock',
}],
['crashpad_dependencies=="external"', {
'gmock_dir': '../../../../gmock',
'googlemock_dir': '../../../../googlemock',
}],
],
},
}],
],
'target_defaults': {
# gmock relies heavily on objects with static storage duration.
# Google Mock relies heavily on objects with static storage duration.
'xcode_settings': {
'WARNING_CFLAGS!': [
'-Wexit-time-destructors',
@ -44,47 +44,47 @@
'targets': [
{
'target_name': 'gmock',
'target_name': 'googlemock',
'type': 'static_library',
'dependencies': [
'gtest.gyp:gtest',
'googletest.gyp:googletest',
],
'include_dirs': [
'<(gmock_dir)',
'<(gmock_dir)/include',
'<(googlemock_dir)',
'<(googlemock_dir)/include',
],
'sources': [
'<(gmock_dir)/include/gmock/gmock-actions.h',
'<(gmock_dir)/include/gmock/gmock-cardinalities.h',
'<(gmock_dir)/include/gmock/gmock-function-mocker.h',
'<(gmock_dir)/include/gmock/gmock-generated-actions.h',
'<(gmock_dir)/include/gmock/gmock-matchers.h',
'<(gmock_dir)/include/gmock/gmock-more-actions.h',
'<(gmock_dir)/include/gmock/gmock-more-matchers.h',
'<(gmock_dir)/include/gmock/gmock-nice-strict.h',
'<(gmock_dir)/include/gmock/gmock-spec-builders.h',
'<(gmock_dir)/include/gmock/gmock.h',
'<(gmock_dir)/include/gmock/internal/custom/gmock-generated-actions.h',
'<(gmock_dir)/include/gmock/internal/custom/gmock-matchers.h',
'<(gmock_dir)/include/gmock/internal/custom/gmock-port.h',
'<(gmock_dir)/include/gmock/internal/custom/gmock-pp.h',
'<(gmock_dir)/include/gmock/internal/gmock-generated-internal-utils.h',
'<(gmock_dir)/include/gmock/internal/gmock-internal-utils.h',
'<(gmock_dir)/include/gmock/internal/gmock-port.h',
'<(gmock_dir)/src/gmock-all.cc',
'<(gmock_dir)/src/gmock-cardinalities.cc',
'<(gmock_dir)/src/gmock-internal-utils.cc',
'<(gmock_dir)/src/gmock-matchers.cc',
'<(gmock_dir)/src/gmock-spec-builders.cc',
'<(gmock_dir)/src/gmock.cc',
'<(googlemock_dir)/include/gmock/gmock-actions.h',
'<(googlemock_dir)/include/gmock/gmock-cardinalities.h',
'<(googlemock_dir)/include/gmock/gmock-function-mocker.h',
'<(googlemock_dir)/include/gmock/gmock-generated-actions.h',
'<(googlemock_dir)/include/gmock/gmock-matchers.h',
'<(googlemock_dir)/include/gmock/gmock-more-actions.h',
'<(googlemock_dir)/include/gmock/gmock-more-matchers.h',
'<(googlemock_dir)/include/gmock/gmock-nice-strict.h',
'<(googlemock_dir)/include/gmock/gmock-spec-builders.h',
'<(googlemock_dir)/include/gmock/gmock.h',
'<(googlemock_dir)/include/gmock/internal/custom/gmock-generated-actions.h',
'<(googlemock_dir)/include/gmock/internal/custom/gmock-matchers.h',
'<(googlemock_dir)/include/gmock/internal/custom/gmock-port.h',
'<(googlemock_dir)/include/gmock/internal/custom/gmock-pp.h',
'<(googlemock_dir)/include/gmock/internal/gmock-generated-internal-utils.h',
'<(googlemock_dir)/include/gmock/internal/gmock-internal-utils.h',
'<(googlemock_dir)/include/gmock/internal/gmock-port.h',
'<(googlemock_dir)/src/gmock-all.cc',
'<(googlemock_dir)/src/gmock-cardinalities.cc',
'<(googlemock_dir)/src/gmock-internal-utils.cc',
'<(googlemock_dir)/src/gmock-matchers.cc',
'<(googlemock_dir)/src/gmock-spec-builders.cc',
'<(googlemock_dir)/src/gmock.cc',
],
'sources!': [
'<(gmock_dir)/src/gmock-all.cc',
'<(googlemock_dir)/src/gmock-all.cc',
],
'direct_dependent_settings': {
'include_dirs': [
'<(gmock_dir)/include',
'<(googlemock_dir)/include',
],
'conditions': [
['clang!=0', {
@ -112,66 +112,66 @@
],
},
'export_dependent_settings': [
'gtest.gyp:gtest',
'googletest.gyp:googletest',
],
},
{
'target_name': 'gmock_main',
'target_name': 'googlemock_main',
'type': 'static_library',
'dependencies': [
'gmock',
'gtest.gyp:gtest',
'googlemock',
'googletest.gyp:googletest',
],
'sources': [
'<(gmock_dir)/src/gmock_main.cc',
'<(googlemock_dir)/src/gmock_main.cc',
],
},
{
'target_name': 'gmock_test_executable',
'target_name': 'googlemock_test_executable',
'type': 'none',
'dependencies': [
'gmock',
'gtest.gyp:gtest',
'googlemock',
'googletest.gyp:googletest',
],
'direct_dependent_settings': {
'type': 'executable',
'include_dirs': [
'<(gmock_dir)',
'<(googlemock_dir)',
],
},
'export_dependent_settings': [
'gmock',
'gtest.gyp:gtest',
'googlemock',
'googletest.gyp:googletest',
],
},
{
'target_name': 'gmock_all_test',
'dependencies': [
'gmock_test_executable',
'gmock_main',
'googlemock_test_executable',
'googlemock_main',
],
'include_dirs': [
'gtest/googletest',
'googletest/googletest',
],
'sources': [
'<(gmock_dir)/test/gmock-actions_test.cc',
'<(gmock_dir)/test/gmock-cardinalities_test.cc',
'<(gmock_dir)/test/gmock-function-mocker_test.cc',
'<(gmock_dir)/test/gmock-generated-actions_test.cc',
'<(gmock_dir)/test/gmock-generated-matchers_test.cc',
'<(gmock_dir)/test/gmock-internal-utils_test.cc',
'<(gmock_dir)/test/gmock-matchers_test.cc',
'<(gmock_dir)/test/gmock-more-actions_test.cc',
'<(gmock_dir)/test/gmock-nice-strict_test.cc',
'<(gmock_dir)/test/gmock-port_test.cc',
'<(gmock_dir)/test/gmock-pp-string_test.cc',
'<(gmock_dir)/test/gmock-pp_test.cc',
'<(gmock_dir)/test/gmock-spec-builders_test.cc',
'<(gmock_dir)/test/gmock_test.cc',
'<(googlemock_dir)/test/gmock-actions_test.cc',
'<(googlemock_dir)/test/gmock-cardinalities_test.cc',
'<(googlemock_dir)/test/gmock-function-mocker_test.cc',
'<(googlemock_dir)/test/gmock-generated-actions_test.cc',
'<(googlemock_dir)/test/gmock-generated-matchers_test.cc',
'<(googlemock_dir)/test/gmock-internal-utils_test.cc',
'<(googlemock_dir)/test/gmock-matchers_test.cc',
'<(googlemock_dir)/test/gmock-more-actions_test.cc',
'<(googlemock_dir)/test/gmock-nice-strict_test.cc',
'<(googlemock_dir)/test/gmock-port_test.cc',
'<(googlemock_dir)/test/gmock-pp-string_test.cc',
'<(googlemock_dir)/test/gmock-pp_test.cc',
'<(googlemock_dir)/test/gmock-spec-builders_test.cc',
'<(googlemock_dir)/test/gmock_test.cc',
],
'conditions': [
['clang!=0', {
# For gtest/googlemock/test/gmock-matchers_test.ccs
# For googletest/googlemock/test/gmock-matchers_test.ccs
# Unstreamable::value_.
'conditions': [
['OS=="mac"', {
@ -193,26 +193,26 @@
{
'target_name': 'gmock_link_test',
'dependencies': [
'gmock_test_executable',
'gmock_main',
'googlemock_test_executable',
'googlemock_main',
],
'sources': [
'<(gmock_dir)/test/gmock_link_test.cc',
'<(gmock_dir)/test/gmock_link_test.h',
'<(gmock_dir)/test/gmock_link2_test.cc',
'<(googlemock_dir)/test/gmock_link_test.cc',
'<(googlemock_dir)/test/gmock_link_test.h',
'<(googlemock_dir)/test/gmock_link2_test.cc',
],
},
{
'target_name': 'gmock_stress_test',
'dependencies': [
'gmock_test_executable',
'googlemock_test_executable',
],
'sources': [
'<(gmock_dir)/test/gmock_stress_test.cc',
'<(googlemock_dir)/test/gmock_stress_test.cc',
],
},
{
'target_name': 'gmock_all_tests',
'target_name': 'googlemock_all_tests',
'type': 'none',
'dependencies': [
'gmock_all_test',

323
third_party/googletest/googletest.gyp vendored Normal file
View File

@ -0,0 +1,323 @@
# Copyright 2014 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
'includes': [
'../../build/crashpad_dependencies.gypi',
],
'conditions': [
['1==1', { # Defer processing until crashpad_dependencies is set
'variables': {
'conditions': [
['crashpad_dependencies=="standalone"', {
'googletest_dir': 'googletest/googletest',
}],
['crashpad_dependencies=="external"', {
'googletest_dir': '../../../../googletest',
}],
],
},
}],
],
'target_defaults': {
# googletest relies heavily on objects with static storage duration.
'xcode_settings': {
'WARNING_CFLAGS!': [
'-Wexit-time-destructors',
],
},
'cflags!': [
'-Wexit-time-destructors',
],
'conditions': [
['OS=="android" and android_api_level!="" and android_api_level<24', {
'defines!': [
# Although many system interfaces are available to 32-bit code with
# 64-bit off_t at API 21, the routines in <stdio.h> are not until API
# 24. googletest doesnt make use of these functions directly, but can
# reach them indirectly via the C++ standard library. Disable 64-bit
# off_t prior to API 24 so that these uses can work. Since nothing
# dependent on the size of off_t should escape googletests own API, this
# should be safe even in a program that otherwise uses a 64-bit off_t.
'_FILE_OFFSET_BITS=64',
],
}],
],
},
'targets': [
{
'target_name': 'googletest',
'type': 'static_library',
'include_dirs': [
'<(googletest_dir)',
'<(googletest_dir)/include',
],
'sources': [
'<(googletest_dir)/include/gtest/gtest-death-test.h',
'<(googletest_dir)/include/gtest/gtest-matchers.h',
'<(googletest_dir)/include/gtest/gtest-message.h',
'<(googletest_dir)/include/gtest/gtest-param-test.h',
'<(googletest_dir)/include/gtest/gtest-printers.h',
'<(googletest_dir)/include/gtest/gtest-spi.h',
'<(googletest_dir)/include/gtest/gtest-test-part.h',
'<(googletest_dir)/include/gtest/gtest-typed-test.h',
'<(googletest_dir)/include/gtest/gtest.h',
'<(googletest_dir)/include/gtest/gtest_pred_impl.h',
'<(googletest_dir)/include/gtest/gtest_prod.h',
'<(googletest_dir)/include/gtest/internal/custom/gtest-port.h',
'<(googletest_dir)/include/gtest/internal/custom/gtest-printers.h',
'<(googletest_dir)/include/gtest/internal/custom/gtest.h',
'<(googletest_dir)/include/gtest/internal/gtest-death-test-internal.h',
'<(googletest_dir)/include/gtest/internal/gtest-filepath.h',
'<(googletest_dir)/include/gtest/internal/gtest-internal.h',
'<(googletest_dir)/include/gtest/internal/gtest-param-util-generated.h',
'<(googletest_dir)/include/gtest/internal/gtest-param-util.h',
'<(googletest_dir)/include/gtest/internal/gtest-port-arch.h',
'<(googletest_dir)/include/gtest/internal/gtest-port.h',
'<(googletest_dir)/include/gtest/internal/gtest-string.h',
'<(googletest_dir)/include/gtest/internal/gtest-type-util.h',
'<(googletest_dir)/src/gtest-all.cc',
'<(googletest_dir)/src/gtest-death-test.cc',
'<(googletest_dir)/src/gtest-filepath.cc',
'<(googletest_dir)/src/gtest-internal-inl.h',
'<(googletest_dir)/src/gtest-matchers.cc',
'<(googletest_dir)/src/gtest-port.cc',
'<(googletest_dir)/src/gtest-printers.cc',
'<(googletest_dir)/src/gtest-test-part.cc',
'<(googletest_dir)/src/gtest-typed-test.cc',
'<(googletest_dir)/src/gtest.cc',
],
'sources!': [
'<(googletest_dir)/src/gtest-all.cc',
],
'direct_dependent_settings': {
'include_dirs': [
'<(googletest_dir)/include',
],
},
'conditions': [
['crashpad_dependencies=="external"', {
'include_dirs': [
'<(googletest_dir)/../..',
],
'defines': [
'GUNIT_NO_GOOGLE3=1',
],
'direct_dependent_settings': {
'include_dirs': [
'<(googletest_dir)/../..',
],
'defines': [
'GUNIT_NO_GOOGLE3=1',
],
},
}],
],
},
{
'target_name': 'googletest_main',
'type': 'static_library',
'dependencies': [
'googletest',
],
'sources': [
'<(googletest_dir)/src/gtest_main.cc',
],
},
{
'target_name': 'googletest_test_executable',
'type': 'none',
'dependencies': [
'googletest',
],
'direct_dependent_settings': {
'type': 'executable',
'include_dirs': [
'<(googletest_dir)',
],
},
'export_dependent_settings': [
'googletest',
],
},
{
'target_name': 'gtest_all_test',
'dependencies': [
'googletest_test_executable',
'googletest_main',
],
'sources': [
'<(googletest_dir)/test/googletest-death-test-test.cc',
'<(googletest_dir)/test/googletest-filepath-test.cc',
'<(googletest_dir)/test/googletest-message-test.cc',
'<(googletest_dir)/test/googletest-options-test.cc',
'<(googletest_dir)/test/googletest-port-test.cc',
'<(googletest_dir)/test/googletest-printers-testcc',
'<(googletest_dir)/test/googletest-test-part-test.cc',
'<(googletest_dir)/test/gtest-typed-test2_test.cc',
'<(googletest_dir)/test/gtest-typed-test_test.cc',
'<(googletest_dir)/test/gtest-typed-test_test.h',
'<(googletest_dir)/test/gtest_main_unittest.cc',
'<(googletest_dir)/test/gtest_pred_impl_unittest.cc',
'<(googletest_dir)/test/gtest_prod_test.cc',
'<(googletest_dir)/test/gtest_skip_test.cc',
'<(googletest_dir)/test/gtest_unittest.cc',
'<(googletest_dir)/test/production.cc',
'<(googletest_dir)/test/production.h',
],
},
{
'target_name': 'gtest_environment_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_environment_test.cc',
],
},
{
'target_name': 'gtest_listener_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/googletest-listener-test.cc',
],
},
{
'target_name': 'gtest_macro_stack_footprint_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_test_macro_stack_footprint_test.cc',
],
},
{
'target_name': 'gtest_no_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_no_test_unittest.cc',
],
},
{
'target_name': 'gtest_param_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/googletest-param-test-test.cc',
'<(googletest_dir)/test/googletest-param-test-test.h',
'<(googletest_dir)/test/googletest-param-test2-test.cc',
],
'conditions': [
['clang!=0', {
# For googletest/googlemock/test/gmock-matchers_test.ccs
# Unstreamable::value_.
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wno-unused-private-field',
],
},
}],
['OS=="linux" or OS=="android"', {
'cflags': [
'-Wno-unused-private-field',
],
}],
],
}],
],
},
{
'target_name': 'gtest_premature_exit_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_premature_exit_test.cc',
],
},
{
'target_name': 'gtest_repeat_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_repeat_test.cc',
],
},
{
'target_name': 'gtest_skip_in_environment_setup_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_skip_in_environment_setup_test.cc',
],
},
{
'target_name': 'gtest_sole_header_test',
'dependencies': [
'googletest_test_executable',
'googletest_main',
],
'sources': [
'<(googletest_dir)/test/gtest_sole_header_test.cc',
],
},
{
'target_name': 'gtest_stress_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest_stress_test.cc',
],
},
{
'target_name': 'gtest_unittest_api_test',
'dependencies': [
'googletest_test_executable',
],
'sources': [
'<(googletest_dir)/test/gtest-unittest-api_test.cc',
],
},
{
'target_name': 'googletest_all_tests',
'type': 'none',
'dependencies': [
'gtest_all_test',
'gtest_environment_test',
'gtest_listener_test',
'gtest_macro_stack_footprint_test',
'gtest_no_test',
'gtest_param_test',
'gtest_premature_exit_test',
'gtest_repeat_test',
'gtest_skip_in_environment_setup_test',
'gtest_sole_header_test',
'gtest_stress_test',
'gtest_unittest_api_test',
],
},
],
}

View File

@ -1,409 +0,0 @@
# Copyright 2017 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../build/crashpad_buildconfig.gni")
import("../../build/test.gni")
if (crashpad_is_in_chromium) {
group("gtest") {
testonly = true
public_deps = [
"//testing/gtest",
]
}
group("gmock") {
testonly = true
public_deps = [
"//testing/gmock",
]
}
} else if (crashpad_is_in_dart || crashpad_is_in_fuchsia) {
group("gtest") {
testonly = true
public_deps = [
"//third_party/googletest:gtest",
]
public_configs = [ "../..:disable_ubsan" ]
}
group("gmock") {
testonly = true
public_deps = [
"//third_party/googletest:gmock",
]
}
} else if (crashpad_is_standalone) {
config("gtest_private_config") {
visibility = [ ":*" ]
include_dirs = [ "gtest/googletest" ]
defines = [ "GUNIT_NO_GOOGLE3=1" ]
}
config("gtest_public_config") {
include_dirs = [ "gtest/googletest/include" ]
}
static_library("gtest") {
testonly = true
sources = [
"gtest/googletest/include/gtest/gtest-death-test.h",
"gtest/googletest/include/gtest/gtest-matchers.h",
"gtest/googletest/include/gtest/gtest-message.h",
"gtest/googletest/include/gtest/gtest-param-test.h",
"gtest/googletest/include/gtest/gtest-printers.h",
"gtest/googletest/include/gtest/gtest-spi.h",
"gtest/googletest/include/gtest/gtest-test-part.h",
"gtest/googletest/include/gtest/gtest-typed-test.h",
"gtest/googletest/include/gtest/gtest.h",
"gtest/googletest/include/gtest/gtest_pred_impl.h",
"gtest/googletest/include/gtest/gtest_prod.h",
"gtest/googletest/include/gtest/internal/custom/gtest-port.h",
"gtest/googletest/include/gtest/internal/custom/gtest-printers.h",
"gtest/googletest/include/gtest/internal/custom/gtest.h",
"gtest/googletest/include/gtest/internal/gtest-death-test-internal.h",
"gtest/googletest/include/gtest/internal/gtest-filepath.h",
"gtest/googletest/include/gtest/internal/gtest-internal.h",
"gtest/googletest/include/gtest/internal/gtest-param-util.h",
"gtest/googletest/include/gtest/internal/gtest-port-arch.h",
"gtest/googletest/include/gtest/internal/gtest-port.h",
"gtest/googletest/include/gtest/internal/gtest-string.h",
"gtest/googletest/include/gtest/internal/gtest-type-util.h",
"gtest/googletest/src/gtest-all.cc",
"gtest/googletest/src/gtest-death-test.cc",
"gtest/googletest/src/gtest-filepath.cc",
"gtest/googletest/src/gtest-internal-inl.h",
"gtest/googletest/src/gtest-matchers.cc",
"gtest/googletest/src/gtest-port.cc",
"gtest/googletest/src/gtest-printers.cc",
"gtest/googletest/src/gtest-test-part.cc",
"gtest/googletest/src/gtest-typed-test.cc",
"gtest/googletest/src/gtest.cc",
]
sources -= [ "gtest/googletest/src/gtest-all.cc" ]
public_configs = [ ":gtest_public_config" ]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":gtest_private_config" ]
if (crashpad_is_fuchsia) {
deps = [
"../fuchsia",
]
}
}
static_library("gtest_main") {
# Tests outside of this file should use ../../test:gtest_main instead.
visibility = [ ":*" ]
testonly = true
sources = [
"gtest/googletest/src/gtest_main.cc",
]
deps = [
":gtest",
]
}
test("gtest_all_test") {
sources = [
"gtest/googletest/test/googletest-death-test-test.cc",
"gtest/googletest/test/googletest-filepath-test.cc",
"gtest/googletest/test/googletest-message-test.cc",
"gtest/googletest/test/googletest-options-test.cc",
"gtest/googletest/test/googletest-port-test.cc",
"gtest/googletest/test/googletest-printers-test.cc",
"gtest/googletest/test/googletest-test-part-test.cc",
"gtest/googletest/test/gtest-typed-test2_test.cc",
"gtest/googletest/test/gtest-typed-test_test.cc",
"gtest/googletest/test/gtest-typed-test_test.h",
"gtest/googletest/test/gtest_main_unittest.cc",
"gtest/googletest/test/gtest_pred_impl_unittest.cc",
"gtest/googletest/test/gtest_prod_test.cc",
"gtest/googletest/test/gtest_skip_test.cc",
"gtest/googletest/test/gtest_unittest.cc",
"gtest/googletest/test/production.cc",
"gtest/googletest/test/production.h",
]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":gtest_private_config" ]
deps = [
":gtest",
":gtest_main",
]
if (crashpad_is_win) {
cflags = [ "/wd4702" ] # unreachable code
}
}
test("gtest_environment_test") {
sources = [
"gtest/googletest/test/gtest_environment_test.cc",
]
configs += [ ":gtest_private_config" ]
deps = [
":gtest",
]
}
test("gtest_listener_test") {
sources = [
"gtest/googletest/test/googletest-listener-test.cc",
]
deps = [
":gtest",
]
}
test("gtest_no_test") {
sources = [
"gtest/googletest/test/gtest_no_test_unittest.cc",
]
deps = [
":gtest",
]
}
test("gtest_param_test") {
sources = [
"gtest/googletest/test/googletest-param-test-test.cc",
"gtest/googletest/test/googletest-param-test-test.h",
"gtest/googletest/test/googletest-param-test2-test.cc",
]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":gtest_private_config" ]
deps = [
":gtest",
]
if (crashpad_is_clang) {
cflags_cc = [
# For gtest/googlemock/test/gmock-matchers_test.ccs
# Unstreamable::value_.
"-Wno-unused-private-field",
]
}
}
test("gtest_premature_exit_test") {
sources = [
"gtest/googletest/test/gtest_premature_exit_test.cc",
]
deps = [
":gtest",
]
}
test("gtest_repeat_test") {
sources = [
"gtest/googletest/test/gtest_repeat_test.cc",
]
configs += [ ":gtest_private_config" ]
deps = [
":gtest",
]
}
test("gtest_sole_header_test") {
sources = [
"gtest/googletest/test/gtest_sole_header_test.cc",
]
deps = [
":gtest",
":gtest_main",
]
}
test("gtest_stress_test") {
sources = [
"gtest/googletest/test/gtest_stress_test.cc",
]
configs += [ ":gtest_private_config" ]
deps = [
":gtest",
]
}
test("gtest_unittest_api_test") {
sources = [
"gtest/googletest/test/gtest-unittest-api_test.cc",
]
deps = [
":gtest",
]
}
group("gtest_all_tests") {
testonly = true
deps = [
":gtest_all_test",
":gtest_environment_test",
":gtest_listener_test",
":gtest_no_test",
":gtest_param_test",
":gtest_premature_exit_test",
":gtest_repeat_test",
":gtest_sole_header_test",
":gtest_stress_test",
":gtest_unittest_api_test",
]
}
config("gmock_private_config") {
visibility = [ ":*" ]
include_dirs = [ "gtest/googlemock" ]
}
config("gmock_public_config") {
include_dirs = [ "gtest/googlemock/include" ]
if (crashpad_is_clang) {
cflags_cc = [
# The MOCK_METHODn() macros do not specify “override”, which triggers
# this warning in users: “error: 'Method' overrides a member function
# but is not marked 'override'
# [-Werror,-Winconsistent-missing-override]”. Suppress these warnings
# until https://github.com/google/googletest/issues/533 is fixed.
"-Wno-inconsistent-missing-override",
]
}
}
static_library("gmock") {
testonly = true
sources = [
"gtest/googlemock/include/gmock/gmock-actions.h",
"gtest/googlemock/include/gmock/gmock-cardinalities.h",
"gtest/googlemock/include/gmock/gmock-function-mocker.h",
"gtest/googlemock/include/gmock/gmock-generated-actions.h",
"gtest/googlemock/include/gmock/gmock-matchers.h",
"gtest/googlemock/include/gmock/gmock-more-actions.h",
"gtest/googlemock/include/gmock/gmock-more-matchers.h",
"gtest/googlemock/include/gmock/gmock-nice-strict.h",
"gtest/googlemock/include/gmock/gmock-spec-builders.h",
"gtest/googlemock/include/gmock/gmock.h",
"gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h",
"gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h",
"gtest/googlemock/include/gmock/internal/custom/gmock-port.h",
"gtest/googlemock/include/gmock/internal/gmock-internal-utils.h",
"gtest/googlemock/include/gmock/internal/gmock-port.h",
"gtest/googlemock/include/gmock/internal/gmock-pp.h",
"gtest/googlemock/src/gmock-all.cc",
"gtest/googlemock/src/gmock-cardinalities.cc",
"gtest/googlemock/src/gmock-internal-utils.cc",
"gtest/googlemock/src/gmock-matchers.cc",
"gtest/googlemock/src/gmock-spec-builders.cc",
"gtest/googlemock/src/gmock.cc",
]
sources -= [ "gtest/googlemock/src/gmock-all.cc" ]
public_configs = [ ":gmock_public_config" ]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":gmock_private_config" ]
deps = [
":gtest",
]
}
static_library("gmock_main") {
# Tests outside of this file should use ../../test:gmock_main instead.
visibility = [ ":*" ]
testonly = true
sources = [
"gtest/googlemock/src/gmock_main.cc",
]
deps = [
":gmock",
":gtest",
]
}
test("gmock_all_test") {
sources = [
"gtest/googlemock/test/gmock-actions_test.cc",
"gtest/googlemock/test/gmock-cardinalities_test.cc",
"gtest/googlemock/test/gmock-function-mocker_test.cc",
"gtest/googlemock/test/gmock-generated-actions_test.cc",
"gtest/googlemock/test/gmock-generated-matchers_test.cc",
"gtest/googlemock/test/gmock-internal-utils_test.cc",
"gtest/googlemock/test/gmock-matchers_test.cc",
"gtest/googlemock/test/gmock-more-actions_test.cc",
"gtest/googlemock/test/gmock-nice-strict_test.cc",
"gtest/googlemock/test/gmock-port_test.cc",
"gtest/googlemock/test/gmock-pp-string_test.cc",
"gtest/googlemock/test/gmock-pp_test.cc",
"gtest/googlemock/test/gmock-spec-builders_test.cc",
"gtest/googlemock/test/gmock_test.cc",
]
configs += [
":gmock_private_config",
":gtest_private_config",
]
deps = [
":gmock",
":gmock_main",
":gtest",
]
if (crashpad_is_clang) {
cflags_cc = [
# For gtest/googlemock/test/gmock-matchers_test.ccs
# testing::gmock_matchers_test::Unprintable::c_.
"-Wno-unused-private-field",
]
}
}
test("gmock_link_test") {
sources = [
"gtest/googlemock/test/gmock_link2_test.cc",
"gtest/googlemock/test/gmock_link_test.cc",
"gtest/googlemock/test/gmock_link_test.h",
]
configs += [ ":gmock_private_config" ]
deps = [
":gmock",
":gmock_main",
":gtest",
]
}
test("gmock_stress_test") {
sources = [
"gtest/googlemock/test/gmock_stress_test.cc",
]
configs -= [
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
]
configs += [ ":gmock_private_config" ]
deps = [
":gmock",
":gtest",
]
}
group("gmock_all_tests") {
testonly = true
deps = [
":gmock_all_test",
":gmock_link_test",
":gmock_stress_test",
]
}
}

View File

@ -1,304 +0,0 @@
# Copyright 2014 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
'includes': [
'../../build/crashpad_dependencies.gypi',
],
'conditions': [
['1==1', { # Defer processing until crashpad_dependencies is set
'variables': {
'conditions': [
['crashpad_dependencies=="standalone"', {
'gtest_dir': 'gtest/googletest',
}],
['crashpad_dependencies=="external"', {
'gtest_dir': '../../../../gtest',
}],
],
},
}],
],
'target_defaults': {
# gtest relies heavily on objects with static storage duration.
'xcode_settings': {
'WARNING_CFLAGS!': [
'-Wexit-time-destructors',
],
},
'cflags!': [
'-Wexit-time-destructors',
],
'conditions': [
['OS=="android" and android_api_level!="" and android_api_level<24', {
'defines!': [
# Although many system interfaces are available to 32-bit code with
# 64-bit off_t at API 21, the routines in <stdio.h> are not until API
# 24. gtest doesnt make use of these functions directly, but can
# reach them indirectly via the C++ standard library. Disable 64-bit
# off_t prior to API 24 so that these uses can work. Since nothing
# dependent on the size of off_t should escape gtests own API, this
# should be safe even in a program that otherwise uses a 64-bit off_t.
'_FILE_OFFSET_BITS=64',
],
}],
],
},
'targets': [
{
'target_name': 'gtest',
'type': 'static_library',
'include_dirs': [
'<(gtest_dir)',
'<(gtest_dir)/include',
],
'sources': [
'<(gtest_dir)/include/gtest/gtest-death-test.h',
'<(gtest_dir)/include/gtest/gtest-matchers.h',
'<(gtest_dir)/include/gtest/gtest-message.h',
'<(gtest_dir)/include/gtest/gtest-param-test.h',
'<(gtest_dir)/include/gtest/gtest-printers.h',
'<(gtest_dir)/include/gtest/gtest-spi.h',
'<(gtest_dir)/include/gtest/gtest-test-part.h',
'<(gtest_dir)/include/gtest/gtest-typed-test.h',
'<(gtest_dir)/include/gtest/gtest.h',
'<(gtest_dir)/include/gtest/gtest_pred_impl.h',
'<(gtest_dir)/include/gtest/gtest_prod.h',
'<(gtest_dir)/include/gtest/internal/custom/gtest-port.h',
'<(gtest_dir)/include/gtest/internal/custom/gtest-printers.h',
'<(gtest_dir)/include/gtest/internal/custom/gtest.h',
'<(gtest_dir)/include/gtest/internal/gtest-death-test-internal.h',
'<(gtest_dir)/include/gtest/internal/gtest-filepath.h',
'<(gtest_dir)/include/gtest/internal/gtest-internal.h',
'<(gtest_dir)/include/gtest/internal/gtest-param-util-generated.h',
'<(gtest_dir)/include/gtest/internal/gtest-param-util.h',
'<(gtest_dir)/include/gtest/internal/gtest-port-arch.h',
'<(gtest_dir)/include/gtest/internal/gtest-port.h',
'<(gtest_dir)/include/gtest/internal/gtest-string.h',
'<(gtest_dir)/include/gtest/internal/gtest-type-util.h',
'<(gtest_dir)/src/gtest-all.cc',
'<(gtest_dir)/src/gtest-death-test.cc',
'<(gtest_dir)/src/gtest-filepath.cc',
'<(gtest_dir)/src/gtest-internal-inl.h',
'<(gtest_dir)/src/gtest-matchers.cc',
'<(gtest_dir)/src/gtest-port.cc',
'<(gtest_dir)/src/gtest-printers.cc',
'<(gtest_dir)/src/gtest-test-part.cc',
'<(gtest_dir)/src/gtest-typed-test.cc',
'<(gtest_dir)/src/gtest.cc',
],
'sources!': [
'<(gtest_dir)/src/gtest-all.cc',
],
'direct_dependent_settings': {
'include_dirs': [
'<(gtest_dir)/include',
],
},
'conditions': [
['crashpad_dependencies=="external"', {
'include_dirs': [
'<(gtest_dir)/../..',
],
'defines': [
'GUNIT_NO_GOOGLE3=1',
],
'direct_dependent_settings': {
'include_dirs': [
'<(gtest_dir)/../..',
],
'defines': [
'GUNIT_NO_GOOGLE3=1',
],
},
}],
],
},
{
'target_name': 'gtest_main',
'type': 'static_library',
'dependencies': [
'gtest',
],
'sources': [
'<(gtest_dir)/src/gtest_main.cc',
],
},
{
'target_name': 'gtest_test_executable',
'type': 'none',
'dependencies': [
'gtest',
],
'direct_dependent_settings': {
'type': 'executable',
'include_dirs': [
'<(gtest_dir)',
],
},
'export_dependent_settings': [
'gtest',
],
},
{
'target_name': 'gtest_all_test',
'dependencies': [
'gtest_test_executable',
'gtest_main',
],
'sources': [
'<(gtest_dir)/test/gtest-death-test_test.cc',
'<(gtest_dir)/test/gtest-filepath_test.cc',
'<(gtest_dir)/test/gtest-linked_ptr_test.cc',
'<(gtest_dir)/test/gtest-message_test.cc',
'<(gtest_dir)/test/gtest-options_test.cc',
'<(gtest_dir)/test/gtest-port_test.cc',
'<(gtest_dir)/test/gtest-printers_test.cc',
'<(gtest_dir)/test/gtest-test-part_test.cc',
'<(gtest_dir)/test/gtest-typed-test2_test.cc',
'<(gtest_dir)/test/gtest-typed-test_test.cc',
'<(gtest_dir)/test/gtest-typed-test_test.h',
'<(gtest_dir)/test/gtest_main_unittest.cc',
'<(gtest_dir)/test/gtest_pred_impl_unittest.cc',
'<(gtest_dir)/test/gtest_prod_test.cc',
'<(gtest_dir)/test/gtest_skip_test.cc',
'<(gtest_dir)/test/gtest_unittest.cc',
'<(gtest_dir)/test/production.cc',
'<(gtest_dir)/test/production.h',
],
},
{
'target_name': 'gtest_environment_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest_environment_test.cc',
],
},
{
'target_name': 'gtest_listener_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest-listener_test.cc',
],
},
{
'target_name': 'gtest_no_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest_no_test_unittest.cc',
],
},
{
'target_name': 'gtest_param_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest-param-test2_test.cc',
'<(gtest_dir)/test/gtest-param-test_test.cc',
'<(gtest_dir)/test/gtest-param-test_test.h',
],
'conditions': [
['clang!=0', {
# For gtest/googlemock/test/gmock-matchers_test.ccs
# Unstreamable::value_.
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wno-unused-private-field',
],
},
}],
['OS=="linux" or OS=="android"', {
'cflags': [
'-Wno-unused-private-field',
],
}],
],
}],
],
},
{
'target_name': 'gtest_premature_exit_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest_premature_exit_test.cc',
],
},
{
'target_name': 'gtest_repeat_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest_repeat_test.cc',
],
},
{
'target_name': 'gtest_sole_header_test',
'dependencies': [
'gtest_test_executable',
'gtest_main',
],
'sources': [
'<(gtest_dir)/test/gtest_sole_header_test.cc',
],
},
{
'target_name': 'gtest_stress_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest_stress_test.cc',
],
},
{
'target_name': 'gtest_unittest_api_test',
'dependencies': [
'gtest_test_executable',
],
'sources': [
'<(gtest_dir)/test/gtest-unittest-api_test.cc',
],
},
{
'target_name': 'gtest_all_tests',
'type': 'none',
'dependencies': [
'gtest_all_test',
'gtest_environment_test',
'gtest_listener_test',
'gtest_no_test',
'gtest_param_test',
'gtest_premature_exit_test',
'gtest_repeat_test',
'gtest_sole_header_test',
'gtest_stress_test',
'gtest_unittest_api_test',
],
},
],
}

View File

@ -85,7 +85,7 @@ if (crashpad_is_mac || crashpad_is_ios) {
# relative…
args += [
"--sdk",
rebase_path(sysroot, root_build_dir)
rebase_path(sysroot, root_build_dir),
]
} else {
# …but thats not an option in the standalone Crashpad build, where the
@ -808,8 +808,8 @@ source_set("util_test") {
"../client",
"../compat",
"../test",
"../third_party/gtest:gmock",
"../third_party/gtest:gtest",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../third_party/zlib",
]

View File

@ -40,8 +40,8 @@ namespace {
// Runs /usr/bin/sw_vers with a single argument, |argument|, and places the
// commands standard output into |output| after stripping the trailing newline.
// Fatal gtest assertions report tool failures, which the caller should check
// for with ASSERT_NO_FATAL_FAILURE() or testing::Test::HasFatalFailure().
// Fatal Google Test assertions report tool failures, which the caller should
// check for with ASSERT_NO_FATAL_FAILURE() or testing::Test::HasFatalFailure().
void SwVers(NSString* argument, std::string* output) {
@autoreleasepool {
base::scoped_nsobject<NSPipe> pipe([[NSPipe alloc] init]);

View File

@ -475,8 +475,8 @@ class MockUniversalMachExcServer : public UniversalMachExcServer::Interface {
// UniversalMachExcServer::Interface:
// CatchMachException is the method to mock, but it has 13 parameters, and
// gmock can only mock methods with up to 10 parameters. Coalesce some related
// parameters together into structs, and call a mocked method.
// Google Mock can only mock methods with up to 10 parameters. Coalesce some
// related parameters together into structs, and call a mocked method.
virtual kern_return_t CatchMachException(
exception_behavior_t behavior,
exception_handler_t exception_port,

View File

@ -53,7 +53,7 @@ namespace {
// mask, EXC_MASK_ALL | EXC_MASK_CRASH. The EXC_MASK_CRASH handlers existence
// and properties from this second lookup are validated in the same way.
//
// This function uses gtest EXPECT_* and ASSERT_* macros to perform its
// This function uses Google Test EXPECT_* and ASSERT_* macros to perform its
// validation.
void TestGetExceptionPorts(const ExceptionPorts& exception_ports,
mach_port_t expect_port,

View File

@ -46,7 +46,7 @@ using testing::WithArg;
//! \param[in] receive_right The receive right to add a send right to.
//!
//! \return The send right, which will have the same name as the receive right.
//! On failure, `MACH_PORT_NULL` with a gtest failure added.
//! On failure, `MACH_PORT_NULL` with a Google Test failure added.
mach_port_t SendRightFromReceiveRight(mach_port_t receive_right) {
kern_return_t kr = mach_port_insert_right(
mach_task_self(), receive_right, receive_right, MACH_MSG_TYPE_MAKE_SEND);
@ -63,7 +63,7 @@ mach_port_t SendRightFromReceiveRight(mach_port_t receive_right) {
//!
//! \param[in] receive_right The receive right to make a send-once right from.
//!
//! \return The send-once right. On failure, `MACH_PORT_NULL` with a gtest
//! \return The send-once right. On failure, `MACH_PORT_NULL` with a Google Test
//! failure added.
mach_port_t SendOnceRightFromReceiveRight(mach_port_t receive_right) {
mach_port_t send_once_right;
@ -89,9 +89,9 @@ mach_port_t SendOnceRightFromReceiveRight(mach_port_t receive_right) {
//!
//! This function exists to adapt `mach_port_deallocate()` to a function that
//! accepts a single argument and has no return value. It can be used with the
//! testing::Invoke() gmock action.
//! testing::Invoke() Google Mock action.
//!
//! On failure, a gtest failure will be added.
//! On failure, a Google Test failure will be added.
void MachPortDeallocate(mach_port_t port) {
kern_return_t kr = mach_port_deallocate(mach_task_self(), port);
EXPECT_EQ(kr, KERN_SUCCESS) << MachErrorMessage(kr, "mach_port_deallocate");
@ -103,7 +103,7 @@ void MachPortDeallocate(mach_port_t port) {
//! \param[in] right The right to check for.
//!
//! \return `true` if \a port has \a right, `false` otherwise. On faliure,
//! `false` with a gtest failure added.
//! `false` with a Google Test failure added.
bool IsRight(mach_port_t port, mach_port_type_t right) {
mach_port_type_t type;
kern_return_t kr = mach_port_type(mach_task_self(), port, &type);
@ -118,12 +118,12 @@ bool IsRight(mach_port_t port, mach_port_type_t right) {
//! \brief Determines whether a receive right is held for a Mach port.
//!
//! This is a special single-argument form of IsRight() for ease of use in a
//! gmock matcher.
//! Google Mock matcher.
//!
//! \param[in] port The port to check for a receive right.
//!
//! \return `true` if a receive right is held, `false` otherwise. On faliure,
//! `false` with a gtest failure added.
//! `false` with a Google Test failure added.
bool IsReceiveRight(mach_port_t port) {
return IsRight(port, MACH_PORT_TYPE_RECEIVE);
}
@ -134,7 +134,7 @@ bool IsReceiveRight(mach_port_t port) {
//! \param[in] right The port right to return the user reference count for.
//!
//! \return The user reference count for the specified port and right. On
//! failure, `-1` with a gtest failure added.
//! failure, `-1` with a Google Test failure added.
mach_port_urefs_t RightRefCount(mach_port_t port, mach_port_right_t right) {
mach_port_urefs_t refs;
kern_return_t kr = mach_port_get_refs(mach_task_self(), port, right, &refs);
@ -149,13 +149,13 @@ mach_port_urefs_t RightRefCount(mach_port_t port, mach_port_right_t right) {
//! \brief Returns the user reference count for a ports dead-name rights.
//!
//! This is a special single-argument form of RightRefCount() for ease of use in
//! a gmock matcher.
//! a Google Mock matcher.
//!
//! \param[in] port The port whose dead-name user reference count should be
//! returned.
//!
//! \return The user reference count for the ports dead-name rights. On
//! failure, `-1` with a gtest failure added.
//! failure, `-1` with a Google Test failure added.
mach_port_urefs_t DeadNameRightRefCount(mach_port_t port) {
return RightRefCount(port, MACH_PORT_RIGHT_DEAD_NAME);
}
@ -202,7 +202,8 @@ class NotifyServerTestBase : public testing::Test,
//! send-once right made from ServerPort(). Any previous send right for the
//! notification will be deallocated.
//!
//! \return `true` on success, `false` on failure with a gtest failure added.
//! \return `true` on success, `false` on failure with a Google Test failure
//! added.
bool RequestMachPortNotification(mach_port_t name,
mach_msg_id_t variant,
mach_port_mscount_t sync) {
@ -231,12 +232,12 @@ class NotifyServerTestBase : public testing::Test,
//!
//! The server will listen on ServerPort() in persistent nonblocking mode, and
//! dispatch received messages to the appropriate NotifyServer::Interface
//! method. gmock expectations check that the proper method, if any, is called
//! exactly once, and that no undesired methods are called.
//! method. Google Mock expectations check that the proper method, if any, is
//! called exactly once, and that no undesired methods are called.
//!
//! MachMessageServer::Run() is expected to return `MACH_RCV_TIMED_OUT`,
//! because it runs in persistent nonblocking mode. If it returns anything
//! else, a gtest assertion is added.
//! else, a Google Test assertion is added.
void RunServer() {
NotifyServer notify_server(this);
mach_msg_return_t mr =
@ -257,7 +258,7 @@ class NotifyServerTestBase : public testing::Test,
//!
//! \return The server port receive right, creating it if one has not yet been
//! established for the current test. On failure, returns `MACH_PORT_NULL`
//! with a gtest failure added.
//! with a Google Test failure added.
mach_port_t ServerPort() {
if (!server_port_.is_valid()) {
server_port_.reset(NewMachPort(MACH_PORT_RIGHT_RECEIVE));

View File

@ -24,9 +24,9 @@ namespace test {
//!
//! If the context structure has fields that tell whether its valid, such as
//! magic numbers or size fields, sanity-checks those fields for validity with
//! fatal gtest assertions. For other fields, where its possible to reason
//! about their validity based solely on their contents, sanity-checks via
//! nonfatal gtest assertions.
//! fatal Google Test assertions. For other fields, where its possible to
//! reason about their validity based solely on their contents, sanity-checks
//! via nonfatal Google Test assertions.
//!
//! \param[in] context The context to check.
void SanityCheckContext(const NativeCPUContext& context);

View File

@ -93,9 +93,9 @@ struct MatchCV {
};
#if defined(COMPILER_MSVC) && _MSC_VER < 1910
// gtest under MSVS 2015 (MSC 19.0) doesnt handle EXPECT_EQ(a, b) when a or b
// is a pointer to a volatile type, because it cant figure out how to print
// them.
// Google Test under MSVS 2015 (MSC 19.0) doesnt handle EXPECT_EQ(a, b) when a
// or b is a pointer to a volatile type, because it cant figure out how to
// print them.
template <typename T>
typename std::remove_volatile<typename std::remove_pointer<T>::type>::type*
MaybeRemoveVolatile(const T& value) {

View File

@ -99,7 +99,8 @@ class HTTPTransportTestFixture : public MultiprocessExec {
private:
void MultiprocessParent() override {
// Use Logging*File() instead of Checked*File() so that the test can fail
// gracefully with a gtest assertion if the child does not execute properly.
// gracefully with a Google Test assertion if the child does not execute
// properly.
// The child will write the HTTP server port number as a packed unsigned
// short to stdout.

View File

@ -131,11 +131,11 @@ void TestProcessSelfOrClone(const ProcessInfo& process_info) {
// expect_argv always contains the initial view of the arguments at the time
// the program was invoked. argv may contain this view, or it may contain the
// current view of arguments after gtest argv processing. argv may be a subset
// of expect_argv.
// current view of arguments after Google Test argv processing. argv may be a
// subset of expect_argv.
//
// gtest argv processing always leaves argv[0] intact, so this can be checked
// directly.
// Google Test argv processing always leaves argv[0] intact, so this can be
// checked directly.
ASSERT_FALSE(expect_argv.empty());
ASSERT_FALSE(argv.empty());
EXPECT_EQ(argv[0], expect_argv[0]);

View File

@ -46,12 +46,12 @@ void* BareMmap(size_t len) {
//
// The strategy taken here is that a random 64-bit cookie value is written into
// a mapped region by SetUp(). While the mapping is active, Check() should not
// crash, or for a gtest expectation, Expected() and Observed() should not crash
// and should be equal. After the region is unmapped, Check() should crash,
// either because the region has been unmapped and the address not reused, the
// address has been reused but is protected against reading (unlikely), or
// because the address has been reused but the cookie value is no longer present
// there.
// crash, or for a Google Test expectation, Expected() and Observed() should not
// crash and should be equal. After the region is unmapped, Check() should
// crash, either because the region has been unmapped and the address not
// reused, the address has been reused but is protected against reading
// (unlikely), or because the address has been reused but the cookie value is no
// longer present there.
class TestCookie {
public:
// A weird constructor for a weird class. The member variable initialization

View File

@ -37,8 +37,8 @@ TEST(ThreadLogMessages, Empty) {
}
// For a message formatted like "[preamble] message\n", returns just "message".
// If the message is not formatted as expected, a gtest expectation failure will
// be recorded and this function will return an empty string.
// If the message is not formatted as expected, a Google Test expectation
// failure will be recorded and this function will return an empty string.
std::string MessageString(const std::string& log_message) {
if (log_message.size() < 1) {
EXPECT_GE(log_message.size(), 1u);

View File

@ -24,10 +24,10 @@
'util.gyp:crashpad_util',
'../client/client.gyp:crashpad_client',
'../compat/compat.gyp:crashpad_compat',
'../test/test.gyp:crashpad_gmock_main',
'../test/test.gyp:crashpad_googlemock_main',
'../test/test.gyp:crashpad_test',
'../third_party/gtest/gmock.gyp:gmock',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/googletest/googlemock.gyp:googlemock',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/lss/lss.gyp:lss',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../third_party/zlib/zlib.gyp:zlib',

View File

@ -62,7 +62,7 @@ class ScopedExecutablePatch {
public:
// If either the constructor or destructor fails, PCHECK() to terminate
// immediately, because the process will be in a weird and untrustworthy
// state, and gtest error handling isnt worthwhile at that point.
// state, and Google Test error handling isnt worthwhile at that point.
ScopedVirtualProtectRWX(void* address, size_t size)
: address_(address), size_(size) {