Commit 1398080c by Jamie Madill Committed by Commit Bot

Capture/Replay: Simplify .gni integration.

Moves a lot of the code out of the gni file into tests/BUILD.gn. In preparation for auto-generating the gni file as a simple array of trace test names. Bug: angleproject:4590 Change-Id: Iaa2b7872dc6e705d59108fa7532594bdc65d365a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168359 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 1f9e2a8f
......@@ -285,10 +285,38 @@ if (is_win || is_linux || is_android || is_mac || is_fuchsia) {
angle_source_set("angle_trace_perftests") {
testonly = true
if (build_angle_trace_perf_tests) {
import("perf_tests/restricted_traces/angle_trace_perf_tests.gni")
sources = angle_trace_perf_sources
defines = angle_trace_perf_defines
data = angle_trace_perf_data
# Imports "angle_restricted_traces"
import("perf_tests/restricted_traces/restricted_traces.gni")
sources = [ "perf_tests/TracePerfTest.cpp" ]
defines = []
data = []
foreach(_test, angle_restricted_traces) {
_test_dir = "perf_tests/restricted_traces/${_test}"
_test_ctx = "${_test_dir}/${_test}_capture_context1"
# Similar to capture replay sample, use the file index for sources
sources +=
rebase_path(read_file("${_test_ctx}_files.txt", "list lines"),
".",
"${_test_dir}") +
[
"${_test_ctx}.cpp",
"${_test_ctx}.h",
]
if (is_android) {
_test_data_path = "/sdcard/chromium_tests_root/third_party/angle/src/tests/perf_tests/restricted_traces/${_test}"
} else {
_test_data_path = rebase_path("${_test_dir}", root_out_dir)
}
defines += [ "ANGLE_TRACE_DATA_DIR_${_test}=\"${_test_data_path}\"" ]
data += [ "${_test_dir}/${_test}_capture_context1.angledata.gz" ]
}
deps = [
":angle_perftests_shared",
"$angle_root:angle_compression",
......
# Copyright 2020 The ANGLE 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.
# This include iterates through a list of tests and rebases the files so they
# can be consumed by tests/BUILD.gn for use with TracePerfTest.cpp.
import("../../../../gni/angle.gni")
_tests = [
"manhattan_10",
"trex_200",
]
angle_trace_perf_sources = [ "perf_tests/TracePerfTest.cpp" ]
angle_trace_perf_defines = []
angle_trace_perf_data = []
foreach(_test, _tests) {
_test_dir = "${_test}"
_test_ctx = "${_test_dir}/${_test}_capture_context1"
# Similar to capture replay sample, use the file index for sources
angle_trace_perf_sources +=
rebase_path(read_file("${_test_ctx}_files.txt", "list lines"),
".",
"perf_tests/restricted_traces/${_test_dir}") +
[
"perf_tests/restricted_traces/${_test_ctx}.cpp",
"perf_tests/restricted_traces/${_test_ctx}.h",
]
if (is_android) {
_test_data_path = "/sdcard/chromium_tests_root/third_party/angle/src/tests/perf_tests/restricted_traces/${_test}"
} else {
_test_data_path = rebase_path("${_test_dir}", root_out_dir)
}
angle_trace_perf_defines +=
[ "ANGLE_TRACE_DATA_DIR_${_test}=\"${_test_data_path}\"" ]
angle_trace_perf_data += [ "perf_tests/restricted_traces/${_test_dir}/${_test}_capture_context1.angledata.gz" ]
}
# Copyright 2020 The ANGLE 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.
#
# A list of all restricted trace tests. Can be consumed by tests/BUILD.gn.
angle_restricted_traces = [
"manhattan_10",
"trex_200",
]
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