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 18if (angle_build_capture_replay_tests) { 19 assert(angle_with_capture_by_default, "Must build with capture by default.") 20 21 _test_names_file = "test_names_${angle_capture_replay_composite_file_id}.json" 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_test_utils", 40 "$angle_root/util:angle_trace_loader", 41 "$angle_root/util:angle_util", 42 ] 43 44 data_deps = [ 45 "$angle_root:libEGL", 46 "$angle_root:libGLESv2", 47 ] 48 49 configs += [ 50 "$angle_root:library_name_config", 51 "${angle_root}:libANGLE_config", 52 ] 53 defines = [] 54 55 if ((is_linux || is_chromeos) && !is_component_build) { 56 # Set rpath to find shared libs in a non-component build. 57 configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] 58 } 59 60 # Disable optimization to avoid optimizing huge files. 61 _trace_folder_relative_path = "./" + angle_capture_replay_test_trace_dir 62 _data_path = rebase_path(_trace_folder_relative_path, root_out_dir) 63 defines = [ 64 "ANGLE_CAPTURE_REPLAY_TEST_DATA_DIR=\"${_data_path}\"", 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