Commit 9ec70f93 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Add GN target for building the cros VM sanity test.

The actual test binary is actually baked into the VM image. The gn
target here just builds chrome and a wrapper script around the test
runner.

Bug: 832374
Change-Id: I062c80966abb6a234511ba125cdfb5c86367d9ad
Reviewed-on: https://chromium-review.googlesource.com/1057961
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558459}
parent 0dc6825f
......@@ -10,11 +10,17 @@ declare_args() {
}
template("generate_vm_runner_script") {
_vm_image_path = "//build/cros_cache/chrome-sdk/tarballs/${cros_board}+${cros_sdk_version}+chromiumos_qemu_image.tar.xz/"
_qemu_dir = "//build/cros_cache/chrome-sdk/tarballs/${cros_board}+${cros_sdk_version}+app-emulation/"
_cache_path_prefix =
"//build/cros_cache/chrome-sdk/tarballs/${cros_board}+${cros_sdk_version}"
_vm_image_path = "${_cache_path_prefix}+chromiumos_qemu_image.tar.xz/"
_qemu_dir = "${_cache_path_prefix}+app-emulation/"
action(target_name) {
forward_variables_from(invoker, [ "testonly" ])
forward_variables_from(invoker,
[
"testonly",
"need_toolchain",
])
script = "//build/chromeos/create_vm_test_script.py"
......@@ -34,6 +40,9 @@ template("generate_vm_runner_script") {
_vm_image_path,
_qemu_dir,
]
if (defined(need_toolchain) && need_toolchain) {
data += [ "${_cache_path_prefix}+target_toolchain/" ]
}
# Required arguments used at build time by the runner script generator.
args = [
......@@ -54,9 +63,13 @@ template("generate_vm_runner_script") {
rebase_path(invoker.test_exe, root_build_dir),
"--output-directory",
rebase_path(root_out_dir, root_build_dir),
"--runtime-deps-path",
rebase_path(invoker.runtime_deps_file, root_build_dir),
]
if (defined(invoker.runtime_deps_file)) {
args += [
"--runtime-deps-path",
rebase_path(invoker.runtime_deps_file, root_build_dir),
]
}
}
}
}
......@@ -800,6 +800,38 @@ if (cros_board != "") {
generate_vm_runner_script("cros_vm_launcher") {
generated_script = "$root_build_dir/bin/launch_cros_vm"
}
# The sanity test's actual binary is baked into the vm image. All we need to
# do is build the test wrapper and build our own browser to push to the VM
# before testing it.
generate_vm_runner_script("cros_vm_sanity_test_wrapper") {
test_exe = "$root_out_dir/cros_vm_sanity_test"
generated_script = "$root_build_dir/bin/run_cros_vm_sanity_test"
# The sanity test needs to strip down Chrome and its deps to fit it into
# the VM. It does so by using binutils in the toolchain. So signal that we
# need the toolchain in the data.
need_toolchain = true
}
group("cros_vm_sanity_test") {
testonly = true
write_runtime_deps = "$root_out_dir/cros_vm_sanity_test.runtime_deps"
data_deps = [
"//:chromiumos_preflight", # Builds the browser.
":cros_vm_sanity_test_wrapper", # Builds the test wrapper.
]
# The following dependencies are needed to deploy chrome to the VM. See the
# link for the full list:
# https://codesearch.chromium.org/chromium/src/third_party/chromite/lib/chrome_util.py?l=341
data_deps += [ "//chrome:xdg_mime" ]
# TODO(bpastene): Figure out what's generating resources/chromeos/ and
# declare it as a dep instead of adding the dir directly.
data = [
"$root_out_dir/resources/chromeos/",
]
}
}
fuzzer_test("variable_expander_fuzzer") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment