blob: afa7d97efe204e8089820fdea5852e6a563c9aee [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# If true, it assumes that //third_party/abseil-cpp is an available dependency.
gtest_enable_absl_printers = false
}
config("gtest_config") {
visibility = [ ":*" ] # gmock also shares this config.
defines = [
# Link googletest statically, so no API qualifier is
# necessary. The definition in gtest-port.h at the time of this writing
# causes crashes in content_browsertests.
"GTEST_API_=",
# In order to allow regex matches in gtest to be shared between Windows
# and other systems, we tell gtest to always use its internal engine.
"GTEST_HAS_POSIX_RE=0",
# Enables C++11 features.
"GTEST_LANG_CXX11=1",
# Prevents gtest from including both <tr1/tuple> and <tuple>.
"GTEST_HAS_TR1_TUPLE=0",
]
# Gtest headers need to be able to find themselves.
include_dirs = [ "src/googletest/include" ]
if (gtest_enable_absl_printers) {
defines += [ "GTEST_HAS_ABSL=1" ]
}
}
config("gmock_config") {
# Gmock headers need to be able to find themselves.
include_dirs = [ "src/googlemock/include" ]
cflags = [ "-Wno-inconsistent-missing-override" ]
}
source_set("gtest_prod") {
sources = [
"src/googletest/include/gtest/gtest_prod.h",
]
}
source_set("gtest") {
testonly = true
sources = [
"src/googletest/include/gtest/gtest-death-test.h",
"src/googletest/include/gtest/gtest-matchers.h",
"src/googletest/include/gtest/gtest-message.h",
"src/googletest/include/gtest/gtest-param-test.h",
"src/googletest/include/gtest/gtest-printers.h",
"src/googletest/include/gtest/gtest-spi.h",
"src/googletest/include/gtest/gtest-test-part.h",
"src/googletest/include/gtest/gtest-typed-test.h",
"src/googletest/include/gtest/gtest.h",
"src/googletest/include/gtest/gtest_pred_impl.h",
"src/googletest/include/gtest/internal/custom/gtest-port.h",
"src/googletest/include/gtest/internal/custom/gtest-printers.h",
"src/googletest/include/gtest/internal/gtest-death-test-internal.h",
"src/googletest/include/gtest/internal/gtest-filepath.h",
"src/googletest/include/gtest/internal/gtest-internal.h",
"src/googletest/include/gtest/internal/gtest-param-util.h",
"src/googletest/include/gtest/internal/gtest-port-arch.h",
"src/googletest/include/gtest/internal/gtest-port.h",
"src/googletest/include/gtest/internal/gtest-string.h",
"src/googletest/include/gtest/internal/gtest-type-util.h",
"src/googletest/src/gtest-death-test.cc",
"src/googletest/src/gtest-filepath.cc",
"src/googletest/src/gtest-internal-inl.h",
"src/googletest/src/gtest-matchers.cc",
"src/googletest/src/gtest-port.cc",
"src/googletest/src/gtest-printers.cc",
"src/googletest/src/gtest-test-part.cc",
"src/googletest/src/gtest-typed-test.cc",
"src/googletest/src/gtest.cc",
]
include_dirs = [ "src/googletest" ]
all_dependent_configs = [ ":gtest_config" ]
defines = []
deps = []
public_deps = []
if (is_fuchsia) {
deps += [
"//third_party/fuchsia-sdk/pkg/fdio",
"//third_party/fuchsia-sdk/pkg/zx",
]
}
}
source_set("gtest_main") {
testonly = true
sources = [
"src/googletest/src/gtest_main.cc",
]
deps = [
":gtest",
]
}
source_set("gmock") {
testonly = true
sources = [
"src/googlemock/include/gmock/gmock-actions.h",
"src/googlemock/include/gmock/gmock-cardinalities.h",
"src/googlemock/include/gmock/gmock-function-mocker.h",
"src/googlemock/include/gmock/gmock-generated-actions.h",
"src/googlemock/include/gmock/gmock-generated-function-mockers.h",
"src/googlemock/include/gmock/gmock-generated-matchers.h",
"src/googlemock/include/gmock/gmock-matchers.h",
"src/googlemock/include/gmock/gmock-more-actions.h",
"src/googlemock/include/gmock/gmock-more-matchers.h",
"src/googlemock/include/gmock/gmock-nice-strict.h",
"src/googlemock/include/gmock/gmock-spec-builders.h",
"src/googlemock/include/gmock/gmock.h",
"src/googlemock/include/gmock/internal/custom/gmock-generated-actions.h",
"src/googlemock/include/gmock/internal/custom/gmock-matchers.h",
"src/googlemock/include/gmock/internal/gmock-internal-utils.h",
"src/googlemock/include/gmock/internal/gmock-port.h",
"src/googlemock/include/gmock/internal/gmock-pp.h",
"src/googlemock/src/gmock-cardinalities.cc",
"src/googlemock/src/gmock-internal-utils.cc",
"src/googlemock/src/gmock-matchers.cc",
"src/googlemock/src/gmock-spec-builders.cc",
"src/googlemock/src/gmock.cc",
]
public_deps = [
":gtest",
]
public_configs = [ ":gmock_config" ]
}
static_library("gmock_main") {
testonly = true
sources = [
"src/googlemock/src/gmock_main.cc",
]
deps = [
":gmock",
]
}