blob: d04d8040462888462ee83ae3f05b2587e5b99ad5 [file] [log] [blame]
Lei Zhangc5514272018-03-22 05:19:14 +00001# Copyright 2018 The PDFium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5config("gtest_config") {
6 visibility = [ ":*" ] # gmock also shares this config.
7
8 defines = [
9 # Chromium always links googletest statically, so no API qualifier is
10 # necessary. The definition in gtest-port.h at the time of this writing
11 # causes crashes in content_browsertests.
12 "GTEST_API_=",
13
14 # In order to allow regex matches in gtest to be shared between Windows
15 # and other systems, we tell gtest to always use its internal engine.
16 "GTEST_HAS_POSIX_RE=0",
17 "GTEST_LANG_CXX11=1",
18
19 # ::testing::Combine, which is heavily used in Chromium, is gated on
20 # tr1::tuple. Upstream avoids using tr1::tuple on Visual Studio 2017+,
21 # because it causes warnings. We'll take (and ignore) the warnings to keep
22 # our ::testing::Combine.
23 "GTEST_HAS_TR1_TUPLE=1",
24 ]
25
26 # Gtest headers need to be able to find themselves.
27 include_dirs = [ "src/googletest/include" ]
28
29 if (is_win) {
30 cflags = [ "/wd4800" ] # Unused variable warning.
31 }
32}
33
34config("gmock_config") {
35 # Gmock headers need to be able to find themselves.
36 include_dirs = [
37 "custom",
38 "src/googlemock/include",
39 ]
40}
41
42# Do NOT depend on this directly. Use //testing/gtest instead.
43# See README.chromium for details.
44source_set("gtest") {
45 testonly = true
46 sources = [
47 "src/googletest/include/gtest/gtest-death-test.h",
48 "src/googletest/include/gtest/gtest-message.h",
49 "src/googletest/include/gtest/gtest-param-test.h",
50 "src/googletest/include/gtest/gtest-printers.h",
51 "src/googletest/include/gtest/gtest-spi.h",
52 "src/googletest/include/gtest/gtest-test-part.h",
53 "src/googletest/include/gtest/gtest-typed-test.h",
54 "src/googletest/include/gtest/gtest.h",
55 "src/googletest/include/gtest/gtest_pred_impl.h",
56 "src/googletest/include/gtest/internal/gtest-death-test-internal.h",
57 "src/googletest/include/gtest/internal/gtest-filepath.h",
58 "src/googletest/include/gtest/internal/gtest-internal.h",
59 "src/googletest/include/gtest/internal/gtest-linked_ptr.h",
60 "src/googletest/include/gtest/internal/gtest-param-util-generated.h",
61 "src/googletest/include/gtest/internal/gtest-param-util.h",
62 "src/googletest/include/gtest/internal/gtest-port.h",
63 "src/googletest/include/gtest/internal/gtest-string.h",
64 "src/googletest/include/gtest/internal/gtest-tuple.h",
65 "src/googletest/include/gtest/internal/gtest-type-util.h",
66
67 #"src/googletest/src/gtest-all.cc", # Not needed by our build.
68 "src/googletest/src/gtest-death-test.cc",
69 "src/googletest/src/gtest-filepath.cc",
70 "src/googletest/src/gtest-internal-inl.h",
71 "src/googletest/src/gtest-port.cc",
72 "src/googletest/src/gtest-printers.cc",
73 "src/googletest/src/gtest-test-part.cc",
74 "src/googletest/src/gtest-typed-test.cc",
75 "src/googletest/src/gtest.cc",
76 ]
77
78 # Some files include "src/gtest-internal-inl.h".
79 include_dirs = [ "src/googletest" ]
80
81 all_dependent_configs = [ ":gtest_config" ]
82
83 configs -= [ "//build/config/compiler:chromium_code" ]
84 configs += [ "//build/config/compiler:no_chromium_code" ]
85}
86
87# Do NOT depend on this directly. Use //testing/gtest:gtest_main instead.
88# See README.chromium for details.
89source_set("gtest_main") {
90 testonly = true
91 sources = [
92 "src/googletest/src/gtest_main.cc",
93 ]
94 deps = [
95 ":gtest",
96 ]
97}
98
99# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead.
100# See README.chromium for details.
101source_set("gmock") {
102 testonly = true
103 sources = [
104 "src/googlemock/include/gmock/gmock-actions.h",
105 "src/googlemock/include/gmock/gmock-cardinalities.h",
106 "src/googlemock/include/gmock/gmock-generated-actions.h",
107 "src/googlemock/include/gmock/gmock-generated-function-mockers.h",
108 "src/googlemock/include/gmock/gmock-generated-matchers.h",
109 "src/googlemock/include/gmock/gmock-generated-nice-strict.h",
110 "src/googlemock/include/gmock/gmock-matchers.h",
111 "src/googlemock/include/gmock/gmock-spec-builders.h",
112 "src/googlemock/include/gmock/gmock.h",
113 "src/googlemock/include/gmock/internal/gmock-generated-internal-utils.h",
114 "src/googlemock/include/gmock/internal/gmock-internal-utils.h",
115 "src/googlemock/include/gmock/internal/gmock-port.h",
116
117 # gmock helpers.
118 "custom/gmock/internal/custom/gmock-port.h",
119
120 #"src/googlemock/src/gmock-all.cc", # Not needed by our build.
121 "src/googlemock/src/gmock-cardinalities.cc",
122 "src/googlemock/src/gmock-internal-utils.cc",
123 "src/googlemock/src/gmock-matchers.cc",
124 "src/googlemock/src/gmock-spec-builders.cc",
125 "src/googlemock/src/gmock.cc",
126 ]
127
128 public_configs = [
129 ":gmock_config",
130 ":gtest_config",
131 ]
132}
133
134# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead.
135# See README.chromium for details.
136static_library("gmock_main") {
137 testonly = true
138 sources = [
139 "src/googlemock/src/gmock_main.cc",
140 ]
141 deps = [
142 ":gmock",
143 ]
144}