123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- package(default_visibility = ["//visibility:public"])
- licenses(["notice"])
- config_setting(
- name = "windows",
- values = {"cpu": "x64_windows"},
- )
- config_setting(
- name = "windows_msvc",
- values = {"cpu": "x64_windows_msvc"},
- )
- config_setting(
- name = "has_absl",
- values = {"define": "absl=1"},
- )
- cc_library(
- name = "gtest",
- srcs = glob(
- include = [
- "googletest/src/*.cc",
- "googletest/src/*.h",
- "googletest/include/gtest/**/*.h",
- "googlemock/src/*.cc",
- "googlemock/include/gmock/**/*.h",
- ],
- exclude = [
- "googletest/src/gtest-all.cc",
- "googletest/src/gtest_main.cc",
- "googlemock/src/gmock-all.cc",
- "googlemock/src/gmock_main.cc",
- ],
- ),
- hdrs = glob([
- "googletest/include/gtest/*.h",
- "googlemock/include/gmock/*.h",
- ]),
- copts = select(
- {
- ":windows": [],
- ":windows_msvc": [],
- "//conditions:default": ["-pthread"],
- },
- ),
- defines = select(
- {
- ":has_absl": [
- "GTEST_HAS_ABSL=1",
- ],
- "//conditions:default": [],
- },
- ),
- includes = [
- "googlemock",
- "googlemock/include",
- "googletest",
- "googletest/include",
- ],
- linkopts = select({
- ":windows": [],
- ":windows_msvc": [],
- "//conditions:default": [
- "-pthread",
- ],
- }),
- deps = select(
- {
- ":has_absl": [
- "@com_google_absl//absl/debugging:failure_signal_handler",
- "@com_google_absl//absl/debugging:stacktrace",
- "@com_google_absl//absl/debugging:symbolize",
- "@com_google_absl//absl/strings",
- "@com_google_absl//absl/types:optional",
- "@com_google_absl//absl/types:variant",
- ],
- "//conditions:default": [],
- },
- ),
- )
- cc_library(
- name = "gtest_main",
- srcs = [
- "googlemock/src/gmock_main.cc",
- ],
- deps = [":gtest"],
- )
- cc_library(
- name = "gtest_sample_lib",
- srcs = [
- "googletest/samples/sample1.cc",
- "googletest/samples/sample2.cc",
- "googletest/samples/sample4.cc",
- ],
- hdrs = [
- "googletest/samples/prime_tables.h",
- "googletest/samples/sample1.h",
- "googletest/samples/sample2.h",
- "googletest/samples/sample3-inl.h",
- "googletest/samples/sample4.h",
- ],
- )
- cc_test(
- name = "gtest_samples",
- size = "small",
-
-
-
- srcs = [
- "googletest/samples/sample1_unittest.cc",
- "googletest/samples/sample2_unittest.cc",
- "googletest/samples/sample3_unittest.cc",
- "googletest/samples/sample4_unittest.cc",
- "googletest/samples/sample5_unittest.cc",
- "googletest/samples/sample6_unittest.cc",
- "googletest/samples/sample7_unittest.cc",
- "googletest/samples/sample8_unittest.cc",
- ],
- deps = [
- "gtest_sample_lib",
- ":gtest_main",
- ],
- )
- cc_test(
- name = "sample9_unittest",
- size = "small",
- srcs = ["googletest/samples/sample9_unittest.cc"],
- deps = [":gtest"],
- )
- cc_test(
- name = "sample10_unittest",
- size = "small",
- srcs = ["googletest/samples/sample10_unittest.cc"],
- deps = [
- ":gtest",
- ],
- )
|