BUILD.bazel 3.19 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Copyright 2017 Google Inc.
# All Rights Reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#   Bazel Build for Google C++ Testing Framework(Google Test)-googlemock

33
34
load("@rules_python//python:defs.bzl", "py_library", "py_test")

35
36
licenses(["notice"])

krzysio's avatar
krzysio committed
37
# Tests for GMock itself
38
39
40
cc_test(
    name = "gmock_all_test",
    size = "small",
krzysio's avatar
krzysio committed
41
    srcs = glob(include = ["gmock-*.cc"]),
42
    linkopts = select({
Manuel Binna's avatar
Manuel Binna committed
43
        "//:qnx": [],
44
        "//:windows": [],
krzysio's avatar
krzysio committed
45
        "//conditions:default": ["-pthread"],
46
47
48
49
    }),
    deps = ["//:gtest"],
)

krzysio's avatar
krzysio committed
50
# Python tests
51
52
53
54
py_library(
    name = "gmock_test_utils",
    testonly = 1,
    srcs = ["gmock_test_utils.py"],
dmauro's avatar
dmauro committed
55
56
    deps = [
        "//googletest/test:gtest_test_utils",
Abseil Team's avatar
Abseil Team committed
57
    ],
58
59
60
61
62
63
)

cc_binary(
    name = "gmock_leak_test_",
    testonly = 1,
    srcs = ["gmock_leak_test_.cc"],
krzysio's avatar
krzysio committed
64
    deps = ["//:gtest_main"],
65
66
67
68
69
70
71
72
73
74
)

py_test(
    name = "gmock_leak_test",
    size = "medium",
    srcs = ["gmock_leak_test.py"],
    data = [
        ":gmock_leak_test_",
        ":gmock_test_utils",
    ],
dmauro's avatar
dmauro committed
75
76
77
78
    tags = [
        "no_test_msvc2015",
        "no_test_msvc2017",
    ],
79
80
81
82
83
84
85
86
87
88
)

cc_test(
    name = "gmock_link_test",
    size = "small",
    srcs = [
        "gmock_link2_test.cc",
        "gmock_link_test.cc",
        "gmock_link_test.h",
    ],
krzysio's avatar
krzysio committed
89
    deps = ["//:gtest_main"],
90
91
92
93
94
)

cc_binary(
    name = "gmock_output_test_",
    srcs = ["gmock_output_test_.cc"],
krzysio's avatar
krzysio committed
95
    deps = ["//:gtest"],
96
97
98
99
100
101
102
103
104
105
)

py_test(
    name = "gmock_output_test",
    size = "medium",
    srcs = ["gmock_output_test.py"],
    data = [
        ":gmock_output_test_",
        ":gmock_output_test_golden.txt",
    ],
dmauro's avatar
dmauro committed
106
107
108
109
    tags = [
        "no_test_msvc2015",
        "no_test_msvc2017",
    ],
Abseil Team's avatar
Abseil Team committed
110
    deps = [":gmock_test_utils"],
111
112
113
114
115
116
)

cc_test(
    name = "gmock_test",
    size = "small",
    srcs = ["gmock_test.cc"],
krzysio's avatar
krzysio committed
117
    deps = ["//:gtest_main"],
118
)