• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The ANGLE Project Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("../../../gni/angle.gni")
6import("../angle_traces.gni")
7
8declare_args() {
9  # Determines if we build the capture_replay_tests. Off by default.
10  angle_build_capture_replay_tests = false
11
12  # Set the trace directory. Default is traces
13  angle_capture_replay_test_trace_dir = "traces"
14
15  angle_capture_replay_composite_file_id = 1
16}
17
18_test_names_file = "test_names_${angle_capture_replay_composite_file_id}.json"
19
20if (angle_build_capture_replay_tests) {
21  assert(angle_with_capture_by_default, "Must build with capture by default.")
22
23  angle_trace_libs("angle_capture_replay_libs") {
24    _tracedir = angle_capture_replay_test_trace_dir
25    trace_dir = _tracedir
26    json_path = "$_tracedir/$_test_names_file"
27    _trace_json = read_file(json_path, "json")
28    trace_list = _trace_json.traces
29    short_names = true
30  }
31}
32
33angle_executable("capture_replay_tests") {
34  testonly = true
35  sources = [ "CaptureReplayTests.cpp" ]
36  deps = [
37    "$angle_root:angle_compression",
38    "$angle_root/util:angle_frame_capture_test_utils",
39    "$angle_root/util:angle_trace_loader",
40    "$angle_root/util:angle_util",
41  ]
42
43  data_deps = [
44    "$angle_root:libEGL",
45    "$angle_root:libGLESv2",
46  ]
47
48  configs += [
49    "$angle_root:library_name_config",
50    "${angle_root}:libANGLE_config",
51  ]
52  defines = []
53
54  if ((is_linux || is_chromeos) && !is_component_build) {
55    # Set rpath to find shared libs in a non-component build.
56    configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
57  }
58
59  # Disable optimization to avoid optimizing huge files.
60  _trace_folder_relative_path = "./" + angle_capture_replay_test_trace_dir
61  _data_path = rebase_path(_trace_folder_relative_path, root_out_dir)
62  defines = [
63    "ANGLE_CAPTURE_REPLAY_TEST_DATA_DIR=\"${_data_path}\"",
64    "ANGLE_CAPTURE_REPLAY_TEST_NAMES_PATH=\"${_data_path}/${_test_names_file}\"",
65    "ANGLE_REPLAY_EXPORT=",
66  ]
67  include_dirs = [ "." ]
68
69  if (angle_build_capture_replay_tests) {
70    deps += [ ":angle_capture_replay_libs" ]
71  }
72}
73