summaryrefslogtreecommitdiff
path: root/testing/gtest
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-22 05:19:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-22 05:19:14 +0000
commitc5514276094022c62373a8a908f72754366d15e8 (patch)
tree933bb996873663c41af2bc6e6a506b6e12c93c54 /testing/gtest
parent0ad1b2e3e8e0f3bb22c5b96a9cfc9a3d011a56df (diff)
downloadpdfium-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 'testing/gtest')
-rw-r--r--testing/gtest/BUILD.gn100
-rw-r--r--testing/gtest/empty.cc3
-rw-r--r--testing/gtest/include/gtest/DEPS4
-rw-r--r--testing/gtest/include/gtest/gtest.h10
-rw-r--r--testing/gtest/include/gtest/gtest_prod.h10
5 files changed, 127 insertions, 0 deletions
diff --git a/testing/gtest/BUILD.gn b/testing/gtest/BUILD.gn
new file mode 100644
index 0000000000..4c1ce37bcd
--- /dev/null
+++ b/testing/gtest/BUILD.gn
@@ -0,0 +1,100 @@
+# 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.
+
+import("//build_overrides/gtest.gni")
+if (is_ios) {
+ import("//build/config/coverage/coverage.gni")
+ import("//build/config/ios/ios_sdk.gni")
+ import("//build/buildflag_header.gni")
+}
+
+config("gtest_direct_config") {
+ visibility = [ ":*" ]
+ defines = [ "UNIT_TEST" ]
+}
+
+# The file/directory layout of Google Test is not yet considered stable. Until
+# it stabilizes, Chromium code MUST use this target instead of reaching directly
+# into //third_party/googletest.
+static_library("gtest") {
+ testonly = true
+
+ sources = [
+ "include/gtest/gtest-death-test.h",
+ "include/gtest/gtest-message.h",
+ "include/gtest/gtest-param-test.h",
+ "include/gtest/gtest-spi.h",
+ "include/gtest/gtest.h",
+ "include/gtest/gtest_prod.h",
+
+ # This is a workaround for the issues below.
+ #
+ # 1) This target needs to be a static_library (not a source set) on Mac to
+ # avoid the build errors in
+ # https://codereview.chromium.org/2779193002#msg82.
+ # 2) A static_library must have at least one source file, to avoid build
+ # errors on Mac and Windows. https://crbug.com/710334
+ # 3) A static_library with complete_static_lib = true, which would not
+ # require adding the empty file, will result in duplicate symbols on
+ # Android. https://codereview.chromium.org/2852613002/#ps20001
+ "empty.cc",
+ ]
+ public_deps = [
+ "//third_party/googletest:gtest",
+ ]
+
+ public_configs = [ ":gtest_direct_config" ]
+
+ if (gtest_include_multiprocess) {
+ sources += [
+ "../multiprocess_func_list.cc",
+ "../multiprocess_func_list.h",
+ ]
+ }
+
+ if (gtest_include_platform_test) {
+ sources += [ "../platform_test.h" ]
+ }
+
+ if ((is_mac || is_ios) && gtest_include_objc_support) {
+ if (is_ios) {
+ set_sources_assignment_filter([])
+ }
+ sources += [
+ "../gtest_mac.h",
+ "../gtest_mac.mm",
+ ]
+ if (gtest_include_platform_test) {
+ sources += [ "../platform_test_mac.mm" ]
+ }
+ set_sources_assignment_filter(sources_assignment_filter)
+ }
+
+ if (is_ios && gtest_include_ios_coverage) {
+ sources += [
+ "../coverage_util_ios.h",
+ "../coverage_util_ios.mm",
+ ]
+ deps = [
+ ":ios_enable_coverage",
+ ]
+ }
+}
+
+# The file/directory layout of Google Test is not yet considered stable. Until
+# it stabilizes, Chromium code MUST use this target instead of reaching directly
+# into //third_party/googletest.
+source_set("gtest_main") {
+ testonly = true
+ deps = [
+ "//third_party/googletest:gtest_main",
+ ]
+}
+
+if (is_ios) {
+ buildflag_header("ios_enable_coverage") {
+ header = "ios_enable_coverage.h"
+ flags = [ "IOS_ENABLE_COVERAGE=$use_clang_coverage" ]
+ }
+}
diff --git a/testing/gtest/empty.cc b/testing/gtest/empty.cc
new file mode 100644
index 0000000000..5186b599d2
--- /dev/null
+++ b/testing/gtest/empty.cc
@@ -0,0 +1,3 @@
+// 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.
diff --git a/testing/gtest/include/gtest/DEPS b/testing/gtest/include/gtest/DEPS
new file mode 100644
index 0000000000..eb5e079aed
--- /dev/null
+++ b/testing/gtest/include/gtest/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ '+third_party/googletest/src/googletest/include/gtest',
+]
+
diff --git a/testing/gtest/include/gtest/gtest.h b/testing/gtest/include/gtest/gtest.h
new file mode 100644
index 0000000000..9425b25c15
--- /dev/null
+++ b/testing/gtest/include/gtest/gtest.h
@@ -0,0 +1,10 @@
+// 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.
+
+// The file/directory layout of Google Test is not yet considered stable. Until
+// it stabilizes, Chromium code will use forwarding headers in testing/gtest
+// and testing/gmock, instead of directly including files in
+// third_party/googletest.
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
diff --git a/testing/gtest/include/gtest/gtest_prod.h b/testing/gtest/include/gtest/gtest_prod.h
new file mode 100644
index 0000000000..2d67b42013
--- /dev/null
+++ b/testing/gtest/include/gtest/gtest_prod.h
@@ -0,0 +1,10 @@
+// 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.
+
+// The file/directory layout of Google Test is not yet considered stable. Until
+// it stabilizes, Chromium code will use forwarding headers in testing/gtest
+// and testing/gmock, instead of directly including files in
+// third_party/googletest.
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest_prod.h"