1 # Copyright 2017 Google Inc.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above
12 # copyright notice, this list of conditions and the following disclaimer
13 # in the documentation and/or other materials provided with the
15 # * Neither the name of Google Inc. nor the names of its
16 # contributors may be used to endorse or promote products derived from
17 # this software without specific prior written permission.
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 # Author: misterg@google.com (Gennadiy Civil)
33 # Bazel Build for Google C++ Testing Framework(Google Test)
35 package(default_visibility = ["//visibility:public"])
41 values = {"cpu": "x64_windows"},
45 name = "windows_msvc",
46 values = {"cpu": "x64_windows_msvc"},
51 values = {"define": "absl=1"},
54 # Google Test including Google Mock
59 "googletest/src/*.cc",
61 "googletest/include/gtest/**/*.h",
62 "googlemock/src/*.cc",
63 "googlemock/include/gmock/**/*.h",
66 "googletest/src/gtest-all.cc",
67 "googletest/src/gtest_main.cc",
68 "googlemock/src/gmock-all.cc",
69 "googlemock/src/gmock_main.cc",
73 "googletest/include/gtest/*.h",
74 "googlemock/include/gmock/*.h",
80 "//conditions:default": ["-pthread"],
88 "//conditions:default": [],
100 "//conditions:default": [
107 "@com_google_absl//absl/debugging:failure_signal_handler",
108 "@com_google_absl//absl/debugging:stacktrace",
109 "@com_google_absl//absl/debugging:symbolize",
110 "@com_google_absl//absl/strings",
111 "@com_google_absl//absl/types:optional",
112 "@com_google_absl//absl/types:variant",
114 "//conditions:default": [],
122 "googlemock/src/gmock_main.cc",
127 # The following rules build samples of how to use gTest.
129 name = "gtest_sample_lib",
131 "googletest/samples/sample1.cc",
132 "googletest/samples/sample2.cc",
133 "googletest/samples/sample4.cc",
136 "googletest/samples/prime_tables.h",
137 "googletest/samples/sample1.h",
138 "googletest/samples/sample2.h",
139 "googletest/samples/sample3-inl.h",
140 "googletest/samples/sample4.h",
145 name = "gtest_samples",
149 #sample10 (main and takes a command line option and needs to be separate)
151 "googletest/samples/sample1_unittest.cc",
152 "googletest/samples/sample2_unittest.cc",
153 "googletest/samples/sample3_unittest.cc",
154 "googletest/samples/sample4_unittest.cc",
155 "googletest/samples/sample5_unittest.cc",
156 "googletest/samples/sample6_unittest.cc",
157 "googletest/samples/sample7_unittest.cc",
158 "googletest/samples/sample8_unittest.cc",
167 name = "sample9_unittest",
169 srcs = ["googletest/samples/sample9_unittest.cc"],
174 name = "sample10_unittest",
176 srcs = ["googletest/samples/sample10_unittest.cc"],