Googletest export

Improve Bazel build files.

New target gtest_prod allows access to the FRIEND_TEST macro without depending on the entirety of GTest in production executables. Additionally, duplicate config_setting rules were removed and formatting was adjusted.

PiperOrigin-RevId: 220279205
This commit is contained in:
krzysio
2018-11-06 10:37:19 -05:00
committed by Gennadiy Civil
parent 529c2c6f4a
commit 105579a6e4
3 changed files with 56 additions and 117 deletions

View File

@@ -34,28 +34,19 @@
licenses(["notice"])
""" gmock own tests """
# Tests for GMock itself
cc_test(
name = "gmock_all_test",
size = "small",
srcs = glob(
include = [
"gmock-*.cc",
],
),
srcs = glob(include = ["gmock-*.cc"]),
linkopts = select({
"//:windows": [],
"//:windows_msvc": [],
"//conditions:default": [
"-pthread",
],
"//conditions:default": ["-pthread"],
}),
deps = ["//:gtest"],
)
# Py tests
# Python tests
py_library(
name = "gmock_test_utils",
testonly = 1,
@@ -66,9 +57,7 @@ cc_binary(
name = "gmock_leak_test_",
testonly = 1,
srcs = ["gmock_leak_test_.cc"],
deps = [
"//:gtest_main",
],
deps = ["//:gtest_main"],
)
py_test(
@@ -89,17 +78,13 @@ cc_test(
"gmock_link_test.cc",
"gmock_link_test.h",
],
deps = [
"//:gtest_main",
],
deps = ["//:gtest_main"],
)
cc_binary(
name = "gmock_output_test_",
srcs = ["gmock_output_test_.cc"],
deps = [
"//:gtest",
],
deps = ["//:gtest"],
)
py_test(
@@ -117,7 +102,5 @@ cc_test(
name = "gmock_test",
size = "small",
srcs = ["gmock_test.cc"],
deps = [
"//:gtest_main",
],
deps = ["//:gtest_main"],
)