blob: dbfc334c4ab773aff1109d95e959f1d7af1e56b3 [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",
Lei Zhang00721f02018-04-25 18:13:21 +000017
18 # Enables C++11 features.
Lei Zhangc5514272018-03-22 05:19:14 +000019 "GTEST_LANG_CXX11=1",
20
Lei Zhang00721f02018-04-25 18:13:21 +000021 # Prevents gtest from including both <tr1/tuple> and <tuple>.
22 "GTEST_HAS_TR1_TUPLE=0",
Lei Zhangc5514272018-03-22 05:19:14 +000023 ]
24
25 # Gtest headers need to be able to find themselves.
26 include_dirs = [ "src/googletest/include" ]
27
28 if (is_win) {
29 cflags = [ "/wd4800" ] # Unused variable warning.
30 }
31}
32
33config("gmock_config") {
34 # Gmock headers need to be able to find themselves.
35 include_dirs = [
36 "custom",
37 "src/googlemock/include",
38 ]
39}
40
41# Do NOT depend on this directly. Use //testing/gtest instead.
42# See README.chromium for details.
43source_set("gtest") {
44 testonly = true
45 sources = [
46 "src/googletest/include/gtest/gtest-death-test.h",
Felix Kauselmann25d92722019-02-12 03:57:01 +000047 "src/googletest/include/gtest/gtest-matchers.h",
Lei Zhangc5514272018-03-22 05:19:14 +000048 "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",
Felix Kauselmann25d92722019-02-12 03:57:01 +000071 "src/googletest/src/gtest-matchers.cc",
Lei Zhangc5514272018-03-22 05:19:14 +000072 "src/googletest/src/gtest-port.cc",
73 "src/googletest/src/gtest-printers.cc",
74 "src/googletest/src/gtest-test-part.cc",
75 "src/googletest/src/gtest-typed-test.cc",
76 "src/googletest/src/gtest.cc",
77 ]
78
79 # Some files include "src/gtest-internal-inl.h".
80 include_dirs = [ "src/googletest" ]
81
82 all_dependent_configs = [ ":gtest_config" ]
83
84 configs -= [ "//build/config/compiler:chromium_code" ]
85 configs += [ "//build/config/compiler:no_chromium_code" ]
86}
87
88# Do NOT depend on this directly. Use //testing/gtest:gtest_main instead.
89# See README.chromium for details.
90source_set("gtest_main") {
91 testonly = true
Lei Zhang40f9d722020-01-24 00:18:11 +000092 sources = [ "src/googletest/src/gtest_main.cc" ]
93 deps = [ ":gtest" ]
Lei Zhangc5514272018-03-22 05:19:14 +000094}
95
96# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead.
97# See README.chromium for details.
98source_set("gmock") {
99 testonly = true
100 sources = [
101 "src/googlemock/include/gmock/gmock-actions.h",
102 "src/googlemock/include/gmock/gmock-cardinalities.h",
103 "src/googlemock/include/gmock/gmock-generated-actions.h",
104 "src/googlemock/include/gmock/gmock-generated-function-mockers.h",
105 "src/googlemock/include/gmock/gmock-generated-matchers.h",
106 "src/googlemock/include/gmock/gmock-generated-nice-strict.h",
107 "src/googlemock/include/gmock/gmock-matchers.h",
108 "src/googlemock/include/gmock/gmock-spec-builders.h",
109 "src/googlemock/include/gmock/gmock.h",
110 "src/googlemock/include/gmock/internal/gmock-generated-internal-utils.h",
111 "src/googlemock/include/gmock/internal/gmock-internal-utils.h",
112 "src/googlemock/include/gmock/internal/gmock-port.h",
113
114 # gmock helpers.
115 "custom/gmock/internal/custom/gmock-port.h",
116
117 #"src/googlemock/src/gmock-all.cc", # Not needed by our build.
118 "src/googlemock/src/gmock-cardinalities.cc",
119 "src/googlemock/src/gmock-internal-utils.cc",
120 "src/googlemock/src/gmock-matchers.cc",
121 "src/googlemock/src/gmock-spec-builders.cc",
122 "src/googlemock/src/gmock.cc",
123 ]
124
125 public_configs = [
126 ":gmock_config",
127 ":gtest_config",
128 ]
129}
130
131# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead.
132# See README.chromium for details.
133static_library("gmock_main") {
134 testonly = true
Lei Zhang40f9d722020-01-24 00:18:11 +0000135 sources = [ "src/googlemock/src/gmock_main.cc" ]
136 deps = [ ":gmock" ]
Lei Zhangc5514272018-03-22 05:19:14 +0000137}