Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions bazel/envoy_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ def envoy_cc_test(
shard_count = shard_count,
)

# Envoy C++ test related libraries (that want gtest, gmock) should be specified
# with this function.
def envoy_cc_test_library(
# Envoy C++ related test infrastructure (that want gtest, gmock, but may be
# relied on by envoy_cc_test_library) should use this function.
def envoy_cc_test_infrastructure_library(
name,
srcs = [],
hdrs = [],
Expand All @@ -436,14 +436,38 @@ def envoy_cc_test_library(
testonly = 1,
deps = deps + [envoy_external_dep_path(dep) for dep in external_deps] + [
envoy_external_dep_path("googletest"),
repository + "//test/test_common:printers_includes",
repository + "//test/test_common:test_base",
],
tags = tags,
alwayslink = 1,
linkstatic = 1,
)

# Envoy C++ test related libraries (that want gtest, gmock) should be specified
# with this function.
def envoy_cc_test_library(
name,
srcs = [],
hdrs = [],
data = [],
external_deps = [],
deps = [],
repository = "",
tags = []):
deps = deps + [
repository + "//test/test_common:printers_includes",
repository + "//test/test_common:test_base",
]
envoy_cc_test_infrastructure_library(
name,
srcs,
hdrs,
data,
external_deps,
deps,
repository,
tags,
)

# Envoy test binaries should be specified with this function.
def envoy_cc_test_binary(
name,
Expand Down
4 changes: 2 additions & 2 deletions test/test_common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load(
"envoy_basic_cc_library",
"envoy_cc_library",
"envoy_cc_test",
"envoy_cc_test_infrastructure_library",
"envoy_cc_test_library",
"envoy_package",
)
Expand Down Expand Up @@ -156,12 +157,11 @@ envoy_cc_test(
],
)

envoy_cc_library(
envoy_cc_test_infrastructure_library(
name = "test_base",
srcs = ["test_base.cc"],
hdrs = ["test_base.h"],
deps = [
"//external:googletest",
"//test/test_common:global_lib",
],
)
Expand Down