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