xref: /aosp_15_r20/external/angle/src/tests/BUILD.gn (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1# Copyright 2015 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("//testing/test.gni")
6import("../../gni/angle.gni")
7import("angle_unittests.gni")
8
9declare_args() {
10  build_angle_gles1_conform_tests = checkout_angle_internal
11  build_angle_trace_perf_tests = false
12  build_angle_perftests =
13      is_win || is_linux || is_chromeos || is_android || is_apple || is_fuchsia
14}
15
16declare_args() {
17  build_angle_trace_tests = is_clang && (build_angle_trace_perf_tests ||
18                                         checkout_angle_restricted_traces)
19  if (!build_with_chromium && is_android) {
20    assert(
21        !is_official_build,
22        "is_official_build not supported by ANGLE for Android (https://anglebug.com/42265853)")
23  }
24}
25
26if (is_android) {
27  android_library("native_test_java") {
28    testonly = true
29    sources = [
30      "test_utils/runner/android/java/src/com/android/angle/test/AngleNativeTest.java",
31      "test_utils/runner/android/java/src/com/android/angle/test/AngleUnitTestActivity.java",
32      "test_utils/runner/android/java/src/com/android/angle/test/TestStatusReporter.java",
33    ]
34
35    deps = [
36      "//build/android:build_java",
37      "//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
38    ]
39  }
40
41  angle_source_set("native_test_support_android") {
42    testonly = true
43    sources = [ "test_utils/runner/android/AngleNativeTest.cpp" ]
44    deps = [ "$angle_root:angle_common" ]
45  }
46}
47
48angle_test("test_utils_unittest_helper") {
49  sources = [
50    "../../util/test_utils_unittest_helper.cpp",
51    "../../util/test_utils_unittest_helper.h",
52    "test_utils/angle_test_instantiate.h",
53    "test_utils/runner/TestSuite_unittest.cpp",
54  ]
55}
56
57test_expectations_sources = [
58  "test_expectations/GPUTestConfig.cpp",
59  "test_expectations/GPUTestConfig.h",
60  "test_expectations/GPUTestExpectationsParser.cpp",
61  "test_expectations/GPUTestExpectationsParser.h",
62]
63if (is_mac) {
64  test_expectations_sources_mac = [
65    "test_expectations/GPUTestConfig_mac.mm",
66    "test_expectations/GPUTestConfig_mac.h",
67  ]
68}
69if (is_ios) {
70  test_expectation_sources_ios = [
71    "test_expectations/GPUTestConfig_ios.mm",
72    "test_expectations/GPUTestConfig_ios.h",
73  ]
74}
75
76angle_static_library("angle_test_expectations") {
77  public_deps = [
78    "$angle_root:angle_common",
79    "$angle_root:angle_gpu_info_util",
80  ]
81  sources = test_expectations_sources
82  if (is_mac) {
83    sources += test_expectations_sources_mac
84    frameworks = [ "Cocoa.framework" ]
85  }
86  if (is_ios) {
87    sources += test_expectation_sources_ios
88    frameworks = [ "Foundation.framework" ]
89  }
90}
91
92config("angle_common_test_utils_config") {
93  include_dirs = [ "." ]
94  defines = []
95  if (angle_enable_swiftshader) {
96    defines += [ "ANGLE_ENABLE_SWIFTSHADER" ]
97  }
98}
99
100template("angle_common_test_utils") {
101  assert(defined(invoker.angle_util))
102  angle_source_set(target_name) {
103    testonly = true
104    if (is_ios) {
105      # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
106      check_includes = false
107    }
108    public_configs = [
109      ":angle_common_test_utils_config",
110      "$angle_root:library_name_config",
111    ]
112    public_deps = [
113      "$angle_root:angle_common",
114      "$angle_root:angle_gpu_info_util",
115      "$angle_root/util:${invoker.angle_util}",
116      "//testing/gmock",
117      "//testing/gtest",
118      "//third_party/googletest:gmock",
119      "//third_party/googletest:gtest",
120    ]
121    sources = [
122      "$angle_root/third_party/renderdoc/src/renderdoc_app.h",
123      "test_utils/MultiThreadSteps.cpp",
124      "test_utils/MultiThreadSteps.h",
125      "test_utils/RenderDoc.cpp",
126      "test_utils/RenderDoc.h",
127      "test_utils/angle_test_configs.cpp",
128      "test_utils/angle_test_configs.h",
129      "test_utils/angle_test_instantiate.cpp",
130      "test_utils/angle_test_instantiate.h",
131      "test_utils/angle_test_platform.cpp",
132      "test_utils/angle_test_platform.h",
133      "test_utils/gl_raii.h",
134    ]
135    if (is_apple) {
136      sources += [
137        "test_utils/angle_test_instantiate_apple.h",
138        "test_utils/angle_test_instantiate_apple.mm",
139      ]
140    }
141    data_deps = []
142    if (angle_enable_vulkan_validation_layers) {
143      data_deps += [ "$angle_root/src/common/vulkan:vulkan_validation_layers" ]
144    }
145    if (angle_enable_vulkan_api_dump_layer) {
146      data_deps += [ "$angle_root/src/common/vulkan:lunarg_vulkantools" ]
147    }
148  }
149}
150
151angle_common_test_utils("angle_common_test_utils_shared") {
152  angle_util = "angle_util"
153}
154
155angle_common_test_utils("angle_common_test_utils_static") {
156  angle_util = "angle_util_static"
157}
158
159# We use this in the restricted trace tests to load driver info.
160angle_test("angle_system_info_test") {
161  sources = [ "angle_system_info_tests_main.cpp" ]
162  deps = [
163    "$angle_root:angle_gpu_info_util",
164    "$angle_root:angle_static",
165    "$angle_root/util:angle_util_static",
166  ]
167}
168
169angle_test("angle_unittests") {
170  sources = angle_unittests_sources + [ "angle_unittest_main.cpp" ]
171
172  # Compiler tests frequently require either TranslatorGLSL or TranslatorESSL.  Build them only if
173  # both are enabled.
174  if (angle_enable_essl && angle_enable_glsl) {
175    sources += angle_unittests_compiler_tests_sources
176
177    if (is_apple) {
178      sources += angle_unittests_glsl_mac_sources
179    }
180    if (angle_enable_metal) {
181      sources += angle_unittests_msl_sources
182    }
183  }
184
185  defines = []
186
187  if (angle_enable_hlsl) {
188    sources += angle_unittests_hlsl_sources
189    defines += [ "ANGLE_ENABLE_HLSL" ]
190  }
191
192  if (angle_enable_gl) {
193    sources += angle_unittests_gl_sources
194  }
195
196  if (angle_enable_wgpu) {
197    sources += angle_unittests_wgsl_sources
198  }
199
200  deps = [
201    ":angle_test_expectations",
202    "$angle_root:angle_static",
203    "$angle_root:libfeature_support",
204    "$angle_root/util:angle_util_static",
205  ]
206
207  if (angle_has_rapidjson) {
208    deps += [ "$angle_root:angle_json_serializer" ]
209  }
210
211  if (angle_enable_vulkan) {
212    sources += [ "compiler_tests/Precise_test.cpp" ]
213    deps += [
214      "$angle_root/src/common/spirv:angle_spirv_base",
215      "$angle_root/src/common/spirv:angle_spirv_headers",
216      "$angle_root/src/common/spirv:angle_spirv_parser",
217      "${angle_spirv_headers_dir}:spv_headers",
218    ]
219  }
220
221  if (!is_android && !is_fuchsia && !is_ios) {
222    # SystemUtils.RunApp, the only unittest using a helper binary, is not supported on these
223    # platforms yet.
224    data_deps = [ ":test_utils_unittest_helper" ]
225  }
226
227  if (is_android) {
228    data += [ "$angle_root/src/tests/angle_android_test_runner.py" ]
229  }
230
231  if (angle_has_rapidjson) {
232    sources += [ "../common/serializer/JsonSerializer_unittest.cpp" ]
233  }
234}
235
236if (is_ios) {
237  bundle_data("angle_end2end_tests_bundle_data") {
238    testonly = true
239    sources = [ "angle_end2end_tests_expectations.txt" ]
240    outputs = [ "{{bundle_resources_dir}}/" +
241                "{{source_root_relative_dir}}/{{source_file_part}}" ]
242  }
243}
244
245if (is_win || is_linux || is_chromeos || is_android || is_fuchsia || is_apple) {
246  import("angle_end2end_tests.gni")
247
248  angle_test("angle_end2end_tests") {
249    include_dirs = [ "." ]
250
251    sources = angle_end2end_tests_sources + [ "angle_end2end_tests_main.cpp" ]
252    libs = []
253    defines = []
254    configs += [ "${angle_root}:libANGLE_config" ]
255
256    if (is_ios) {
257      sources += angle_end2end_tests_ios_sources
258      frameworks = [ "IOSurface.framework" ]
259    }
260    if (is_mac) {
261      sources += angle_end2end_tests_mac_sources
262      frameworks = [
263        "CoreFoundation.framework",
264        "IOSurface.framework",
265      ]
266      ldflags = [
267        "-weak_framework",
268        "Metal",
269      ]
270      cflags_objcc = [
271        "-Wno-nullability-completeness",
272        "-Wno-unguarded-availability",
273      ]
274    }
275    if (is_win) {
276      sources += angle_end2end_tests_win_sources
277    }
278    if (angle_use_x11) {
279      sources += [ "egl_tests/EGLX11VisualTest.cpp" ]
280    }
281    if (angle_use_wayland) {
282      sources += [ "egl_tests/EGLWaylandTest.cpp" ]
283    }
284
285    deps = [
286      ":angle_common_test_utils_shared",
287      "$angle_root:angle_gl_enum_utils",
288      "$angle_root:angle_image_util",
289      "$angle_root:translator",
290    ]
291
292    if (is_ios) {
293      deps += [ ":angle_end2end_tests_bundle_data" ]
294    } else {
295      data = [ "angle_end2end_tests_expectations.txt" ]
296    }
297
298    if (angle_has_rapidjson) {
299      deps += [ "$angle_root:angle_json_serializer" ]
300    }
301
302    if (build_angle_end2end_tests_aosp) {
303      # AOSP end2end tests builds don't bundle ANGLE libs or Vulkan tests and don't need the NDK path
304    } else {
305      if (is_android) {
306        include_dirs += [ "${android_ndk_root}/sysroot/usr/includes" ]
307      }
308
309      data_deps = [ "$angle_root:angle" ]
310
311      if (angle_enable_vulkan) {
312        sources += [
313          "gl_tests/VulkanExternalImageTest.cpp",
314          "gl_tests/VulkanImageTest.cpp",
315          "test_utils/VulkanHelper.cpp",
316          "test_utils/VulkanHelper.h",
317        ]
318        deps += [ "$angle_root/src/common/vulkan" ]
319      }
320    }
321
322    if (is_android) {
323      android_test_runner_script =
324          "$angle_root/src/tests/angle_android_test_runner.py"
325      data += [ "$android_test_runner_script" ]
326    }
327
328    if (angle_build_mesa) {
329      data_deps += [ "$angle_root/third_party/mesa" ]
330    }
331
332    if (is_fuchsia) {
333      # TODO(crbug.com/1185811): Investigate removing the requirement for
334      # job_policy_ambient_mark_vmo_exec.
335      test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
336      additional_manifest_fragments = [
337        "//build/config/fuchsia/test/present_view.shard.test-cml",
338        "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
339      ]
340    }
341
342    if (is_ios) {
343      xcode_extra_attributes = {
344        SUPPORTS_MACCATALYST = "YES"
345      }
346
347      # Need to bundle the libraries inside the .app.
348      deps += [ "$angle_root:angle" ]
349    }
350  }
351}
352
353if (angle_enable_cl_testing) {
354  copy("opencl_icd") {
355    sources = [ "$angle_root/src/tests/cl_support/ancle.icd" ]
356    outputs = [ "$root_out_dir/$angle_data_dir/{{source_file_part}}" ]
357  }
358
359  template("angle_oclcts_test") {
360    angle_test("angle_oclcts_${target_name}") {
361      testonly = true
362      sources = [ "$angle_root/src/tests/cl_support/angle_oclcts_gtest.cpp" ]
363
364      deps = [
365        "$angle_root:angle_common",
366        "$angle_root:cl_includes",
367        "$angle_root/third_party/OpenCL-CTS/gn:test_common",
368        "$angle_root/third_party/OpenCL-CTS/gn/${invoker.group}:${invoker.suite}",
369        "$angle_root/third_party/OpenCL-ICD-Loader:opencl_icd_loader",
370        "//third_party/googletest:gtest",
371      ]
372      defines = [
373        "CL_TARGET_OPENCL_VERSION=300",
374        "ANGLE_CL_SUITE_NAME=\"${invoker.suite}\"",
375      ]
376      if (!is_android) {
377        defines += [ "ANGLE_OPENCL_ICD_PATH=\"$angle_data_dir\"" ]
378      }
379      cflags = [
380        "-Wno-deprecated-declarations",
381        "-Wno-#warnings",
382        "-Wno-format",
383        "-Wno-vla-cxx-extension",
384        "-Wno-deprecated-volatile",
385        "-Wno-c++11-narrowing",
386      ]
387      include_dirs = [
388        "$angle_root/third_party/OpenCL-CTS/src/test_common",
389        "$angle_root/third_party/OpenCL-CTS/src/test_common/autotest",
390        "$angle_root/third_party/OpenCL-CTS/src/test_common/harness",
391        "$angle_root/third_party/OpenCL-CTS/src/test_common/miniz",
392        "$angle_root/third_party/OpenCL-CTS/src/test_conformance/",
393        "$angle_root/third_party/OpenCL-CTS/",
394        "$angle_root/src/tests/",
395      ]
396      configs += [ "${angle_root}:libANGLE_config" ]
397
398      deps += [
399        ":angle_common_test_utils_static",
400        "$angle_root:angle_static",
401      ]
402      data = [
403        "$angle_root/src/tests/cl_support/openclcts_expectations.txt",
404        "$angle_root/src/tests/cl_support/openclcts_mustpass.txt",
405      ]
406
407      data_deps += [
408        ":opencl_icd",
409        "$angle_root:libEGL",
410        "$angle_root:libGLESv2",
411        "$angle_root/src/libOpenCL:angle_cl",
412      ]
413    }
414  }
415
416  oclcts_targets = [
417    "SVM svm",
418    "allocations allocations",
419    "api api",
420    "atomics atomics",
421    "basic basic",
422    "buffers buffers",
423    "c11_atomics c11_atomics",
424    "commonfns commonfns",
425    "compiler compiler",
426    "computeinfo computeinfo",
427    "contractions contractions",
428    "conversions conversions",
429    "device_execution device_execution",
430    "device_partition device_partition",
431    "device_timer device_timer",
432    "events events",
433    "extensions/cl_ext_cxx_for_opencl cl_ext_cxx_for_opencl",
434    "extensions/cl_khr_command_buffer cl_khr_command_buffer",
435    "extensions/cl_khr_semaphore cl_khr_semaphore",
436    "generic_address_space generic_address_space",
437    "geometrics geometrics",
438    "half half",
439    "images/clCopyImage cl_copy_images",
440    "images/clFillImage cl_fill_images",
441    "images/clGetInfo cl_get_info",
442    "images/clReadWriteImage cl_read_write_images",
443    "images/kernel_image_methods kernel_image_methods",
444    "images/kernel_read_write image_streams",
445    "images/samplerlessReads samplerless_reads",
446    "integer_ops integer_ops",
447    "math_brute_force bruteforce",
448    "mem_host_flags mem_host_flags",
449    "multiple_device_context multiples",
450    "non_uniform_work_group non_uniform_work_group",
451    "pipes pipes",
452    "printf printf",
453    "profiling profiling",
454    "relationals relationals",
455    "select select",
456    "spir spir",
457    "spirv_new spirv_new",
458
459    # CTS build error, fixed in https://github.com/KhronosGroup/OpenCL-CTS/pull/1906
460    #"subgroups subgroups",
461    "thread_dimensions thread_dimensions",
462    "vectors vectors",
463    "workgroups workgroups",
464  ]
465
466  foreach(_group_and_suite_joined, oclcts_targets) {
467    _group_and_suite = []
468    _group_and_suite = string_split(_group_and_suite_joined)
469    _group = _group_and_suite[0]
470    _suite = _group_and_suite[1]
471
472    angle_oclcts_test(_suite) {
473      group = _group
474      suite = _suite
475    }
476  }
477
478  group("angle_openclcts") {
479    testonly = true
480    deps = []
481    foreach(_group_and_suite_joined, oclcts_targets) {
482      _group_and_suite = []
483      _group_and_suite = string_split(_group_and_suite_joined)
484      _suite = _group_and_suite[1]
485
486      deps += [ ":angle_oclcts_${_suite}" ]
487    }
488  }
489}
490
491if (is_win || is_linux || is_chromeos || is_android || is_fuchsia || is_apple) {
492  import("angle_white_box_tests.gni")
493
494  angle_test("angle_white_box_tests") {
495    include_dirs = [ "." ]
496    sources = angle_white_box_tests_sources + [ "angle_generic_tests_main.cpp" ]
497
498    if (is_win && angle_enable_d3d11) {
499      sources += angle_white_box_tests_win_sources
500    }
501
502    configs += [ "${angle_root}:libANGLE_config" ]
503
504    deps = [
505      ":angle_common_test_utils_static",
506      "$angle_root:angle_static",
507    ]
508
509    deps += [ "${angle_root}:angle_gl_enum_utils" ]
510
511    if (angle_enable_vulkan) {
512      sources += angle_white_box_tests_vulkan_sources
513      deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ]
514    }
515  }
516}
517
518config("angle_maybe_has_histograms") {
519  if (angle_has_histograms) {
520    defines = [ "ANGLE_HAS_HISTOGRAMS=1" ]
521    include_dirs = [ "$root_gen_dir" ]
522  } else {
523    defines = [ "ANGLE_HAS_HISTOGRAMS=0" ]
524  }
525}
526
527template("angle_perftests_common") {
528  assert(defined(invoker.test_utils))
529
530  angle_source_set(target_name) {
531    testonly = true
532    if (is_ios) {
533      # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
534      check_includes = false
535    }
536    sources = [
537      "../common/base/anglebase/trace_event/trace_event.h",
538      "perf_tests/ANGLEPerfTest.cpp",
539      "perf_tests/ANGLEPerfTest.h",
540      "perf_tests/ANGLEPerfTestArgs.cpp",
541      "perf_tests/ANGLEPerfTestArgs.h",
542      "perf_tests/DrawCallPerfParams.cpp",
543      "perf_tests/DrawCallPerfParams.h",
544      "perf_tests/third_party/perf/perf_result_reporter.cc",
545      "perf_tests/third_party/perf/perf_result_reporter.h",
546      "perf_tests/third_party/perf/perf_test.cc",
547      "perf_tests/third_party/perf/perf_test.h",
548      "test_utils/runner/HistogramWriter.h",
549      "test_utils/runner/TestSuite.h",
550    ]
551    public_deps = [
552      "$angle_root:angle_gl_enum_utils",
553      "$angle_root/src/tests:angle_test_expectations",
554      "$angle_root/third_party/rapidjson:rapidjson",
555      "${invoker.test_utils}",
556    ]
557    public_configs += [
558      ":angle_maybe_has_histograms",
559      "$angle_root:libANGLE_config",
560    ]
561  }
562}
563
564angle_perftests_common("angle_perftests_shared") {
565  test_utils = ":angle_common_test_utils_shared"
566}
567
568angle_perftests_common("angle_perftests_static") {
569  test_utils = ":angle_common_test_utils_static"
570}
571
572if (is_win || is_linux || is_chromeos || is_android || is_apple) {
573  import("angle_perftests.gni")
574
575  # This test suite is for perf tests that use ANGLE's internals in some direct way.
576  angle_test("angle_white_box_perftests") {
577    include_dirs = [ "." ]
578    sources =
579        angle_white_box_perf_tests_sources + [ "angle_perftests_main.cpp" ]
580
581    if (angle_enable_d3d11 || angle_enable_d3d9) {
582      sources += [ "perf_tests/IndexDataManagerTest.cpp" ]
583    }
584
585    deps = [
586      ":angle_perftests_static",
587      "$angle_root:angle_static",
588    ]
589
590    data = [
591      "$angle_root/scripts/process_angle_perf_results.py",
592      "$angle_root/src/tests/py_utils/android_helper.py",
593      "$angle_root/src/tests/py_utils/angle_metrics.py",
594      "$angle_root/src/tests/py_utils/angle_path_util.py",
595      "$angle_root/src/tests/run_perf_tests.py",
596    ]
597    data_deps = [ "//testing:run_perf_test" ]
598
599    if (angle_enable_vulkan) {
600      sources += angle_white_box_perf_tests_vulkan_sources
601      deps += [
602        "$angle_glslang_dir:glslang_lib_sources",
603        "$angle_root/src/common/vulkan:angle_vulkan_entry_points",
604      ]
605    }
606
607    # These tests depend on vulkan_command_buffer_utils, which is
608    # not yet compatible with mac and vulkan display/headless backend.
609    if (angle_enable_vulkan && !angle_use_vulkan_display && !is_apple) {
610      sources += angle_white_box_perf_tests_vulkan_command_buffer_sources
611    }
612  }
613}
614
615config("angle_enable_renderdoc") {
616  if (angle_enable_renderdoc) {
617    defines = [ "ANGLE_TEST_ENABLE_RENDERDOC_CAPTURE" ]
618  }
619}
620
621if (build_angle_perftests) {
622  import("angle_perftests.gni")
623
624  # This test suite is designed to run against a generic GL implementation.
625  angle_test("angle_perftests") {
626    include_dirs = [ "." ]
627    sources = angle_perf_tests_sources + [ "angle_perftests_main.cpp" ]
628
629    deps = [
630      ":angle_perftests_shared",
631      "$angle_spirv_tools_dir:spvtools_val",
632    ]
633
634    data = [
635      "$angle_root/scripts/process_angle_perf_results.py",
636      "$angle_root/src/tests/py_utils/android_helper.py",
637      "$angle_root/src/tests/py_utils/angle_metrics.py",
638      "$angle_root/src/tests/py_utils/angle_path_util.py",
639      "$angle_root/src/tests/run_perf_tests.py",
640    ]
641
642    data_deps = [
643      "${angle_root}:angle",
644      "//testing:run_perf_test",
645    ]
646
647    if (angle_build_mesa) {
648      data_deps += [ "$angle_root/third_party/mesa" ]
649    }
650
651    if (is_win || is_linux || is_chromeos) {
652      data_deps += [ "${angle_root}/third_party/glmark2:glmark2_angle" ]
653    }
654    if (is_win && target_cpu != "arm64") {
655      data_deps += [ "${angle_root}/third_party/glmark2:glmark2_wgl" ]
656    }
657    if (is_linux || is_chromeos) {
658      data_deps += [ "${angle_root}/third_party/glmark2:glmark2_glx" ]
659    }
660  }
661}
662
663if (build_angle_trace_tests) {
664  angle_test("angle_trace_tests") {
665    # http://anglebug.com/42264541: Traces with long shaders are hitting string literal
666    # limit in MSVC, so only compile them when using clang
667    assert(is_clang, "angle trace tests require clang")
668
669    if (is_ios) {
670      # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
671      check_includes = false
672    }
673
674    sources = [
675      "angle_trace_tests_main.cpp",
676      "perf_tests/TracePerfTest.cpp",
677    ]
678
679    deps = [
680      ":angle_perftests_shared",
681      ":wrap_restricted_trace_gold_tests",
682      ":wrap_restricted_trace_perf",
683      "$angle_root:angle_compression",
684      "$angle_root/util:angle_frame_capture_test_utils",
685      "$angle_root/util:angle_png_utils",
686      "restricted_traces:gen_trace_list_json",
687    ]
688
689    # If this flag is set, we want to build the trace libraries independent of the APK, i.e. not packaged.
690    # We're doing this for size reasons - the APK is too large if you include all the traces.
691    if (restricted_traces_outside_of_apk) {
692      defines = [ "ANGLE_TRACE_EXTERNAL_BINARIES" ]
693      deps += [ "$angle_root/util:angle_trace_loader" ]
694    } else {
695      deps += [
696        "$angle_root/util:angle_trace_interpreter",
697        "restricted_traces:angle_restricted_traces",
698      ]
699    }
700
701    data = [ "$angle_root/src/tests/py_utils/android_helper.py" ]
702
703    if (is_android) {
704      android_test_runner_script =
705          "$angle_root/src/tests/angle_android_test_runner.py"
706      data += [ "$android_test_runner_script" ]
707    }
708
709    data_deps = [ "${angle_root}:angle" ]
710
711    if (is_clang) {
712      # Allows us to edit traces and remove chunks of code without compile warnings.
713      cflags_cc = [ "-Wno-unused-const-variable" ]
714    }
715  }
716
717  group("angle_trace_perf_tests") {
718    testonly = true
719
720    data = [
721      "$angle_root/scripts/process_angle_perf_results.py",
722      "$angle_root/src/tests/py_utils/angle_metrics.py",
723      "$angle_root/src/tests/py_utils/angle_path_util.py",
724      "$angle_root/src/tests/restricted_traces/restricted_trace_perf.py",
725      "$angle_root/src/tests/run_perf_tests.py",
726    ]
727
728    data_deps = [
729      ":angle_trace_tests",
730      "//testing:run_perf_test",
731    ]
732
733    if (restricted_traces_outside_of_apk) {
734      deps = [ "restricted_traces:angle_restricted_traces__unpacked_libs" ]
735    }
736  }
737
738  group("angle_trace_interpreter_tests") {
739    testonly = true
740    data = [
741      "restricted_traces/gen_restricted_traces.py",
742      "restricted_traces/retrace_restricted_traces.py",
743    ]
744    data_deps = [ ":angle_trace_perf_tests" ]
745  }
746
747  group("angle_capture_tests") {
748    testonly = true
749    data = [
750      "capture_tests/capture_tests.py",
751      "capture_tests/expected",
752    ]
753    if (is_android) {
754      data += [ "$angle_root/src/tests/angle_android_test_runner.py" ]
755    }
756    data_deps = [ ":angle_end2end_tests" ]
757  }
758
759  action("wrap_restricted_trace_perf") {
760    script = "//scripts/angle_test_wrapper.py"
761
762    outputs = [ "$root_build_dir/restricted_trace_perf" ]
763    args = [
764      rebase_path(outputs[0], root_build_dir),
765      "src/tests/restricted_traces/restricted_trace_perf.py",
766    ]
767  }
768
769  action("wrap_restricted_trace_gold_tests") {
770    script = "//scripts/angle_test_wrapper.py"
771
772    outputs = [ "$root_build_dir/restricted_trace_gold_tests" ]
773    args = [
774      rebase_path(outputs[0], root_build_dir),
775      "src/tests/restricted_traces/restricted_trace_gold_tests.py",
776    ]
777  }
778}
779
780###-----------------------------------------------------
781### ES 1 conformance tests
782###-----------------------------------------------------
783
784if (build_angle_gles1_conform_tests) {
785  gles1_conform_root = "$angle_root/third_party/gles1_conform"
786
787  config("angle_gles1_conform_support") {
788    include_dirs = [
789      "$gles1_conform_root",
790      "$gles1_conform_root/conform/conform",
791      "$gles1_conform_root/conform/conformshell",
792      "$gles1_conform_root/ctk",
793      "$gles1_conform_root/fixed",
794      "$gles1_conform_root/platform",
795    ]
796
797    defines = [
798      "COMMON",
799      "CONFORM_ALTERNATE_MAIN",
800
801      # NULLWS defines is only used in covegl/native.h, remove here.
802      # if needed please add it in angle_test("angle_gles1_covegl_no_gtest") defines.
803      #"NULLWS",
804    ]
805
806    # This is used by the tests to typedef uint32_t. For some reason only needed on mac.
807    if (is_apple) {
808      defines += [ "__linux" ]
809    }
810
811    cflags = []
812    if (is_clang) {
813      # Remove when crbug.com/428099 is resolved.
814      cflags += [
815        "-Wno-implicit-function-declaration",
816        "-Wno-implicit-int-float-conversion",
817        "-Wno-int-to-pointer-cast",
818        "-Wno-self-assign",
819        "-Wno-sign-compare",
820        "-Wno-unreachable-code-break",
821        "-Wno-unused-const-variable",
822        "-Wno-unused-result",
823        "-Wno-unused-variable",
824
825        # Upstream tests do null pointer arithmetic, so disable those warnings.
826        "-Wno-null-pointer-arithmetic",
827      ]
828    } else {
829      cflags += [ "/wd4101" ]  # unreferenced local variable
830    }
831  }
832
833  # This source set is a bit special so we don't use angle_source_set.
834  angle_gles1_conform_common_source = [
835    "$gles1_conform_root/ctk/ctk.h",
836    "$gles1_conform_root/ctk/ctkn.c",
837    "$gles1_conform_root/ctk/glext.c",
838    "$gles1_conform_root/fixed/fixed.c",
839    "$gles1_conform_root/fixed/float64.c",
840    "$gles1_conform_root/fixed/int32.c",
841    "$gles1_conform_root/fixed/int64.c",
842    "$gles1_conform_root/platform/gl_fixed_point.h",
843    "$gles1_conform_root/platform/gl_single_precision.h",
844    "$gles1_conform_root/platform/math_fixed.h",
845    "$gles1_conform_root/platform/math_float.h",
846    "$gles1_conform_root/platform/platform.h",
847    "$gles1_conform_root/platform/platform_gl.h",
848    "$gles1_conform_root/platform/platform_random.h",
849    "$gles1_conform_root/platform/platform_stdlib.h",
850    "$gles1_conform_root/platform/platform_types.h",
851    "$gles1_conform_root/platform/printf_fixed.h",
852    "$gles1_conform_root/platform/printf_float.h",
853    "$gles1_conform_root/platform/random.c",
854    "$gles1_conform_root/platform/stdlib_ansi.h",
855  ]
856
857  source_set("angle_gles1_conformance_no_gtest") {
858    configs += [
859      ":angle_gles1_conform_support",
860      "$angle_root:internal_config",
861    ]
862
863    public_configs = [
864      "$angle_root/util:angle_util_config",
865      "$angle_root:gl_prototypes",
866    ]
867
868    if (is_clang) {
869      cflags_c = [
870        "-Wno-implicit-fallthrough",
871        "-Wno-shadow",
872      ]
873    }
874
875    testonly = true
876
877    public_deps = [
878      "$angle_root:angle_static",
879      "$angle_root/util:angle_util_static",
880    ]
881
882    sources = [
883      "$gles1_conform_root/conform/conform/apfunc.c",
884      "$gles1_conform_root/conform/conform/appl.c",
885      "$gles1_conform_root/conform/conform/bclear.c",
886      "$gles1_conform_root/conform/conform/bcolor.c",
887      "$gles1_conform_root/conform/conform/bcorner.c",
888      "$gles1_conform_root/conform/conform/blend.c",
889      "$gles1_conform_root/conform/conform/bufobj.c",
890      "$gles1_conform_root/conform/conform/clip.c",
891      "$gles1_conform_root/conform/conform/colramp.c",
892      "$gles1_conform_root/conform/conform/copytex.c",
893      "$gles1_conform_root/conform/conform/dither.c",
894      "$gles1_conform_root/conform/conform/divzero.c",
895      "$gles1_conform_root/conform/conform/drawtex.c",
896      "$gles1_conform_root/conform/conform/fogexp.c",
897      "$gles1_conform_root/conform/conform/foglin.c",
898      "$gles1_conform_root/conform/conform/gets.c",
899      "$gles1_conform_root/conform/conform/l_ac.c",
900      "$gles1_conform_root/conform/conform/l_al.c",
901      "$gles1_conform_root/conform/conform/l_am.c",
902      "$gles1_conform_root/conform/conform/l_ap.c",
903      "$gles1_conform_root/conform/conform/l_as.c",
904      "$gles1_conform_root/conform/conform/l_dl.c",
905      "$gles1_conform_root/conform/conform/l_dm.c",
906      "$gles1_conform_root/conform/conform/l_dmn.c",
907      "$gles1_conform_root/conform/conform/l_dmp.c",
908      "$gles1_conform_root/conform/conform/l_em.c",
909      "$gles1_conform_root/conform/conform/l_se.c",
910      "$gles1_conform_root/conform/conform/l_sed.c",
911      "$gles1_conform_root/conform/conform/l_sen.c",
912      "$gles1_conform_root/conform/conform/l_sep.c",
913      "$gles1_conform_root/conform/conform/l_sl.c",
914      "$gles1_conform_root/conform/conform/l_sm.c",
915      "$gles1_conform_root/conform/conform/l_sn.c",
916      "$gles1_conform_root/conform/conform/l_sp.c",
917      "$gles1_conform_root/conform/conform/lineaa.c",
918      "$gles1_conform_root/conform/conform/linehv.c",
919      "$gles1_conform_root/conform/conform/linerast.c",
920      "$gles1_conform_root/conform/conform/logicop.c",
921      "$gles1_conform_root/conform/conform/mask.c",
922      "$gles1_conform_root/conform/conform/mget.c",
923      "$gles1_conform_root/conform/conform/mipgen.c",
924      "$gles1_conform_root/conform/conform/miplevels.c",
925      "$gles1_conform_root/conform/conform/miplin.c",
926      "$gles1_conform_root/conform/conform/mipsel.c",
927      "$gles1_conform_root/conform/conform/mpalette.c",
928      "$gles1_conform_root/conform/conform/mquery.c",
929      "$gles1_conform_root/conform/conform/mstack.c",
930      "$gles1_conform_root/conform/conform/multitex.c",
931      "$gles1_conform_root/conform/conform/mustpass.c",
932      "$gles1_conform_root/conform/conform/packpix.c",
933      "$gles1_conform_root/conform/conform/pntaa.c",
934      "$gles1_conform_root/conform/conform/pntrast.c",
935      "$gles1_conform_root/conform/conform/pntsprt.c",
936      "$gles1_conform_root/conform/conform/pntszary.c",
937      "$gles1_conform_root/conform/conform/polycull.c",
938      "$gles1_conform_root/conform/conform/readfmt.c",
939      "$gles1_conform_root/conform/conform/rescalen.c",
940      "$gles1_conform_root/conform/conform/scissor.c",
941      "$gles1_conform_root/conform/conform/spclear.c",
942      "$gles1_conform_root/conform/conform/spcorner.c",
943      "$gles1_conform_root/conform/conform/spfunc.c",
944      "$gles1_conform_root/conform/conform/spop.c",
945      "$gles1_conform_root/conform/conform/tests.c",
946      "$gles1_conform_root/conform/conform/texcombine.c",
947      "$gles1_conform_root/conform/conform/texdecal.c",
948      "$gles1_conform_root/conform/conform/texedge.c",
949      "$gles1_conform_root/conform/conform/texpalet.c",
950      "$gles1_conform_root/conform/conform/trirast.c",
951      "$gles1_conform_root/conform/conform/tritile.c",
952      "$gles1_conform_root/conform/conform/userclip.c",
953      "$gles1_conform_root/conform/conform/vorder.c",
954      "$gles1_conform_root/conform/conform/vpclamp.c",
955      "$gles1_conform_root/conform/conform/xform.c",
956      "$gles1_conform_root/conform/conform/xformmix.c",
957      "$gles1_conform_root/conform/conform/xformn.c",
958      "$gles1_conform_root/conform/conform/xformvp.c",
959      "$gles1_conform_root/conform/conform/xformw.c",
960      "$gles1_conform_root/conform/conform/zbclear.c",
961      "$gles1_conform_root/conform/conform/zbfunc.c",
962      "$gles1_conform_root/conform/conformshell/conform.h",
963      "$gles1_conform_root/conform/conformshell/driver.c",
964      "$gles1_conform_root/conform/conformshell/driver.h",
965      "$gles1_conform_root/conform/conformshell/path.c",
966      "$gles1_conform_root/conform/conformshell/path.h",
967      "$gles1_conform_root/conform/conformshell/pathdata.c",
968      "$gles1_conform_root/conform/conformshell/pathdata.h",
969      "$gles1_conform_root/conform/conformshell/paths.c",
970      "$gles1_conform_root/conform/conformshell/shell.c",
971      "$gles1_conform_root/conform/conformshell/util.c",
972      "$gles1_conform_root/conform/conformshell/util.h",
973      "$gles1_conform_root/conform/conformshell/utilg.c",
974      "$gles1_conform_root/conform/conformshell/utilg.h",
975      "$gles1_conform_root/conform/conformshell/utilm.c",
976      "$gles1_conform_root/conform/conformshell/utilm.h",
977      "$gles1_conform_root/conform/conformshell/utilp.c",
978      "$gles1_conform_root/conform/conformshell/utilp.h",
979      "$gles1_conform_root/conform/conformshell/utilru.c",
980      "$gles1_conform_root/conform/conformshell/utilru.h",
981      "$gles1_conform_root/conform/conformshell/utils.c",
982      "$gles1_conform_root/conform/conformshell/utils.h",
983      "$gles1_conform_root/conform/conformshell/utilt.c",
984      "$gles1_conform_root/conform/conformshell/utilt.h",
985    ]
986
987    sources += angle_gles1_conform_common_source
988  }
989
990  angle_test("angle_gles1_conformance_tests") {
991    deps = [
992      ":angle_common_test_utils_static",
993      ":angle_gles1_conformance_no_gtest",
994    ]
995
996    include_dirs = [ "." ]
997
998    sources = [
999      "angle_generic_tests_main.cpp",
1000      "gles1_conformance_tests/ConformanceTests.cpp",
1001      "test_utils/ANGLETest.cpp",
1002      "test_utils/ANGLETest.h",
1003    ]
1004
1005    configs += [
1006      ":angle_gles1_conform_support",
1007      "${angle_root}:libANGLE_config",
1008      "${angle_root}:angle_backend_config",
1009    ]
1010  }
1011
1012  if (!is_win && !is_apple) {
1013    source_set("angle_gles1_covgl_no_gtest") {
1014      configs += [
1015        ":angle_gles1_conform_support",
1016        "$angle_root:internal_config",
1017      ]
1018
1019      public_configs = [
1020        "$angle_root/util:angle_util_config",
1021        "$angle_root:gl_prototypes",
1022      ]
1023
1024      testonly = true
1025
1026      public_deps = [
1027        "$angle_root:angle_static",
1028        "$angle_root/util:angle_util_static",
1029      ]
1030
1031      sources = [
1032        "$gles1_conform_root/conform/covgl/a.c",
1033        "$gles1_conform_root/conform/covgl/b.c",
1034        "$gles1_conform_root/conform/covgl/c.c",
1035        "$gles1_conform_root/conform/covgl/d.c",
1036        "$gles1_conform_root/conform/covgl/data.c",
1037        "$gles1_conform_root/conform/covgl/e.c",
1038        "$gles1_conform_root/conform/covgl/enum.c",
1039        "$gles1_conform_root/conform/covgl/f.c",
1040        "$gles1_conform_root/conform/covgl/g.c",
1041        "$gles1_conform_root/conform/covgl/h.c",
1042        "$gles1_conform_root/conform/covgl/i.c",
1043        "$gles1_conform_root/conform/covgl/l.c",
1044        "$gles1_conform_root/conform/covgl/m.c",
1045        "$gles1_conform_root/conform/covgl/n.c",
1046        "$gles1_conform_root/conform/covgl/o.c",
1047        "$gles1_conform_root/conform/covgl/p.c",
1048        "$gles1_conform_root/conform/covgl/q.c",
1049        "$gles1_conform_root/conform/covgl/r.c",
1050        "$gles1_conform_root/conform/covgl/s.c",
1051        "$gles1_conform_root/conform/covgl/shell.h",
1052        "$gles1_conform_root/conform/covgl/t.c",
1053        "$gles1_conform_root/conform/covgl/v.c",
1054        "$gles1_conform_root/conform/covgl/w.c",
1055      ]
1056
1057      sources += angle_gles1_conform_common_source
1058
1059      if (is_clang) {
1060        cflags_c = [ "-Wno-shadow" ]
1061      }
1062      defines = [ "ProbeEnum=ProbeEnumANGLE" ]
1063    }
1064
1065    angle_test("angle_gles1_covgl_tests") {
1066      deps = [
1067        ":angle_common_test_utils_static",
1068        ":angle_gles1_covgl_no_gtest",
1069      ]
1070
1071      include_dirs = [ "." ]
1072
1073      sources = [
1074        "$gles1_conform_root/conform/covgl/shell.c",
1075        "angle_generic_tests_main.cpp",
1076        "gles1_conformance_tests/CovglTests.cpp",
1077        "test_utils/ANGLETest.cpp",
1078        "test_utils/ANGLETest.h",
1079      ]
1080
1081      if (is_clang) {
1082        cflags_c = [ "-Wno-shadow" ]
1083      }
1084
1085      configs += [
1086        ":angle_gles1_conform_support",
1087        "${angle_root}:libANGLE_config",
1088        "${angle_root}:angle_backend_config",
1089      ]
1090    }
1091  }
1092  source_set("angle_gles1_primtest_no_gtest") {
1093    configs += [
1094      ":angle_gles1_conform_support",
1095      "$angle_root:internal_config",
1096    ]
1097
1098    public_configs = [
1099      "$angle_root/util:angle_util_config",
1100      "$angle_root:gl_prototypes",
1101    ]
1102
1103    testonly = true
1104
1105    public_deps = [
1106      "$angle_root:angle_static",
1107      "$angle_root/util:angle_util_static",
1108    ]
1109
1110    sources = [
1111      "$gles1_conform_root/conform/primtest/alias.c",
1112      "$gles1_conform_root/conform/primtest/alpha.c",
1113      "$gles1_conform_root/conform/primtest/blend.c",
1114      "$gles1_conform_root/conform/primtest/depth.c",
1115      "$gles1_conform_root/conform/primtest/dither.c",
1116      "$gles1_conform_root/conform/primtest/driver.c",
1117      "$gles1_conform_root/conform/primtest/driver.h",
1118      "$gles1_conform_root/conform/primtest/fog.c",
1119      "$gles1_conform_root/conform/primtest/hint.c",
1120      "$gles1_conform_root/conform/primtest/light.c",
1121      "$gles1_conform_root/conform/primtest/logic.c",
1122      "$gles1_conform_root/conform/primtest/prim.c",
1123      "$gles1_conform_root/conform/primtest/scissor.c",
1124      "$gles1_conform_root/conform/primtest/shade.c",
1125      "$gles1_conform_root/conform/primtest/shell.c",
1126      "$gles1_conform_root/conform/primtest/shell.h",
1127      "$gles1_conform_root/conform/primtest/stencil.c",
1128      "$gles1_conform_root/conform/primtest/texture.c",
1129      "$gles1_conform_root/conform/primtest/tproto.h",
1130    ]
1131
1132    sources += angle_gles1_conform_common_source
1133
1134    if (is_clang) {
1135      cflags_c = [ "-Wno-shadow" ]
1136    }
1137  }
1138
1139  angle_test("angle_gles1_primtest_tests") {
1140    deps = [
1141      ":angle_common_test_utils_static",
1142      ":angle_gles1_primtest_no_gtest",
1143    ]
1144
1145    include_dirs = [ "$gles1_conform_root/conform" ]
1146
1147    sources = [
1148      "angle_generic_tests_main.cpp",
1149      "gles1_conformance_tests/PrimtestTests.cpp",
1150      "test_utils/ANGLETest.cpp",
1151      "test_utils/ANGLETest.h",
1152    ]
1153
1154    configs += [
1155      ":angle_gles1_conform_support",
1156      "${angle_root}:angle_backend_config",
1157    ]
1158  }
1159  source_set("angle_gles1_covegl_no_gtest_source") {
1160    configs += [
1161      ":angle_gles1_conform_support",
1162      "$angle_root:internal_config",
1163    ]
1164
1165    public_configs = [
1166      "$angle_root/util:angle_util_config",
1167      "$angle_root:gl_prototypes",
1168    ]
1169
1170    testonly = true
1171
1172    public_deps = [
1173      "$angle_root:angle_static",
1174      "$angle_root/util:angle_util_static",
1175    ]
1176
1177    sources = [
1178      "$gles1_conform_root/conform/covegl/enum.c",
1179      "$gles1_conform_root/conform/covegl/native.h",
1180      "$gles1_conform_root/conform/covegl/test.c",
1181    ]
1182
1183    sources += angle_gles1_conform_common_source
1184
1185    if (is_clang) {
1186      cflags_c = [ "-Wno-shadow" ]
1187    }
1188
1189    if (!is_win && !is_linux && !is_chromeos) {
1190      defines = [ "NULLWS" ]
1191    }
1192  }
1193
1194  angle_test("angle_gles1_covegl_no_gtest") {
1195    deps = [ ":angle_gles1_covegl_no_gtest_source" ]
1196
1197    include_dirs = [ "$gles1_conform_root" ]
1198
1199    sources = [ "$gles1_conform_root/conform/covegl/shell.c" ]
1200
1201    if (is_win) {
1202      sources += [ "$gles1_conform_root/conform/covegl/native_w32.c" ]
1203    } else if (is_linux || is_chromeos) {
1204      sources += [ "$gles1_conform_root/conform/covegl/native.c" ]
1205    } else {
1206      sources += [ "$gles1_conform_root/conform/covegl/native_nws.c" ]
1207      defines += [ "NULLWS" ]
1208    }
1209
1210    configs += [ "${angle_root}:angle_backend_config" ]
1211
1212    defines += [ "COMMON" ]
1213
1214    if (is_clang) {
1215      cflags_c = [ "-Wno-shadow" ]
1216    }
1217
1218    if (is_win) {
1219      if (is_clang) {
1220        cflags = [ "-Wno-incompatible-pointer-types" ]
1221      } else {
1222        cflags = [ "/wd4133" ]  # 'function': incompatible types
1223      }
1224
1225      suppressed_configs += [
1226        "//build/config/win:lean_and_mean",
1227        "//build/config/win:nominmax",
1228        "//build/config/win:unicode",
1229      ]
1230    }
1231  }
1232}
1233
1234###-----------------------------------------------------
1235### dEQP tests
1236###-----------------------------------------------------
1237
1238if (build_angle_deqp_tests && !is_fuchsia) {
1239  import("deqp_support/deqp.gni")
1240  import("deqp_support/deqp_data_autogen.gni")
1241
1242  config("angle_deqp_support") {
1243    include_dirs = deqp_include_dirs
1244    if (is_win && !is_clang) {
1245      include_dirs += [ "$deqp_path/framework/platform/win32" ]
1246      cflags = [
1247        "/EHsc",  # dEQP requires exceptions
1248        "/wd4091",  # typedef ignored when no variable is declared
1249        "/wd4100",
1250        "/wd4101",  # unreferenced local variable
1251        "/wd4125",  # decimal digit terminates octal escape sequence
1252        "/wd4127",  # conditional expression constant
1253        "/wd4244",  # possible loss of data
1254        "/wd4245",  # argument signed/unsigned mismatch
1255        "/wd4297",  # function assumed not to throw an exception but does
1256        "/wd4302",  # truncation
1257        "/wd4311",  # pointer truncation
1258        "/wd4389",  # signed/unsigned mismatch
1259        "/wd4510",  # default constructor could not be generated
1260        "/wd4512",
1261        "/wd4610",  # cannot be instantiated
1262        "/wd4611",  # setjmp interaction non-portable
1263        "/wd4701",  # potentially uninit used
1264        "/wd4702",  # unreachable code
1265        "/wd4706",  # assignment within conditional expression
1266        "/wd4834",  # discarding return value of function with 'nodiscard'
1267                    # attribute
1268        "/wd4838",  # conversion requires a narrowing conversion
1269        "/wd4996",  # deprecated
1270      ]
1271    }
1272
1273    defines = [
1274      "DEQP_SUPPORT_GLES31=1",
1275      "DEQP_SUPPORT_GLES3=1",
1276      "DEQP_SUPPORT_GLES2=1",
1277      "DEQP_SUPPORT_EGL=1",
1278      "DEQP_TARGET_NAME=\"angle\"",
1279      "DEQP_GLES31_RUNTIME_LOAD=1",
1280      "DEQP_GLES3_RUNTIME_LOAD=1",
1281      "DEQP_GLES2_RUNTIME_LOAD=1",
1282      "QP_SUPPORT_PNG=1",
1283      "_HAS_EXCEPTIONS=1",
1284      "_MBCS",
1285      "ANGLE_DEQP_DATA_DIR=\"gen/vk_gl_cts_data/data\"",
1286    ]
1287
1288    if (is_android) {
1289      include_dirs += [ "$deqp_path/framework/platform/android" ]
1290
1291      _android_api = android64_ndk_api_level
1292      if (!angle_64bit_current_cpu) {
1293        _android_api = android32_ndk_api_level
1294      }
1295
1296      defines += [ "DE_ANDROID_API=" + "${_android_api}" ]
1297    }
1298
1299    if (is_clang) {
1300      # TODO(jmadill): Remove this once we fix dEQP.
1301      cflags_c = [ "-Wno-unused-local-typedef" ]
1302      cflags_cc = [
1303        "-Wno-sizeof-array-div",  # https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/2127
1304        "-Wno-string-conversion",  # implicit conversion turns string literal
1305                                   # into bool
1306        "-Wno-unused-function",
1307        "-Wno-unused-local-typedef",
1308        "-Wno-unused-result",  # ignoring return value of function declared with
1309                               # 'nodiscard' attribute
1310      ]
1311      if (!is_win) {
1312        # Not supported by clang-cl
1313        cflags_cc += [
1314          "-fwrapv",  # Treat signed integer overflow as two's complement
1315                      # https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/37
1316                      # https://android.googlesource.com/platform/external/deqp/+/ae6c306e39080de59a8535cf1797b27951dcaa6c%5E%21/
1317        ]
1318      }
1319    }
1320
1321    # Ask the system headers to expose all the regular function otherwise
1322    # dEQP doesn't compile and produces warnings about implicitly defined
1323    # functions.
1324    if (is_linux || is_chromeos) {
1325      # This has to be GNU_SOURCE as on Linux dEQP uses syscall()
1326      defines += [ "_GNU_SOURCE" ]
1327    }
1328    if (is_android) {
1329      # _XOPEN_SOURCE=600 is what is used in deqp/src/Android.mk
1330      defines += [ "_XOPEN_SOURCE=600" ]
1331    } else if (is_apple) {
1332      # Work-around for https://github.com/llvm/llvm-project/issues/117630
1333      defines += [ "_XOPEN_SOURCE=700" ]
1334    }
1335  }
1336
1337  deqp_undefine_configs = [
1338    "//build/config/compiler:chromium_code",
1339    "//build/config/compiler:no_exceptions",
1340    "//build/config/compiler:no_rtti",
1341    "${angle_root}:constructor_and_destructor_warnings",
1342    "${angle_root}:extra_warnings",
1343  ]
1344
1345  if (is_win) {
1346    deqp_undefine_configs += [
1347      "//build/config/win:lean_and_mean",
1348      "//build/config/win:nominmax",
1349      "//build/config/win:unicode",
1350    ]
1351  }
1352
1353  set_defaults("angle_deqp_source_set") {
1354    public_configs = []
1355    configs = angle_common_configs
1356    cflags = []
1357  }
1358
1359  template("angle_deqp_source_set") {
1360    angle_source_set(target_name) {
1361      testonly = true
1362      forward_variables_from(invoker, "*")
1363      suppressed_configs += deqp_undefine_configs
1364
1365      if (is_clang) {
1366        cflags += [
1367          # Suppress a spurious header warning. http://crbug.com/995046
1368          "-Wno-nonportable-include-path",
1369        ]
1370      }
1371    }
1372  }
1373
1374  config("angle_deqp_framework_debase_config") {
1375    include_dirs = [ "$deqp_path/framework/delibs/debase" ]
1376  }
1377
1378  angle_deqp_source_set("angle_deqp_framework_debase") {
1379    public_configs += [ ":angle_deqp_framework_debase_config" ]
1380    sources = deqp_framework_debase_sources
1381  }
1382
1383  config("angle_deqp_framework_decpp_config") {
1384    include_dirs = [ "$deqp_path/framework/delibs/decpp" ]
1385  }
1386
1387  angle_deqp_source_set("angle_deqp_framework_decpp") {
1388    public_configs += [
1389      ":angle_deqp_support",
1390      ":angle_deqp_framework_decpp_config",
1391      "//build/config/compiler:exceptions",
1392      "//build/config/compiler:no_chromium_code",
1393    ]
1394    if (is_clang) {
1395      cflags_cc = [
1396        # Supresses self assign warnings in SharedPtr_selfTest
1397        # Can be removed if dEQP or clang are fixed
1398        "-Wno-self-assign",
1399      ]
1400    }
1401
1402    public_deps = [
1403      ":angle_deqp_framework_debase",
1404      ":angle_deqp_framework_delibs",
1405    ]
1406    sources = deqp_framework_decpp_sources
1407  }
1408
1409  config("angle_deqp_framework_xexml_config") {
1410    include_dirs = [ "$deqp_path/framework/xexml" ]
1411  }
1412
1413  angle_deqp_source_set("angle_deqp_framework_xexml") {
1414    public_configs += [
1415      ":angle_deqp_support",
1416      ":angle_deqp_framework_decpp_config",
1417      ":angle_deqp_framework_delibs_config",
1418      "//build/config/compiler:exceptions",
1419      "//build/config/compiler:no_chromium_code",
1420    ]
1421
1422    public_deps = [
1423      ":angle_deqp_framework_debase",
1424      ":angle_deqp_framework_decpp",
1425      ":angle_deqp_framework_delibs",
1426    ]
1427    sources = deqp_framework_xexml_sources
1428  }
1429
1430  config("angle_deqp_libtester_config") {
1431    defines = [ "ANGLE_DEQP_LIBTESTER_IMPLEMENTATION" ]
1432
1433    if (is_clang) {
1434      # TODO(jmadill): Remove this once we fix dEQP.
1435      cflags_cc = [
1436        "-Wno-delete-non-virtual-dtor",
1437        "-Wno-deprecated",
1438
1439        # Supresses self assign warning in setLumSat
1440        # Can be removed if dEQP or clang are fixed
1441        "-Wno-self-assign",
1442      ]
1443    }
1444  }
1445
1446  config("angle_deqp_framework_delibs_config") {
1447    include_dirs = [
1448      "$deqp_path/framework/delibs/debase",
1449      "$deqp_path/framework/delibs/depool",
1450      "$deqp_path/framework/delibs/dethread",
1451      "$deqp_path/framework/delibs/deutil",
1452      "$deqp_path/framework/delibs/destream",
1453    ]
1454
1455    # https://github.com/KhronosGroup/VK-GL-CTS/commit/9f306457b48b3f8258ca44462003ef39b80a7515
1456    if (is_clang) {
1457      if (target_cpu == "arm") {
1458        defines = [ "DE_FENV_ACCESS_ON=" ]
1459      } else {
1460        defines = [ "DE_FENV_ACCESS_ON=_Pragma(\"STDC FENV_ACCESS ON\")" ]
1461      }
1462    } else if (is_win) {
1463      defines = [ "DE_FENV_ACCESS_ON=__pragma(fenv_access (on))" ]
1464    }
1465  }
1466
1467  angle_deqp_source_set("angle_deqp_framework_delibs") {
1468    sources = deqp_framework_delibs_sources
1469
1470    if (is_win) {
1471      sources += deqp_framework_delibs_sources_win
1472    }
1473    if (is_linux || is_chromeos || is_android || is_apple) {
1474      sources += deqp_framework_delibs_sources_unix
1475    }
1476
1477    public_configs = [
1478      ":angle_deqp_framework_delibs_config",
1479      ":angle_deqp_support",
1480    ]
1481
1482    public_deps = [ ":angle_deqp_framework_debase" ]
1483  }
1484
1485  config("angle_deqp_framework_common_config") {
1486    include_dirs = [
1487      "$deqp_path/framework/common",
1488      "$deqp_path/framework/randomshaders",
1489      "$deqp_path/framework/referencerenderer",
1490    ]
1491  }
1492
1493  angle_deqp_source_set("angle_deqp_framework_common") {
1494    sources = deqp_framework_common_sources
1495    public_configs = [ ":angle_deqp_framework_common_config" ]
1496    public_deps = [
1497      ":angle_deqp_framework_decpp",
1498      ":angle_deqp_framework_qphelper",
1499      ":angle_deqp_framework_xexml",
1500    ]
1501  }
1502
1503  config("angle_deqp_framework_opengl_config") {
1504    include_dirs = [
1505      "$deqp_path/framework/egl/wrapper",
1506      "$deqp_path/framework/opengl",
1507      "$deqp_path/framework/opengl/simplereference",
1508      "$deqp_path/framework/opengl/wrapper",
1509    ]
1510  }
1511
1512  angle_deqp_source_set("angle_deqp_framework_opengl") {
1513    sources = deqp_framework_opengl_sources
1514    public_configs = [ ":angle_deqp_framework_opengl_config" ]
1515    public_deps = [ ":angle_deqp_framework_common" ]
1516  }
1517
1518  config("angle_deqp_framework_egl_config") {
1519    include_dirs = [
1520      "$deqp_path/framework/egl",
1521      "$deqp_path/framework/egl/wrapper",
1522    ]
1523  }
1524
1525  angle_deqp_source_set("angle_deqp_framework_egl") {
1526    sources = deqp_framework_egl_sources
1527    public_configs = [ ":angle_deqp_framework_egl_config" ]
1528    public_deps = [ ":angle_deqp_framework_opengl" ]
1529  }
1530
1531  config("angle_deqp_framework_qphelper_config") {
1532    include_dirs = [ "$deqp_path/framework/qphelper" ]
1533  }
1534
1535  angle_deqp_source_set("angle_deqp_framework_qphelper") {
1536    sources = deqp_framework_qphelper_sources
1537    public_deps = [
1538      ":angle_deqp_framework_delibs",
1539      "${angle_libpng_dir}:libpng",
1540    ]
1541    public_configs = [ ":angle_deqp_framework_qphelper_config" ]
1542  }
1543
1544  config("angle_deqp_glshared_config") {
1545    include_dirs = [ "$deqp_path/modules/glshared" ]
1546  }
1547
1548  angle_deqp_source_set("angle_deqp_glshared") {
1549    sources = deqp_glshared_sources
1550    public_deps = [ ":angle_deqp_framework_opengl" ]
1551    public_configs = [ ":angle_deqp_glshared_config" ]
1552  }
1553
1554  angle_deqp_source_set("angle_deqp_framework_platform") {
1555    if (is_ios) {
1556      # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
1557      check_includes = false
1558    }
1559    sources = deqp_framework_platform_sources
1560    libs = []
1561    if (is_win) {
1562      sources += [
1563        "$deqp_path/framework/platform/win32/tcuWGL.cpp",
1564        "$deqp_path/framework/platform/win32/tcuWGLContextFactory.cpp",
1565        "$deqp_path/framework/platform/win32/tcuWin32EGLNativeDisplayFactory.cpp",
1566        "$deqp_path/framework/platform/win32/tcuWin32Window.cpp",
1567      ]
1568    }
1569    if (is_linux) {
1570      sources += [
1571        "$deqp_path/framework/platform/lnx/X11/tcuLnxX11.cpp",
1572        "$deqp_path/framework/platform/lnx/X11/tcuLnxX11.hpp",
1573        "$deqp_path/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp",
1574        "$deqp_path/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.hpp",
1575        "$deqp_path/framework/platform/lnx/tcuLnx.cpp",
1576        "$deqp_path/framework/platform/lnx/tcuLnx.hpp",
1577        "$deqp_path/framework/platform/lnx/tcuLnxEglPlatform.cpp",
1578        "$deqp_path/framework/platform/lnx/tcuLnxEglPlatform.hpp",
1579      ]
1580    }
1581    public_deps = [
1582      ":angle_deqp_framework_common",
1583      ":angle_deqp_framework_egl",
1584    ]
1585  }
1586
1587  angle_deqp_source_set("angle_deqp_libtester") {
1588    if (is_ios) {
1589      # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
1590      check_includes = false
1591    }
1592    public_deps = [
1593      ":angle_deqp_framework_platform",
1594      ":angle_deqp_glshared",
1595      "$angle_root:angle_common",
1596      "$angle_root/util:angle_util",
1597    ]
1598
1599    data_deps = [ "${angle_root}:angle" ]
1600
1601    configs += [ "${angle_root}:library_name_config" ]
1602    public_configs += [
1603      ":angle_deqp_libtester_config",
1604      "${angle_root}:libANGLE_config",
1605    ]
1606    sources = deqp_libtester_sources
1607    if (is_android) {
1608      libs = [ "log" ]
1609    }
1610  }
1611
1612  set_defaults("angle_deqp_gtest") {
1613    deps = []
1614    sources = []
1615    data = []
1616    data_deps = []
1617  }
1618
1619  template("angle_deqp_gtest") {
1620    _api = target_name
1621
1622    config_name = "angle_deqp_${_api}_config"
1623    config(config_name) {
1624      defines = invoker.defines
1625    }
1626
1627    shared_library_name = "angle_deqp_lib${_api}"
1628    angle_shared_library(shared_library_name) {
1629      forward_variables_from(invoker,
1630                             [
1631                               "sources",
1632                               "deps",
1633                               "data",
1634                               "data_deps",
1635                             ])
1636
1637      testonly = true
1638
1639      deps += [
1640        ":angle_deqp_libtester",
1641        "$angle_root/util:angle_test_utils",
1642        "$angle_root/util:angle_util",
1643      ]
1644
1645      suppressed_configs += deqp_undefine_configs
1646      public_configs += [ ":$config_name" ]
1647
1648      sources += [
1649        "deqp_support/angle_deqp_libtester.h",
1650        "deqp_support/angle_deqp_libtester_main.cpp",
1651        "deqp_support/tcuANGLEPlatform.cpp",
1652        "deqp_support/tcuANGLEPlatform.h",
1653      ]
1654
1655      if ((is_mac || is_ios) && !is_component_build) {
1656        ldflags = [
1657          "-install_name",
1658          "@rpath/lib${shared_library_name}.dylib",
1659        ]
1660      }
1661    }
1662
1663    angle_test("angle_deqp_${_api}_tests") {
1664      deps = [
1665        ":${shared_library_name}",
1666        "$angle_root:angle_common",
1667        "$angle_root/util:angle_util",
1668      ]
1669
1670      # Must be included outside of the source set for the define
1671      sources = [
1672        "angle_deqp_tests_main.cpp",
1673        "deqp_support/angle_deqp_gtest.cpp",
1674      ]
1675
1676      expectations_file = "deqp_${_api}_test_expectations.txt"
1677      if (defined(invoker.expectations_file)) {
1678        expectations_file = invoker.expectations_file
1679      }
1680      data = [
1681        "deqp_support/${expectations_file}",
1682        "${invoker.mustpass_dir}/${invoker.mustpass_name}",
1683      ]
1684    }
1685  }
1686
1687  _android_mustpass = "$deqp_path/android/cts/main"
1688  _aosp_egl_mustpass = "$deqp_path/external/openglcts/data/gl_cts/data/mustpass/egl/aosp_mustpass/main"
1689  _aosp_gles_mustpass = "$deqp_path/external/openglcts/data/gl_cts/data/mustpass/gles/aosp_mustpass/main"
1690  _khronos_gl_mustpass = "$deqp_path/external/openglcts/data/gl_cts/data/mustpass/gl/khronos_mustpass/main"
1691  _khronos_gles_mustpass = "$deqp_path/external/openglcts/data/gl_cts/data/mustpass/gles/khronos_mustpass/main"
1692  _khronos_gles_noctx_mustpass = "$deqp_path/external/openglcts/data/gl_cts/data/mustpass/gles/khronos_mustpass_noctx/main"
1693  _khronos_gles_single_mustpass = "$deqp_path/external/openglcts/data/gl_cts/data/mustpass/gles/khronos_mustpass_single/main"
1694
1695  angle_deqp_source_set("angle_deqp_gles2_common") {
1696    sources = deqp_gles2_sources
1697    public_deps = [
1698      ":angle_deqp_framework_egl",
1699      ":angle_deqp_glshared",
1700    ]
1701  }
1702
1703  angle_deqp_source_set("angle_deqp_gles3_common") {
1704    sources = deqp_gles3_sources
1705    public_deps = [
1706      ":angle_deqp_framework_egl",
1707      ":angle_deqp_glshared",
1708    ]
1709  }
1710
1711  angle_deqp_source_set("angle_deqp_gles31_common") {
1712    sources = deqp_gles31_sources
1713    public_deps = [
1714      ":angle_deqp_framework_egl",
1715      ":angle_deqp_glshared",
1716    ]
1717  }
1718
1719  template("angle_deqp_core_gtest") {
1720    _api = target_name
1721    forward_variables_from(invoker, [ "mustpass_suffix" ])
1722    if (mustpass_suffix != "main") {
1723      target_name = "${_api}_${mustpass_suffix}"
1724      target_name = string_replace(target_name, "-", "_")
1725    }
1726    angle_deqp_gtest(target_name) {
1727      forward_variables_from(invoker, "*")
1728
1729      mustpass_name = "${_api}-${mustpass_suffix}.txt"
1730
1731      deps += angle_deqp_data_copy_targets
1732
1733      data = []
1734      if (_api == "gles2") {
1735        data = angle_deqp_data_gles2
1736      } else if (_api == "gles3") {
1737        data = angle_deqp_data_gles3
1738      } else if (_api == "gles31") {
1739        data = angle_deqp_data_gles31
1740      } else {
1741        # Make sure we include something so that angle_deqp_libtester_main.cpp can find something.
1742        data = [ "$root_gen_dir/vk_gl_cts_data/data/gles2/shaders/misc.test" ]
1743      }
1744    }
1745  }
1746
1747  angle_deqp_core_gtest("gles2") {
1748    defines = [ "ANGLE_DEQP_GLES2_TESTS" ]
1749    deps = [ ":angle_deqp_gles2_common" ]
1750    mustpass_dir = _aosp_gles_mustpass
1751    mustpass_suffix = "main"
1752  }
1753
1754  angle_deqp_core_gtest("gles3") {
1755    defines = [ "ANGLE_DEQP_GLES3_TESTS" ]
1756    deps = [ ":angle_deqp_gles3_common" ]
1757    mustpass_dir = _aosp_gles_mustpass
1758    mustpass_suffix = "main"
1759  }
1760
1761  angle_deqp_core_gtest("gles3") {
1762    defines = [ "ANGLE_DEQP_GLES3_MULTISAMPLE_TESTS" ]
1763    deps = [ ":angle_deqp_gles3_common" ]
1764    mustpass_dir = _aosp_gles_mustpass
1765    mustpass_suffix = "multisample"
1766  }
1767
1768  angle_deqp_core_gtest("gles31") {
1769    defines = [ "ANGLE_DEQP_GLES31_TESTS" ]
1770    deps = [ ":angle_deqp_gles31_common" ]
1771    mustpass_dir = _aosp_gles_mustpass
1772    mustpass_suffix = "main"
1773  }
1774
1775  angle_deqp_core_gtest("gles31") {
1776    defines = [ "ANGLE_DEQP_GLES31_MULTISAMPLE_TESTS" ]
1777    deps = [ ":angle_deqp_gles31_common" ]
1778    mustpass_dir = _aosp_gles_mustpass
1779    mustpass_suffix = "multisample"
1780  }
1781
1782  angle_deqp_core_gtest("egl") {
1783    defines = [ "ANGLE_DEQP_EGL_TESTS" ]
1784    sources = deqp_egl_sources
1785    mustpass_dir = _aosp_egl_mustpass
1786    mustpass_suffix = "main"
1787  }
1788
1789  if (is_android) {
1790    angle_deqp_core_gtest("gles3") {
1791      defines = [ "ANGLE_DEQP_GLES3_565_NO_DEPTH_NO_STENCIL_TESTS" ]
1792      deps = [ ":angle_deqp_gles3_common" ]
1793      mustpass_dir = _aosp_gles_mustpass
1794      mustpass_suffix = "565-no-depth-no-stencil"
1795    }
1796
1797    angle_deqp_core_gtest("gles31") {
1798      defines = [ "ANGLE_DEQP_GLES31_565_NO_DEPTH_NO_STENCIL_TESTS" ]
1799      deps = [ ":angle_deqp_gles31_common" ]
1800      mustpass_dir = _aosp_gles_mustpass
1801      mustpass_suffix = "565-no-depth-no-stencil"
1802    }
1803  }
1804
1805  # The CTS also includes a set of "KHR" tests that are separate from the main body of dEQP tests.
1806
1807  config("angle_deqp_khr_common_config") {
1808    include_dirs = [
1809      "$deqp_path/external/openglcts/modules/common",
1810      "$deqp_path/external/openglcts/modules/common/subgroups",
1811      "$deqp_path/external/openglcts/modules/gl",
1812      "$deqp_path/external/openglcts/modules/gles2",
1813      "$deqp_path/external/openglcts/modules/gles3",
1814      "$deqp_path/external/openglcts/modules/gles31",
1815      "$deqp_path/external/openglcts/modules/gles32",
1816      "$deqp_path/external/openglcts/modules/glesext",
1817    ]
1818    if (is_clang) {
1819      cflags = [ "-Wno-header-hygiene" ]  # using namespace directive in global
1820                                          # context in header
1821    }
1822  }
1823
1824  angle_deqp_source_set("angle_deqp_khr_common") {
1825    sources = deqp_khr_common_sources + deqp_khr_test_module_headers +
1826              deqp_khr_gl_sources + deqp_khr_gles2_sources +
1827              deqp_khr_gles3_sources + deqp_khr_gles31_sources +
1828              deqp_khr_gles32_sources + deqp_khr_glesext_sources +
1829              [ "deqp_support/glcTestPackageEntry_override.cpp" ]
1830    public_deps = [
1831      ":angle_deqp_framework_platform",
1832      ":angle_deqp_glshared",
1833      "${angle_glslang_dir}:glslang_lib_sources",
1834      "${angle_spirv_tools_dir}:spvtools_val",
1835    ]
1836    public_configs = [ ":angle_deqp_khr_common_config" ]
1837
1838    # This is a bit of a hack so one test can capture memory limits.
1839    include_dirs = [ "$deqp_path/external/vulkancts/framework/vulkan" ]
1840  }
1841
1842  template("angle_deqp_khr_gtest") {
1843    angle_deqp_gtest(target_name) {
1844      forward_variables_from(invoker, "*")
1845      deps = [ ":angle_deqp_khr_common" ]
1846      deps += angle_deqp_data_copy_targets
1847      if (api == "gles2") {
1848        # Make sure we include something so that angle_deqp_libtester_main.cpp can find something.
1849        data = [ "$root_gen_dir/vk_gl_cts_data/data/gles2/shaders/misc.test" ]
1850        mustpass_dir = _khronos_gles_mustpass
1851      } else if (api == "gles3") {
1852        data = angle_deqp_external_openglcts_data_gl_cts_data_gles3
1853        mustpass_dir = _khronos_gles_mustpass
1854      } else if (api == "gles31") {
1855        data = angle_deqp_external_openglcts_data_gl_cts_data_gles31
1856        mustpass_dir = _khronos_gles_mustpass
1857      } else if (api == "gles32") {
1858        data = angle_deqp_external_openglcts_data_gl_cts_data_gles32
1859        mustpass_dir = _khronos_gles_mustpass
1860      } else {
1861        assert(false)
1862      }
1863    }
1864  }
1865
1866  angle_deqp_khr_gtest("khr_gles2") {
1867    defines = [ "ANGLE_DEQP_KHR_GLES2_TESTS" ]
1868    mustpass_name = "gles2-khr-main.txt"
1869    api = "gles2"
1870  }
1871
1872  angle_deqp_khr_gtest("khr_gles3") {
1873    defines = [ "ANGLE_DEQP_KHR_GLES3_TESTS" ]
1874    mustpass_name = "gles3-khr-main.txt"
1875    api = "gles3"
1876  }
1877
1878  angle_deqp_khr_gtest("khr_gles31") {
1879    defines = [ "ANGLE_DEQP_KHR_GLES31_TESTS" ]
1880    mustpass_name = "gles31-khr-main.txt"
1881    api = "gles31"
1882  }
1883
1884  angle_deqp_khr_gtest("khr_gles32") {
1885    defines = [ "ANGLE_DEQP_KHR_GLES32_TESTS" ]
1886    mustpass_name = "gles32-khr-main.txt"
1887    api = "gles32"
1888  }
1889
1890  template("angle_deqp_khr_noctx_gtest") {
1891    angle_deqp_gtest(target_name) {
1892      forward_variables_from(invoker, "*")
1893      deps = [ ":angle_deqp_khr_common" ]
1894      deps += angle_deqp_data_copy_targets
1895      if (api == "gles2") {
1896        data = [ "$root_gen_dir/vk_gl_cts_data/data/gles2/shaders/misc.test" ]
1897        mustpass_dir = _khronos_gles_noctx_mustpass
1898      } else if (api == "gles32") {
1899        data = angle_deqp_external_openglcts_data_gl_cts_data_gles32
1900        mustpass_dir = _khronos_gles_noctx_mustpass
1901      } else {
1902        assert(false)
1903      }
1904    }
1905  }
1906
1907  angle_deqp_khr_noctx_gtest("khr_noctx_gles2") {
1908    defines = [ "ANGLE_DEQP_KHR_NOCTX_GLES2_TESTS" ]
1909    mustpass_name = "gles2-khr-noctx-main.txt"
1910    api = "gles2"
1911  }
1912
1913  angle_deqp_khr_noctx_gtest("khr_noctx_gles32") {
1914    defines = [ "ANGLE_DEQP_KHR_NOCTX_GLES32_TESTS" ]
1915    mustpass_name = "gles32-khr-noctx-main.txt"
1916    api = "gles32"
1917  }
1918
1919  template("angle_deqp_khr_single_gtest") {
1920    angle_deqp_gtest(target_name) {
1921      forward_variables_from(invoker, "*")
1922      deps = [ ":angle_deqp_khr_common" ]
1923      deps += angle_deqp_data_copy_targets
1924      if (api == "gles32") {
1925        data = angle_deqp_external_openglcts_data_gl_cts_data_gles32
1926        mustpass_dir = _khronos_gles_single_mustpass
1927      } else {
1928        assert(false)
1929      }
1930    }
1931  }
1932
1933  angle_deqp_khr_single_gtest("khr_single_gles32") {
1934    defines = [ "ANGLE_DEQP_KHR_SINGLE_GLES32_TESTS" ]
1935    mustpass_name = "gles32-khr-single.txt"
1936    api = "gles32"
1937  }
1938
1939  template("angle_deqp_rotate_gtest") {
1940    split_target = string_split(target_name, "_")
1941    _api = split_target[0]
1942    _rotate = split_target[1]
1943    angle_deqp_gtest(target_name) {
1944      forward_variables_from(invoker, "*")
1945
1946      if (_rotate == "rotate90") {
1947        mustpass_suffix = "rotate-landscape"
1948      } else if (_rotate == "rotate180") {
1949        mustpass_suffix = "rotate-reverse-portrait"
1950      } else if (_rotate == "rotate270") {
1951        mustpass_suffix = "rotate-reverse-landscape"
1952      } else {
1953        assert(false)
1954      }
1955
1956      mustpass_name = "${_api}-${mustpass_suffix}.txt"
1957
1958      deps += angle_deqp_data_copy_targets
1959
1960      data = []
1961      if (_api == "gles3") {
1962        data = angle_deqp_data_gles3
1963      } else if (_api == "gles31") {
1964        data = angle_deqp_data_gles31
1965      } else {
1966        assert(false)
1967      }
1968    }
1969  }
1970
1971  angle_deqp_rotate_gtest("gles3_rotate90") {
1972    defines = [ "ANGLE_DEQP_GLES3_ROTATE90_TESTS" ]
1973    deps = [ ":angle_deqp_gles3_common" ]
1974    mustpass_dir = _aosp_gles_mustpass
1975    expectations_file = "deqp_gles3_rotate_test_expectations.txt"
1976  }
1977
1978  angle_deqp_rotate_gtest("gles3_rotate180") {
1979    defines = [ "ANGLE_DEQP_GLES3_ROTATE180_TESTS" ]
1980    deps = [ ":angle_deqp_gles3_common" ]
1981    mustpass_dir = _aosp_gles_mustpass
1982    expectations_file = "deqp_gles3_rotate_test_expectations.txt"
1983  }
1984
1985  angle_deqp_rotate_gtest("gles3_rotate270") {
1986    defines = [ "ANGLE_DEQP_GLES3_ROTATE270_TESTS" ]
1987    deps = [ ":angle_deqp_gles3_common" ]
1988    mustpass_dir = _aosp_gles_mustpass
1989    expectations_file = "deqp_gles3_rotate_test_expectations.txt"
1990  }
1991
1992  angle_deqp_rotate_gtest("gles31_rotate90") {
1993    defines = [ "ANGLE_DEQP_GLES31_ROTATE90_TESTS" ]
1994    deps = [ ":angle_deqp_gles31_common" ]
1995    mustpass_dir = _aosp_gles_mustpass
1996    expectations_file = "deqp_gles31_rotate_test_expectations.txt"
1997  }
1998
1999  angle_deqp_rotate_gtest("gles31_rotate180") {
2000    defines = [ "ANGLE_DEQP_GLES31_ROTATE180_TESTS" ]
2001    deps = [ ":angle_deqp_gles31_common" ]
2002    mustpass_dir = _aosp_gles_mustpass
2003    expectations_file = "deqp_gles31_rotate_test_expectations.txt"
2004  }
2005
2006  angle_deqp_rotate_gtest("gles31_rotate270") {
2007    defines = [ "ANGLE_DEQP_GLES31_ROTATE270_TESTS" ]
2008    deps = [ ":angle_deqp_gles31_common" ]
2009    mustpass_dir = _aosp_gles_mustpass
2010    expectations_file = "deqp_gles31_rotate_test_expectations.txt"
2011  }
2012}
2013
2014group("angle_tests") {
2015  testonly = true
2016  deps = [
2017    ":angle_end2end_tests",
2018    ":angle_system_info_test",
2019    ":angle_unittests",
2020  ]
2021  if (angle_enable_cl_testing) {
2022    deps += [ ":angle_openclcts" ]
2023  }
2024  if (build_angle_perftests) {
2025    deps += [ ":angle_perftests" ]
2026  }
2027  if (build_angle_trace_tests) {
2028    deps += [ ":angle_trace_perf_tests" ]
2029    deps += [ "capture_tests:angle_capture_tests_multi_frame_trace" ]
2030    deps += [ "capture_tests:angle_capture_tests_active_textures_trace" ]
2031  }
2032  if (is_clang && angle_has_frame_capture) {
2033    deps += [ "capture_replay_tests" ]
2034  }
2035  if (!is_fuchsia) {
2036    deps += [
2037      ":angle_white_box_perftests",
2038      ":angle_white_box_tests",
2039    ]
2040  }
2041  if (build_angle_deqp_tests && !is_fuchsia) {
2042    deps += [
2043      ":angle_deqp_egl_tests",
2044      ":angle_deqp_gles2_tests",
2045      ":angle_deqp_gles31_multisample_tests",
2046      ":angle_deqp_gles31_rotate180_tests",
2047      ":angle_deqp_gles31_rotate270_tests",
2048      ":angle_deqp_gles31_rotate90_tests",
2049      ":angle_deqp_gles31_tests",
2050      ":angle_deqp_gles3_multisample_tests",
2051      ":angle_deqp_gles3_rotate180_tests",
2052      ":angle_deqp_gles3_rotate270_tests",
2053      ":angle_deqp_gles3_rotate90_tests",
2054      ":angle_deqp_gles3_tests",
2055      ":angle_deqp_khr_gles2_tests",
2056      ":angle_deqp_khr_gles31_tests",
2057      ":angle_deqp_khr_gles32_tests",
2058      ":angle_deqp_khr_gles3_tests",
2059      ":angle_deqp_khr_noctx_gles2_tests",
2060      ":angle_deqp_khr_noctx_gles32_tests",
2061      ":angle_deqp_khr_single_gles32_tests",
2062    ]
2063
2064    if (is_android) {
2065      deps += [
2066        ":angle_deqp_gles31_565_no_depth_no_stencil_tests",
2067        ":angle_deqp_gles3_565_no_depth_no_stencil_tests",
2068      ]
2069    }
2070  }
2071  if (build_angle_gles1_conform_tests) {
2072    deps += [
2073      ":angle_gles1_conformance_tests",
2074      ":angle_gles1_covegl_no_gtest",
2075      ":angle_gles1_primtest_tests",
2076    ]
2077    if (!is_win && !is_apple) {
2078      deps += [ ":angle_gles1_covgl_tests" ]
2079    }
2080  }
2081}
2082