2016-06-03 08:16:50 +00:00
|
|
|
# Copyright 2016 the V8 project 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/config/sanitizers/sanitizers.gni")
|
2016-06-15 11:57:11 +00:00
|
|
|
import("//third_party/icu/config.gni")
|
2016-06-03 08:16:50 +00:00
|
|
|
import("v8.gni")
|
|
|
|
|
|
|
|
declare_args() {
|
|
|
|
# Sets the test isolation mode (noop|prepare|check).
|
|
|
|
v8_test_isolation_mode = "noop"
|
|
|
|
}
|
|
|
|
|
|
|
|
template("v8_isolate_run") {
|
2016-10-12 07:31:53 +00:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
"*",
|
|
|
|
[
|
|
|
|
"deps",
|
|
|
|
"isolate",
|
|
|
|
])
|
|
|
|
|
2016-06-03 08:16:50 +00:00
|
|
|
# Remember target name as within the action scope the target name will be
|
|
|
|
# different.
|
|
|
|
name = target_name
|
2016-10-12 07:31:53 +00:00
|
|
|
|
|
|
|
assert(defined(invoker.deps))
|
|
|
|
assert(defined(invoker.isolate))
|
|
|
|
|
|
|
|
if (name != "" && v8_test_isolation_mode != "noop") {
|
2016-06-03 08:16:50 +00:00
|
|
|
action(name + "_run") {
|
2016-06-03 13:46:08 +00:00
|
|
|
testonly = true
|
|
|
|
|
2016-06-03 08:16:50 +00:00
|
|
|
deps = invoker.deps
|
|
|
|
|
2016-06-03 13:46:08 +00:00
|
|
|
script = "//tools/isolate_driver.py"
|
2016-06-03 08:16:50 +00:00
|
|
|
|
|
|
|
sources = [
|
|
|
|
invoker.isolate,
|
|
|
|
]
|
|
|
|
|
|
|
|
inputs = [
|
|
|
|
# Files that are known to be involved in this step.
|
2016-06-03 13:46:08 +00:00
|
|
|
"//tools/swarming_client/isolate.py",
|
|
|
|
"//tools/swarming_client/run_isolated.py",
|
2016-06-03 08:16:50 +00:00
|
|
|
]
|
|
|
|
|
2016-06-03 13:46:08 +00:00
|
|
|
if (v8_test_isolation_mode == "prepare") {
|
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/$name.isolated.gen.json",
|
|
|
|
]
|
|
|
|
} else if (v8_test_isolation_mode == "check") {
|
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/$name.isolated",
|
|
|
|
"$root_out_dir/$name.isolated.state",
|
|
|
|
]
|
|
|
|
}
|
2016-06-03 08:16:50 +00:00
|
|
|
|
|
|
|
# Translate gn to gyp variables.
|
2017-06-27 11:49:13 +00:00
|
|
|
if (v8_code_coverage) {
|
|
|
|
coverage = "1"
|
|
|
|
} else {
|
|
|
|
coverage = "0"
|
|
|
|
}
|
2016-06-03 08:16:50 +00:00
|
|
|
if (is_asan) {
|
|
|
|
asan = "1"
|
|
|
|
} else {
|
|
|
|
asan = "0"
|
|
|
|
}
|
|
|
|
if (is_msan) {
|
|
|
|
msan = "1"
|
|
|
|
} else {
|
|
|
|
msan = "0"
|
|
|
|
}
|
|
|
|
if (is_tsan) {
|
|
|
|
tsan = "1"
|
|
|
|
} else {
|
|
|
|
tsan = "0"
|
|
|
|
}
|
|
|
|
if (is_cfi) {
|
|
|
|
cfi_vptr = "1"
|
|
|
|
} else {
|
|
|
|
cfi_vptr = "0"
|
|
|
|
}
|
|
|
|
if (target_cpu == "x86") {
|
|
|
|
target_arch = "ia32"
|
|
|
|
} else {
|
|
|
|
target_arch = target_cpu
|
|
|
|
}
|
|
|
|
if (is_debug) {
|
|
|
|
configuration_name = "Debug"
|
|
|
|
} else {
|
|
|
|
configuration_name = "Release"
|
|
|
|
}
|
|
|
|
if (is_component_build) {
|
|
|
|
component = "shared_library"
|
|
|
|
} else {
|
|
|
|
component = "static_library"
|
|
|
|
}
|
|
|
|
if (icu_use_data_file) {
|
|
|
|
icu_use_data_file_flag = "1"
|
|
|
|
} else {
|
|
|
|
icu_use_data_file_flag = "0"
|
|
|
|
}
|
|
|
|
if (v8_use_external_startup_data) {
|
|
|
|
use_external_startup_data = "1"
|
|
|
|
} else {
|
|
|
|
use_external_startup_data = "0"
|
|
|
|
}
|
2017-10-17 14:25:21 +00:00
|
|
|
if (is_ubsan_vptr) {
|
|
|
|
ubsan_vptr = "1"
|
|
|
|
} else {
|
|
|
|
ubsan_vptr = "0"
|
|
|
|
}
|
2016-06-03 08:16:50 +00:00
|
|
|
if (v8_use_snapshot) {
|
2016-06-07 08:01:15 +00:00
|
|
|
use_snapshot = "true"
|
2016-06-03 08:16:50 +00:00
|
|
|
} else {
|
2016-06-07 08:01:15 +00:00
|
|
|
use_snapshot = "false"
|
2016-06-03 08:16:50 +00:00
|
|
|
}
|
2016-06-30 08:58:09 +00:00
|
|
|
if (v8_has_valgrind) {
|
|
|
|
has_valgrind = "1"
|
|
|
|
} else {
|
|
|
|
has_valgrind = "0"
|
|
|
|
}
|
2016-07-04 07:52:08 +00:00
|
|
|
if (v8_gcmole) {
|
|
|
|
gcmole = "1"
|
|
|
|
} else {
|
|
|
|
gcmole = "0"
|
|
|
|
}
|
|
|
|
|
2016-06-06 13:24:43 +00:00
|
|
|
# Note, all paths will be rebased in isolate_driver.py to be relative to
|
|
|
|
# the isolate file.
|
2016-06-03 08:16:50 +00:00
|
|
|
args = [
|
|
|
|
v8_test_isolation_mode,
|
|
|
|
"--isolated",
|
|
|
|
rebase_path("$root_out_dir/$name.isolated", root_build_dir),
|
|
|
|
"--isolate",
|
|
|
|
rebase_path(invoker.isolate, root_build_dir),
|
|
|
|
|
|
|
|
# Path variables are used to replace file paths when loading a .isolate
|
|
|
|
# file
|
|
|
|
"--path-variable",
|
|
|
|
"DEPTH",
|
|
|
|
rebase_path("//", root_build_dir),
|
|
|
|
"--path-variable",
|
|
|
|
"PRODUCT_DIR",
|
|
|
|
rebase_path(root_out_dir, root_build_dir),
|
|
|
|
|
|
|
|
# TODO(machenbach): Set variables for remaining features.
|
|
|
|
"--config-variable",
|
|
|
|
"CONFIGURATION_NAME=$configuration_name",
|
|
|
|
"--config-variable",
|
|
|
|
"OS=$target_os",
|
|
|
|
"--config-variable",
|
|
|
|
"asan=$asan",
|
|
|
|
"--config-variable",
|
|
|
|
"cfi_vptr=$cfi_vptr",
|
|
|
|
"--config-variable",
|
2016-07-04 07:52:08 +00:00
|
|
|
"gcmole=$gcmole",
|
2016-06-03 08:16:50 +00:00
|
|
|
"--config-variable",
|
2016-06-30 08:58:09 +00:00
|
|
|
"has_valgrind=$has_valgrind",
|
2016-06-03 08:16:50 +00:00
|
|
|
"--config-variable",
|
|
|
|
"icu_use_data_file_flag=$icu_use_data_file_flag",
|
|
|
|
"--config-variable",
|
2016-10-12 07:31:53 +00:00
|
|
|
"is_gn=1",
|
|
|
|
"--config-variable",
|
2016-06-03 08:16:50 +00:00
|
|
|
"msan=$msan",
|
|
|
|
"--config-variable",
|
|
|
|
"tsan=$tsan",
|
|
|
|
"--config-variable",
|
2017-06-27 11:49:13 +00:00
|
|
|
"coverage=$coverage",
|
2016-06-03 08:16:50 +00:00
|
|
|
"--config-variable",
|
2017-06-27 11:49:13 +00:00
|
|
|
"sanitizer_coverage=$sanitizer_coverage_flags",
|
2016-06-03 08:16:50 +00:00
|
|
|
"--config-variable",
|
|
|
|
"component=$component",
|
|
|
|
"--config-variable",
|
|
|
|
"target_arch=$target_arch",
|
|
|
|
"--config-variable",
|
2017-10-17 14:25:21 +00:00
|
|
|
"ubsan_vptr=$ubsan_vptr",
|
|
|
|
"--config-variable",
|
2016-06-03 08:16:50 +00:00
|
|
|
"v8_use_external_startup_data=$use_external_startup_data",
|
|
|
|
"--config-variable",
|
|
|
|
"v8_use_snapshot=$use_snapshot",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
args += [
|
|
|
|
"--config-variable",
|
2017-09-29 08:19:29 +00:00
|
|
|
"msvs_version=2017",
|
2016-06-03 08:16:50 +00:00
|
|
|
]
|
|
|
|
} else {
|
|
|
|
args += [
|
|
|
|
"--config-variable",
|
|
|
|
"msvs_version=0",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|