cppgc: Add testing infra to regular targets

There's only few testing code required for embedders. Add testing
directly to the regular cppgc target to allow working around an ODR
violation issue with //v8:v8 and //v8:v8_for_testing, see bug.

This unblock Oilpan library builds in Chromium.

Bug: v8:11952, chromium:1056170
Change-Id: I0f0448faa0904b9ece58bd5a24c79c86ee55e2bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3008216
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75581}
This commit is contained in:
Michael Lippautz 2021-07-06 12:19:26 +02:00 committed by V8 LUCI CQ
parent 668e48bd49
commit a420ea54e3

View File

@ -5049,6 +5049,10 @@ v8_header_set("cppgc_headers") {
"include/cppgc/process-heap-statistics.h",
"include/cppgc/sentinel-pointer.h",
"include/cppgc/source-location.h",
# TODO(v8:11952): Remove the testing header here once depending on both,
# //v8:v8 and //v8:v8_for_testing does not result in ODR violations.
"include/cppgc/testing.h",
"include/cppgc/trace-trait.h",
"include/cppgc/type-traits.h",
"include/cppgc/visitor.h",
@ -5145,6 +5149,10 @@ v8_source_set("cppgc_base") {
"src/heap/cppgc/sweeper.cc",
"src/heap/cppgc/sweeper.h",
"src/heap/cppgc/task-handle.h",
# TODO(v8:11952): Remove the testing header here once depending on both,
# //v8:v8 and //v8:v8_for_testing does not result in ODR violations.
"src/heap/cppgc/testing.cc",
"src/heap/cppgc/trace-event.h",
"src/heap/cppgc/trace-trait.cc",
"src/heap/cppgc/virtual-memory.cc",
@ -5181,22 +5189,6 @@ v8_source_set("cppgc_base") {
}
}
v8_source_set("cppgc_base_for_testing") {
visibility = [ ":*" ]
sources = [
"include/cppgc/testing.h",
"src/heap/cppgc/testing.cc",
]
configs = [
":internal_config",
":cppgc_base_config",
]
public_deps = [ ":cppgc_base" ]
}
if (v8_check_header_includes) {
# This file will be generated by tools/generate-header-include-checks.py
# if the "check_v8_header_includes" gclient variable is set.
@ -5578,7 +5570,6 @@ if (is_component_build) {
sources = [ "src/utils/v8dll-main.cc" ]
public_deps = [
":cppgc_base_for_testing",
":torque_base",
":torque_ls_base",
":v8_base",
@ -5607,10 +5598,7 @@ if (is_component_build) {
v8_component("cppgc_for_testing") {
testonly = true
public_deps = [
":cppgc_base",
":cppgc_base_for_testing",
]
public_deps = [ ":cppgc_base" ]
configs = []
public_configs = [ ":external_config" ]
@ -5639,7 +5627,6 @@ if (is_component_build) {
testonly = true
public_deps = [
":cppgc_base_for_testing",
":torque_base",
":torque_ls_base",
":v8_base",
@ -5664,10 +5651,7 @@ if (is_component_build) {
group("cppgc_for_testing") {
testonly = true
public_deps = [
":cppgc_base",
":cppgc_base_for_testing",
]
public_deps = [ ":cppgc_base" ]
public_configs = [ ":external_config" ]
}