539e907258
This is the V8 equivalent to https://crrev.com/2779193002 and must be landed before //build/secondary/{gtest,gmock} are removed from Chromium. This started out as https://crrev.com/2847693002 The changes in tools/ were authored by yangguo@chromium.org and initially shared in http://crrev.com/2849783003. GoogleTest (gtest) and GoogleMock (gmock) are now hosted into the same googletest repository. In order to cope with this, the googletest repository is now sourced at third_party/googletest. The file/directory layout of Google Test is not yet considered stable. To minimize disruption while Google Test stabilizes, Chromium code will be insulated from third_party/googletest. * testing/gtest/include/gtest/ and testing/gmock/include/gmock have been populated with headers that forward into the appropriate locations of third_party/googletest * testing/BUILD.gn has been populated with the targets //testing/gtest(:gtest_main) and //testing/gmock(:gmock_main), which depend on the appropriate //third_party/googletest targets. All Chromium code should keep depending on the targets and headers in testing/{gtest,gmock} for now. BUG=chromium:630705 Change-Id: I12b07ae78c8039aeff6ada7a3335e4e2b5d308ab Reviewed-on: https://chromium-review.googlesource.com/639953 Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#52170}
101 lines
2.8 KiB
Plaintext
101 lines
2.8 KiB
Plaintext
# Copyright 2014 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import("//build_overrides/gtest.gni")
|
|
if (is_ios) {
|
|
import("//build/config/coverage/coverage.gni")
|
|
import("//build/config/ios/ios_sdk.gni")
|
|
import("//build/buildflag_header.gni")
|
|
}
|
|
|
|
config("gtest_direct_config") {
|
|
visibility = [ ":*" ]
|
|
defines = [ "UNIT_TEST" ]
|
|
}
|
|
|
|
# The file/directory layout of Google Test is not yet considered stable. Until
|
|
# it stabilizes, Chromium code MUST use this target instead of reaching directly
|
|
# into //third_party/googletest.
|
|
static_library("gtest") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"include/gtest/gtest-death-test.h",
|
|
"include/gtest/gtest-message.h",
|
|
"include/gtest/gtest-param-test.h",
|
|
"include/gtest/gtest-spi.h",
|
|
"include/gtest/gtest.h",
|
|
"include/gtest/gtest_prod.h",
|
|
|
|
# This is a workaround for the issues below.
|
|
#
|
|
# 1) This target needs to be a static_library (not a source set) on Mac to
|
|
# avoid the build errors in
|
|
# https://codereview.chromium.org/2779193002#msg82.
|
|
# 2) A static_library must have at least one source file, to avoid build
|
|
# errors on Mac and Windows. https://crbug.com/710334
|
|
# 3) A static_library with complete_static_lib = true, which would not
|
|
# require adding the empty file, will result in duplicate symbols on
|
|
# Android. https://codereview.chromium.org/2852613002/#ps20001
|
|
"empty.cc",
|
|
]
|
|
public_deps = [
|
|
"//third_party/googletest:gtest",
|
|
]
|
|
|
|
public_configs = [ ":gtest_direct_config" ]
|
|
|
|
if (gtest_include_multiprocess) {
|
|
sources += [
|
|
"../multiprocess_func_list.cc",
|
|
"../multiprocess_func_list.h",
|
|
]
|
|
}
|
|
|
|
if (gtest_include_platform_test) {
|
|
sources += [ "../platform_test.h" ]
|
|
}
|
|
|
|
if ((is_mac || is_ios) && gtest_include_objc_support) {
|
|
if (is_ios) {
|
|
set_sources_assignment_filter([])
|
|
}
|
|
sources += [
|
|
"../gtest_mac.h",
|
|
"../gtest_mac.mm",
|
|
]
|
|
if (gtest_include_platform_test) {
|
|
sources += [ "../platform_test_mac.mm" ]
|
|
}
|
|
set_sources_assignment_filter(sources_assignment_filter)
|
|
}
|
|
|
|
if (is_ios && gtest_include_ios_coverage) {
|
|
sources += [
|
|
"../coverage_util_ios.h",
|
|
"../coverage_util_ios.mm",
|
|
]
|
|
deps = [
|
|
":ios_enable_coverage",
|
|
]
|
|
}
|
|
}
|
|
|
|
# The file/directory layout of Google Test is not yet considered stable. Until
|
|
# it stabilizes, Chromium code MUST use this target instead of reaching directly
|
|
# into //third_party/googletest.
|
|
source_set("gtest_main") {
|
|
testonly = true
|
|
deps = [
|
|
"//third_party/googletest:gtest_main",
|
|
]
|
|
}
|
|
|
|
if (is_ios) {
|
|
buildflag_header("ios_enable_coverage") {
|
|
header = "ios_enable_coverage.h"
|
|
flags = [ "IOS_ENABLE_COVERAGE=$use_clang_coverage" ]
|
|
}
|
|
}
|