diff options
author | Lei Zhang <thestig@chromium.org> | 2018-03-22 05:19:14 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-22 05:19:14 +0000 |
commit | c5514276094022c62373a8a908f72754366d15e8 (patch) | |
tree | 933bb996873663c41af2bc6e6a506b6e12c93c54 /third_party | |
parent | 0ad1b2e3e8e0f3bb22c5b96a9cfc9a3d011a56df (diff) | |
download | pdfium-c5514276094022c62373a8a908f72754366d15e8.tar.xz |
Update gtest and gmock to 1.8.x.
This applies parts of https://crrev.com/469551 and
https://crrev.com/471303 to PDFium.
Change-Id: Ifbb8e4c300bd276fe3c6fe60d19ebb1618be8936
Reviewed-on: https://pdfium-review.googlesource.com/28791
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/googletest/BUILD.gn | 144 | ||||
-rw-r--r-- | third_party/googletest/README.pdfium | 18 |
2 files changed, 162 insertions, 0 deletions
diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn new file mode 100644 index 0000000000..d04d804046 --- /dev/null +++ b/third_party/googletest/BUILD.gn @@ -0,0 +1,144 @@ +# Copyright 2018 The PDFium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("gtest_config") { + visibility = [ ":*" ] # gmock also shares this config. + + defines = [ + # Chromium always links googletest statically, so no API qualifier is + # necessary. The definition in gtest-port.h at the time of this writing + # causes crashes in content_browsertests. + "GTEST_API_=", + + # In order to allow regex matches in gtest to be shared between Windows + # and other systems, we tell gtest to always use its internal engine. + "GTEST_HAS_POSIX_RE=0", + "GTEST_LANG_CXX11=1", + + # ::testing::Combine, which is heavily used in Chromium, is gated on + # tr1::tuple. Upstream avoids using tr1::tuple on Visual Studio 2017+, + # because it causes warnings. We'll take (and ignore) the warnings to keep + # our ::testing::Combine. + "GTEST_HAS_TR1_TUPLE=1", + ] + + # Gtest headers need to be able to find themselves. + include_dirs = [ "src/googletest/include" ] + + if (is_win) { + cflags = [ "/wd4800" ] # Unused variable warning. + } +} + +config("gmock_config") { + # Gmock headers need to be able to find themselves. + include_dirs = [ + "custom", + "src/googlemock/include", + ] +} + +# Do NOT depend on this directly. Use //testing/gtest instead. +# See README.chromium for details. +source_set("gtest") { + testonly = true + sources = [ + "src/googletest/include/gtest/gtest-death-test.h", + "src/googletest/include/gtest/gtest-message.h", + "src/googletest/include/gtest/gtest-param-test.h", + "src/googletest/include/gtest/gtest-printers.h", + "src/googletest/include/gtest/gtest-spi.h", + "src/googletest/include/gtest/gtest-test-part.h", + "src/googletest/include/gtest/gtest-typed-test.h", + "src/googletest/include/gtest/gtest.h", + "src/googletest/include/gtest/gtest_pred_impl.h", + "src/googletest/include/gtest/internal/gtest-death-test-internal.h", + "src/googletest/include/gtest/internal/gtest-filepath.h", + "src/googletest/include/gtest/internal/gtest-internal.h", + "src/googletest/include/gtest/internal/gtest-linked_ptr.h", + "src/googletest/include/gtest/internal/gtest-param-util-generated.h", + "src/googletest/include/gtest/internal/gtest-param-util.h", + "src/googletest/include/gtest/internal/gtest-port.h", + "src/googletest/include/gtest/internal/gtest-string.h", + "src/googletest/include/gtest/internal/gtest-tuple.h", + "src/googletest/include/gtest/internal/gtest-type-util.h", + + #"src/googletest/src/gtest-all.cc", # Not needed by our build. + "src/googletest/src/gtest-death-test.cc", + "src/googletest/src/gtest-filepath.cc", + "src/googletest/src/gtest-internal-inl.h", + "src/googletest/src/gtest-port.cc", + "src/googletest/src/gtest-printers.cc", + "src/googletest/src/gtest-test-part.cc", + "src/googletest/src/gtest-typed-test.cc", + "src/googletest/src/gtest.cc", + ] + + # Some files include "src/gtest-internal-inl.h". + include_dirs = [ "src/googletest" ] + + all_dependent_configs = [ ":gtest_config" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] +} + +# Do NOT depend on this directly. Use //testing/gtest:gtest_main instead. +# See README.chromium for details. +source_set("gtest_main") { + testonly = true + sources = [ + "src/googletest/src/gtest_main.cc", + ] + deps = [ + ":gtest", + ] +} + +# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead. +# See README.chromium for details. +source_set("gmock") { + testonly = true + sources = [ + "src/googlemock/include/gmock/gmock-actions.h", + "src/googlemock/include/gmock/gmock-cardinalities.h", + "src/googlemock/include/gmock/gmock-generated-actions.h", + "src/googlemock/include/gmock/gmock-generated-function-mockers.h", + "src/googlemock/include/gmock/gmock-generated-matchers.h", + "src/googlemock/include/gmock/gmock-generated-nice-strict.h", + "src/googlemock/include/gmock/gmock-matchers.h", + "src/googlemock/include/gmock/gmock-spec-builders.h", + "src/googlemock/include/gmock/gmock.h", + "src/googlemock/include/gmock/internal/gmock-generated-internal-utils.h", + "src/googlemock/include/gmock/internal/gmock-internal-utils.h", + "src/googlemock/include/gmock/internal/gmock-port.h", + + # gmock helpers. + "custom/gmock/internal/custom/gmock-port.h", + + #"src/googlemock/src/gmock-all.cc", # Not needed by our build. + "src/googlemock/src/gmock-cardinalities.cc", + "src/googlemock/src/gmock-internal-utils.cc", + "src/googlemock/src/gmock-matchers.cc", + "src/googlemock/src/gmock-spec-builders.cc", + "src/googlemock/src/gmock.cc", + ] + + public_configs = [ + ":gmock_config", + ":gtest_config", + ] +} + +# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead. +# See README.chromium for details. +static_library("gmock_main") { + testonly = true + sources = [ + "src/googlemock/src/gmock_main.cc", + ] + deps = [ + ":gmock", + ] +} diff --git a/third_party/googletest/README.pdfium b/third_party/googletest/README.pdfium new file mode 100644 index 0000000000..1b3626cf4b --- /dev/null +++ b/third_party/googletest/README.pdfium @@ -0,0 +1,18 @@ +Name: Google Test: Google's C++ Testing Framework +Short Name: googletest +URL: https://github.com/google/googletest.git +Version: 1.8.0.git-7d15497f7538fb531d0f025929d080743af421ee +License: BSD +License File: NOT_SHIPPED +Security critical: no + +Google Test is imported as-is, to facilitate version bumping. However, the +file/directory layout of Google Test is not yet considered stable. Therefore, +until Google Test's layout stabilizes, PDFium code MUST NOT depend on it +directly. Instead, PDFium code MUST: + +* #include the headers in testing/gtest and testing/gmock +* use //testing/gtest(:gtest_main) and //testing/gmock(:gmock_main) in BUILD.gn + deps + +This will allow us to adapt to Google Test changes with minimal disruption. |