• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14config("gtest_private_config") {
15  visibility = [ ":*" ]
16  include_dirs = [ "googletest" ]
17}
18
19config("gtest_config") {
20  include_dirs = [ "googletest/include" ]
21}
22
23static_library("gtest") {
24  testonly = true
25  public = [
26    "googletest/include/gtest/gtest-spi.h",
27    "googletest/include/gtest/gtest.h",
28  ]
29
30  cflags = [
31    "-Wno-inconsistent-missing-override",
32    "-fprofile-arcs",
33    "-ftest-coverage",
34    "-Wno-unused-command-line-argument",
35    "-Wno-format",
36    "-Wno-unused-const-variable",
37    "-Wno-unused-variable",
38    "-Wno-used-but-marked-unused",
39    "-Wno-exit-time-destructors",
40    "-Wno-missing-noreturn",
41    "-Wno-missing-noreturn",
42  ]
43  sources = [
44    "googletest/include/gtest/gtest-death-test.h",
45    "googletest/include/gtest/gtest-message.h",
46    "googletest/include/gtest/gtest-param-test.h",
47    "googletest/include/gtest/gtest-printers.h",
48    "googletest/include/gtest/gtest-test-part.h",
49    "googletest/include/gtest/gtest-typed-test.h",
50    "googletest/include/gtest/gtest_pred_impl.h",
51    "googletest/include/gtest/gtest_prod.h",
52    "googletest/include/gtest/hwext/gtest-ext.h",
53    "googletest/include/gtest/hwext/gtest-filter.h",
54    "googletest/include/gtest/hwext/gtest-tag.h",
55    "googletest/include/gtest/hwext/utils.h",
56    "googletest/include/gtest/internal/custom/gtest-port.h",
57    "googletest/include/gtest/internal/custom/gtest-printers.h",
58    "googletest/include/gtest/internal/custom/gtest.h",
59    "googletest/include/gtest/internal/gtest-death-test-internal.h",
60    "googletest/include/gtest/internal/gtest-filepath.h",
61    "googletest/include/gtest/internal/gtest-internal.h",
62    "googletest/include/gtest/internal/gtest-linked_ptr.h",
63    "googletest/include/gtest/internal/gtest-param-util-generated.h",
64    "googletest/include/gtest/internal/gtest-param-util.h",
65    "googletest/include/gtest/internal/gtest-port-arch.h",
66    "googletest/include/gtest/internal/gtest-port.h",
67    "googletest/include/gtest/internal/gtest-string.h",
68    "googletest/include/gtest/internal/gtest-tuple.h",
69    "googletest/include/gtest/internal/gtest-type-util.h",
70    "googletest/src/gtest-all.cc",
71    "googletest/src/gtest-death-test.cc",
72    "googletest/src/gtest-filepath.cc",
73    "googletest/src/gtest-internal-inl.h",
74    "googletest/src/gtest-port.cc",
75    "googletest/src/gtest-printers.cc",
76    "googletest/src/gtest-test-part.cc",
77    "googletest/src/gtest-typed-test.cc",
78    "googletest/src/gtest.cc",
79    "googletest/src/hwext/gtest-ext.cc",
80    "googletest/src/hwext/gtest-filter.cc",
81    "googletest/src/hwext/gtest-tag.cc",
82    "googletest/src/hwext/gtest-utils.cc",
83  ]
84  sources -= [ "googletest/src/gtest-all.cc" ]
85  public_configs = [ ":gtest_config" ]
86  configs += [ ":gtest_private_config" ]
87}
88
89static_library("gtest_main") {
90  testonly = true
91  sources = [ "googletest/src/gtest_main.cc" ]
92
93  cflags = [
94    "-Wno-inconsistent-missing-override",
95    "-fprofile-arcs",
96    "-ftest-coverage",
97    "-Wno-unused-command-line-argument",
98    "-Wno-format",
99    "-Wno-unused-const-variable",
100    "-Wno-unused-variable",
101    "-Wno-used-but-marked-unused",
102    "-Wno-exit-time-destructors",
103    "-Wno-missing-noreturn",
104  ]
105  public_deps = [ ":gtest" ]
106}
107
108config("gmock_private_config") {
109  visibility = [ ":*" ]
110  include_dirs = [ "googlemock" ]
111}
112
113config("gmock_config") {
114  include_dirs = [ "googlemock/include" ]
115
116  cflags_cc = [
117    # The MOCK_METHODn() macros do not specify "override", which triggers this
118    # warning in users: "error: 'Method' overrides a member function but is not
119    # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress
120    # these warnings until https://github.com/google/googletest/issues/533 is
121    # fixed.
122    "-Wno-inconsistent-missing-override",
123  ]
124  cflags = [
125    "-Wno-inconsistent-missing-override",
126
127    "-fprofile-arcs",
128    "-ftest-coverage",
129    "-Wno-unused-command-line-argument",
130    "-Wno-format",
131    "-Wno-unused-const-variable",
132    "-Wno-unused-variable",
133    "-Wno-used-but-marked-unused",
134    "-Wno-exit-time-destructors",
135    "-Wno-missing-noreturn",
136  ]
137}
138
139static_library("gmock") {
140  testonly = true
141  public = [ "googlemock/include/gmock/gmock.h" ]
142  cflags = [
143    "-Wno-inconsistent-missing-override",
144
145    "-fprofile-arcs",
146    "-ftest-coverage",
147    "-Wno-unused-command-line-argument",
148    "-Wno-format",
149    "-Wno-unused-const-variable",
150    "-Wno-unused-variable",
151    "-Wno-used-but-marked-unused",
152    "-Wno-exit-time-destructors",
153    "-Wno-missing-noreturn",
154  ]
155  sources = [
156    "googlemock/include/gmock/gmock-actions.h",
157    "googlemock/include/gmock/gmock-cardinalities.h",
158    "googlemock/include/gmock/gmock-generated-actions.h",
159    "googlemock/include/gmock/gmock-generated-function-mockers.h",
160    "googlemock/include/gmock/gmock-generated-matchers.h",
161    "googlemock/include/gmock/gmock-generated-nice-strict.h",
162    "googlemock/include/gmock/gmock-matchers.h",
163    "googlemock/include/gmock/gmock-more-actions.h",
164    "googlemock/include/gmock/gmock-more-matchers.h",
165    "googlemock/include/gmock/gmock-spec-builders.h",
166    "googlemock/include/gmock/internal/custom/gmock-generated-actions.h",
167    "googlemock/include/gmock/internal/custom/gmock-matchers.h",
168    "googlemock/include/gmock/internal/custom/gmock-port.h",
169    "googlemock/include/gmock/internal/gmock-generated-internal-utils.h",
170    "googlemock/include/gmock/internal/gmock-internal-utils.h",
171    "googlemock/include/gmock/internal/gmock-port.h",
172    "googlemock/src/gmock-all.cc",
173    "googlemock/src/gmock-cardinalities.cc",
174    "googlemock/src/gmock-internal-utils.cc",
175    "googlemock/src/gmock-matchers.cc",
176    "googlemock/src/gmock-spec-builders.cc",
177    "googlemock/src/gmock.cc",
178  ]
179  sources -= [ "googlemock/src/gmock-all.cc" ]
180  public_configs = [ ":gmock_config" ]
181  configs += [ ":gmock_private_config" ]
182  deps = [ ":gtest" ]
183}
184
185static_library("gmock_main") {
186  testonly = true
187
188  cflags = [
189    "-Wno-inconsistent-missing-override",
190    "-fprofile-arcs",
191    "-ftest-coverage",
192    "-Wno-unused-command-line-argument",
193    "-Wno-format",
194    "-Wno-unused-const-variable",
195    "-Wno-unused-variable",
196    "-Wno-used-but-marked-unused",
197    "-Wno-exit-time-destructors",
198    "-Wno-missing-noreturn",
199  ]
200  sources = [ "googlemock/src/gmock_main.cc" ]
201  public_deps = [
202    ":gmock",
203    ":gtest",
204  ]
205}
206