1# Copyright 2012 The Dawn Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("../../scripts/dawn_overrides_with_defaults.gni")
16
17import("${skia_root_dir}/testing/test.gni")
18import("${dawn_root}/generator/dawn_generator.gni")
19import("${dawn_root}/scripts/dawn_features.gni")
20
21group("dawn_tests") {
22  testonly = true
23  deps = [
24    ":dawn_end2end_tests",
25    ":dawn_perf_tests",
26    ":dawn_unittests",
27  ]
28}
29
30###############################################################################
31# Gtest Gmock - Handle building inside and outside of Chromium.
32###############################################################################
33
34# When building outside of Chromium we need to define our own targets for GTest
35# and GMock. However when compiling inside of Chromium we need to reuse the
36# existing targets, both because Chromium has a special harness for swarming
37# and because otherwise the "gn check" fails.
38
39if (!build_with_chromium) {
40  # When we aren't in Chromium we define out own targets based on the location
41  # of the googletest repo.
42  googletest_dir = dawn_googletest_dir
43
44  config("gtest_config") {
45    include_dirs = [
46      "${googletest_dir}/googletest",
47      "${googletest_dir}/googletest/include",
48    ]
49  }
50
51  static_library("gtest") {
52    testonly = true
53    sources = [ "${googletest_dir}/googletest/src/gtest-all.cc" ]
54    public_configs = [ ":gtest_config" ]
55  }
56
57  config("gmock_config") {
58    include_dirs = [
59      "${googletest_dir}/googlemock",
60      "${googletest_dir}/googlemock/include",
61      "${googletest_dir}/googletest/include",
62    ]
63  }
64
65  static_library("gmock") {
66    testonly = true
67    sources = [ "${googletest_dir}/googlemock/src/gmock-all.cc" ]
68    public_configs = [ ":gmock_config" ]
69  }
70
71  group("gmock_and_gtest") {
72    testonly = true
73    public_deps = [
74      ":gmock",
75      ":gtest",
76    ]
77  }
78} else {
79  # When we are in Chromium we reuse its targets, and also add some deps that
80  # are needed to launch the test in swarming mode.
81  group("gmock_and_gtest") {
82    testonly = true
83    public_deps = [
84      "${skia_root_dir}/base",
85      "${skia_root_dir}/base/test:test_support",
86      "${skia_root_dir}/testing/gmock",
87      "${skia_root_dir}/testing/gtest",
88    ]
89  }
90}
91
92###############################################################################
93# Wrapping of Chromium targets
94###############################################################################
95
96# These targets are separated because they are Chromium sources files that
97# can't use the dawn_internal config, otherwise Dawn's warning flags get
98# applied while compiling a bunch of Chromium's //base (via header inclusion)
99if (build_with_chromium) {
100  source_set("dawn_unittests_main") {
101    testonly = true
102    deps = [ ":gmock_and_gtest" ]
103    sources = [ "${skia_root_dir}/gpu/dawn_unittests_main.cc" ]
104  }
105  source_set("dawn_end2end_tests_main") {
106    testonly = true
107    deps = [ ":gmock_and_gtest" ]
108    sources = [ "${skia_root_dir}/gpu/dawn_end2end_tests_main.cc" ]
109  }
110  source_set("dawn_perf_tests_main") {
111    testonly = true
112    deps = [ ":gmock_and_gtest" ]
113    sources = [ "${skia_root_dir}/gpu/dawn_perf_tests_main.cc" ]
114  }
115}
116
117###############################################################################
118# Dawn unittests
119###############################################################################
120
121dawn_json_generator("mock_webgpu_gen") {
122  target = "mock_webgpu"
123  outputs = [
124    "src/dawn/mock_webgpu.h",
125    "src/dawn/mock_webgpu.cpp",
126  ]
127}
128
129# Source code for mocks used for unit testing are separated from the rest of
130# sources so that they aren't included in non-test builds.
131source_set("dawn_native_mocks_sources") {
132  testonly = true
133
134  deps = [
135    ":gmock_and_gtest",
136    "${dawn_root}/src/dawn_native:dawn_native_sources",
137    "${dawn_root}/src/dawn_native:dawn_native_static",
138    "${dawn_root}/src/utils:dawn_utils",
139  ]
140
141  # Add internal dawn_native config for internal unittests.
142  configs += [ "${dawn_root}/src/dawn_native:dawn_native_internal" ]
143
144  sources = [
145    "unittests/native/mocks/BindGroupLayoutMock.h",
146    "unittests/native/mocks/BindGroupMock.h",
147    "unittests/native/mocks/CommandBufferMock.h",
148    "unittests/native/mocks/ComputePipelineMock.h",
149    "unittests/native/mocks/DeviceMock.h",
150    "unittests/native/mocks/ExternalTextureMock.h",
151    "unittests/native/mocks/PipelineLayoutMock.h",
152    "unittests/native/mocks/QuerySetMock.h",
153    "unittests/native/mocks/RenderPipelineMock.h",
154    "unittests/native/mocks/SamplerMock.h",
155    "unittests/native/mocks/ShaderModuleMock.cpp",
156    "unittests/native/mocks/ShaderModuleMock.h",
157    "unittests/native/mocks/SwapChainMock.h",
158    "unittests/native/mocks/TextureMock.h",
159  ]
160}
161
162test("dawn_unittests") {
163  configs += [ "${dawn_root}/src/common:dawn_internal" ]
164
165  deps = [
166    ":dawn_native_mocks_sources",
167    ":gmock_and_gtest",
168    ":mock_webgpu_gen",
169    "${dawn_root}/src/common",
170    "${dawn_root}/src/dawn:dawn_proc",
171    "${dawn_root}/src/dawn:dawncpp",
172    "${dawn_root}/src/dawn_native:dawn_native_sources",
173    "${dawn_root}/src/dawn_native:dawn_native_static",
174    "${dawn_root}/src/dawn_wire",
175    "${dawn_root}/src/utils:dawn_utils",
176  ]
177
178  # Add internal dawn_native config for internal unittests.
179  configs += [ "${dawn_root}/src/dawn_native:dawn_native_internal" ]
180
181  sources = get_target_outputs(":mock_webgpu_gen")
182  sources += [
183    "${dawn_root}/src/dawn_wire/client/ClientMemoryTransferService_mock.cpp",
184    "${dawn_root}/src/dawn_wire/client/ClientMemoryTransferService_mock.h",
185    "${dawn_root}/src/dawn_wire/server/ServerMemoryTransferService_mock.cpp",
186    "${dawn_root}/src/dawn_wire/server/ServerMemoryTransferService_mock.h",
187    "DawnNativeTest.cpp",
188    "DawnNativeTest.h",
189    "MockCallback.h",
190    "ToggleParser.cpp",
191    "ToggleParser.h",
192    "unittests/AsyncTaskTests.cpp",
193    "unittests/BitSetIteratorTests.cpp",
194    "unittests/BuddyAllocatorTests.cpp",
195    "unittests/BuddyMemoryAllocatorTests.cpp",
196    "unittests/ChainUtilsTests.cpp",
197    "unittests/CommandAllocatorTests.cpp",
198    "unittests/ConcurrentCacheTests.cpp",
199    "unittests/EnumClassBitmasksTests.cpp",
200    "unittests/EnumMaskIteratorTests.cpp",
201    "unittests/ErrorTests.cpp",
202    "unittests/FeatureTests.cpp",
203    "unittests/GPUInfoTests.cpp",
204    "unittests/GetProcAddressTests.cpp",
205    "unittests/ITypArrayTests.cpp",
206    "unittests/ITypBitsetTests.cpp",
207    "unittests/ITypSpanTests.cpp",
208    "unittests/ITypVectorTests.cpp",
209    "unittests/LimitsTests.cpp",
210    "unittests/LinkedListTests.cpp",
211    "unittests/MathTests.cpp",
212    "unittests/ObjectBaseTests.cpp",
213    "unittests/PerStageTests.cpp",
214    "unittests/PerThreadProcTests.cpp",
215    "unittests/PlacementAllocatedTests.cpp",
216    "unittests/RefBaseTests.cpp",
217    "unittests/RefCountedTests.cpp",
218    "unittests/ResultTests.cpp",
219    "unittests/RingBufferAllocatorTests.cpp",
220    "unittests/SerialMapTests.cpp",
221    "unittests/SerialQueueTests.cpp",
222    "unittests/SlabAllocatorTests.cpp",
223    "unittests/StackContainerTests.cpp",
224    "unittests/SubresourceStorageTests.cpp",
225    "unittests/SystemUtilsTests.cpp",
226    "unittests/ToBackendTests.cpp",
227    "unittests/TypedIntegerTests.cpp",
228    "unittests/native/CommandBufferEncodingTests.cpp",
229    "unittests/native/DestroyObjectTests.cpp",
230    "unittests/validation/BindGroupValidationTests.cpp",
231    "unittests/validation/BufferValidationTests.cpp",
232    "unittests/validation/CommandBufferValidationTests.cpp",
233    "unittests/validation/ComputeIndirectValidationTests.cpp",
234    "unittests/validation/ComputeValidationTests.cpp",
235    "unittests/validation/CopyCommandsValidationTests.cpp",
236    "unittests/validation/CopyTextureForBrowserTests.cpp",
237    "unittests/validation/DebugMarkerValidationTests.cpp",
238    "unittests/validation/DrawIndirectValidationTests.cpp",
239    "unittests/validation/DrawVertexAndIndexBufferOOBValidationTests.cpp",
240    "unittests/validation/DynamicStateCommandValidationTests.cpp",
241    "unittests/validation/ErrorScopeValidationTests.cpp",
242    "unittests/validation/ExternalTextureTests.cpp",
243    "unittests/validation/GetBindGroupLayoutValidationTests.cpp",
244    "unittests/validation/IndexBufferValidationTests.cpp",
245    "unittests/validation/InternalUsageValidationTests.cpp",
246    "unittests/validation/LabelTests.cpp",
247    "unittests/validation/MinimumBufferSizeValidationTests.cpp",
248    "unittests/validation/MultipleDeviceTests.cpp",
249    "unittests/validation/OverridableConstantsValidationTests.cpp",
250    "unittests/validation/PipelineAndPassCompatibilityTests.cpp",
251    "unittests/validation/QueryValidationTests.cpp",
252    "unittests/validation/QueueOnSubmittedWorkDoneValidationTests.cpp",
253    "unittests/validation/QueueSubmitValidationTests.cpp",
254    "unittests/validation/QueueWriteBufferValidationTests.cpp",
255    "unittests/validation/QueueWriteTextureValidationTests.cpp",
256    "unittests/validation/RenderBundleValidationTests.cpp",
257    "unittests/validation/RenderPassDescriptorValidationTests.cpp",
258    "unittests/validation/RenderPipelineValidationTests.cpp",
259    "unittests/validation/RequestDeviceValidationTests.cpp",
260    "unittests/validation/ResourceUsageTrackingTests.cpp",
261    "unittests/validation/SamplerValidationTests.cpp",
262    "unittests/validation/ShaderModuleValidationTests.cpp",
263    "unittests/validation/StorageTextureValidationTests.cpp",
264    "unittests/validation/TextureSubresourceTests.cpp",
265    "unittests/validation/TextureValidationTests.cpp",
266    "unittests/validation/TextureViewValidationTests.cpp",
267    "unittests/validation/ToggleValidationTests.cpp",
268    "unittests/validation/UnsafeAPIValidationTests.cpp",
269    "unittests/validation/ValidationTest.cpp",
270    "unittests/validation/ValidationTest.h",
271    "unittests/validation/VertexBufferValidationTests.cpp",
272    "unittests/validation/VertexStateValidationTests.cpp",
273    "unittests/validation/VideoViewsValidationTests.cpp",
274    "unittests/validation/WriteBufferTests.cpp",
275    "unittests/wire/WireArgumentTests.cpp",
276    "unittests/wire/WireBasicTests.cpp",
277    "unittests/wire/WireBufferMappingTests.cpp",
278    "unittests/wire/WireCreatePipelineAsyncTests.cpp",
279    "unittests/wire/WireDestroyObjectTests.cpp",
280    "unittests/wire/WireDisconnectTests.cpp",
281    "unittests/wire/WireErrorCallbackTests.cpp",
282    "unittests/wire/WireExtensionTests.cpp",
283    "unittests/wire/WireInjectDeviceTests.cpp",
284    "unittests/wire/WireInjectSwapChainTests.cpp",
285    "unittests/wire/WireInjectTextureTests.cpp",
286    "unittests/wire/WireMemoryTransferServiceTests.cpp",
287    "unittests/wire/WireOptionalTests.cpp",
288    "unittests/wire/WireQueueTests.cpp",
289    "unittests/wire/WireShaderModuleTests.cpp",
290    "unittests/wire/WireTest.cpp",
291    "unittests/wire/WireTest.h",
292    "unittests/wire/WireWGPUDevicePropertiesTests.cpp",
293  ]
294
295  if (is_win) {
296    sources += [ "unittests/WindowsUtilsTests.cpp" ]
297  }
298
299  if (dawn_enable_d3d12) {
300    sources += [ "unittests/d3d12/CopySplitTests.cpp" ]
301  }
302
303  # When building inside Chromium, use their gtest main function because it is
304  # needed to run in swarming correctly.
305  if (build_with_chromium) {
306    deps += [ ":dawn_unittests_main" ]
307  } else {
308    sources += [ "UnittestsMain.cpp" ]
309  }
310}
311
312###############################################################################
313# Dawn end2end tests targets
314###############################################################################
315
316source_set("dawn_end2end_tests_sources") {
317  configs += [ "${dawn_root}/src/common:dawn_internal" ]
318  testonly = true
319
320  deps = [
321    ":gmock_and_gtest",
322    "${dawn_root}/src/common",
323    "${dawn_root}/src/dawn:dawn_proc",
324    "${dawn_root}/src/dawn:dawncpp",
325
326    # Statically linked because the end2end white_box tests use Dawn internals.
327    "${dawn_root}/src/dawn_native:dawn_native_static",
328    "${dawn_root}/src/dawn_wire",
329    "${dawn_root}/src/utils:dawn_utils",
330  ]
331
332  sources = [
333    "DawnTest.h",
334    "MockCallback.h",
335    "ParamGenerator.h",
336    "ToggleParser.cpp",
337    "ToggleParser.h",
338    "end2end/AdapterDiscoveryTests.cpp",
339    "end2end/BasicTests.cpp",
340    "end2end/BindGroupTests.cpp",
341    "end2end/BufferTests.cpp",
342    "end2end/BufferZeroInitTests.cpp",
343    "end2end/ClipSpaceTests.cpp",
344    "end2end/ColorStateTests.cpp",
345    "end2end/CommandEncoderTests.cpp",
346    "end2end/CompressedTextureFormatTests.cpp",
347    "end2end/ComputeCopyStorageBufferTests.cpp",
348    "end2end/ComputeDispatchTests.cpp",
349    "end2end/ComputeLayoutMemoryBufferTests.cpp",
350    "end2end/ComputeSharedMemoryTests.cpp",
351    "end2end/ComputeStorageBufferBarrierTests.cpp",
352    "end2end/CopyTests.cpp",
353    "end2end/CopyTextureForBrowserTests.cpp",
354    "end2end/CreatePipelineAsyncTests.cpp",
355    "end2end/CullingTests.cpp",
356    "end2end/DebugMarkerTests.cpp",
357    "end2end/DeprecatedAPITests.cpp",
358    "end2end/DepthBiasTests.cpp",
359    "end2end/DepthStencilCopyTests.cpp",
360    "end2end/DepthStencilLoadOpTests.cpp",
361    "end2end/DepthStencilSamplingTests.cpp",
362    "end2end/DepthStencilStateTests.cpp",
363    "end2end/DestroyTests.cpp",
364    "end2end/DeviceInitializationTests.cpp",
365    "end2end/DeviceLostTests.cpp",
366    "end2end/DrawIndexedIndirectTests.cpp",
367    "end2end/DrawIndexedTests.cpp",
368    "end2end/DrawIndirectTests.cpp",
369    "end2end/DrawTests.cpp",
370    "end2end/DynamicBufferOffsetTests.cpp",
371    "end2end/EntryPointTests.cpp",
372    "end2end/ExternalTextureTests.cpp",
373    "end2end/FirstIndexOffsetTests.cpp",
374    "end2end/GpuMemorySynchronizationTests.cpp",
375    "end2end/IndexFormatTests.cpp",
376    "end2end/MaxLimitTests.cpp",
377    "end2end/MemoryAllocationStressTests.cpp",
378    "end2end/MultisampledRenderingTests.cpp",
379    "end2end/MultisampledSamplingTests.cpp",
380    "end2end/NonzeroBufferCreationTests.cpp",
381    "end2end/NonzeroTextureCreationTests.cpp",
382    "end2end/ObjectCachingTests.cpp",
383    "end2end/OpArrayLengthTests.cpp",
384    "end2end/PipelineLayoutTests.cpp",
385    "end2end/PrimitiveStateTests.cpp",
386    "end2end/PrimitiveTopologyTests.cpp",
387    "end2end/QueryTests.cpp",
388    "end2end/QueueTests.cpp",
389    "end2end/QueueTimelineTests.cpp",
390    "end2end/ReadOnlyDepthStencilAttachmentTests.cpp",
391    "end2end/RenderAttachmentTests.cpp",
392    "end2end/RenderBundleTests.cpp",
393    "end2end/RenderPassLoadOpTests.cpp",
394    "end2end/RenderPassTests.cpp",
395    "end2end/SamplerFilterAnisotropicTests.cpp",
396    "end2end/SamplerTests.cpp",
397    "end2end/ScissorTests.cpp",
398    "end2end/ShaderFloat16Tests.cpp",
399    "end2end/ShaderTests.cpp",
400    "end2end/StorageTextureTests.cpp",
401    "end2end/SubresourceRenderAttachmentTests.cpp",
402    "end2end/Texture3DTests.cpp",
403    "end2end/TextureFormatTests.cpp",
404    "end2end/TextureSubresourceTests.cpp",
405    "end2end/TextureViewTests.cpp",
406    "end2end/TextureZeroInitTests.cpp",
407    "end2end/VertexFormatTests.cpp",
408    "end2end/VertexOnlyRenderPipelineTests.cpp",
409    "end2end/VertexStateTests.cpp",
410    "end2end/ViewportOrientationTests.cpp",
411    "end2end/ViewportTests.cpp",
412  ]
413
414  # Validation tests that need OS windows live in end2end tests.
415  sources += [
416    "unittests/validation/ValidationTest.cpp",
417    "unittests/validation/ValidationTest.h",
418  ]
419
420  libs = []
421
422  if (dawn_enable_d3d12) {
423    sources += [
424      "end2end/D3D12CachingTests.cpp",
425      "end2end/D3D12ResourceWrappingTests.cpp",
426      "end2end/D3D12VideoViewsTests.cpp",
427    ]
428    libs += [
429      "d3d11.lib",
430      "dxgi.lib",
431    ]
432  }
433
434  if (dawn_enable_metal) {
435    sources += [ "end2end/IOSurfaceWrappingTests.cpp" ]
436    frameworks = [ "IOSurface.framework" ]
437  }
438
439  if (dawn_enable_opengl) {
440    assert(dawn_supports_glfw_for_windowing)
441  }
442
443  if (dawn_supports_glfw_for_windowing) {
444    sources += [
445      "end2end/SwapChainTests.cpp",
446      "end2end/SwapChainValidationTests.cpp",
447      "end2end/WindowSurfaceTests.cpp",
448    ]
449    deps += [ "${dawn_root}/src/utils:dawn_glfw" ]
450  }
451}
452
453source_set("dawn_white_box_tests_sources") {
454  configs += [ "${dawn_root}/src/dawn_native:dawn_native_internal" ]
455  testonly = true
456
457  deps = [
458    ":gmock_and_gtest",
459    "${dawn_root}/src/common",
460    "${dawn_root}/src/dawn:dawn_proc",
461    "${dawn_root}/src/dawn:dawncpp",
462    "${dawn_root}/src/dawn_native:dawn_native_sources",
463
464    # Statically linked because the end2end white_box tests use Dawn internals.
465    "${dawn_root}/src/dawn_native:dawn_native_static",
466    "${dawn_root}/src/dawn_wire",
467    "${dawn_root}/src/utils:dawn_utils",
468  ]
469
470  sources = [
471    "DawnTest.h",
472    "ParamGenerator.h",
473    "ToggleParser.h",
474  ]
475
476  if (dawn_enable_vulkan) {
477    deps += [ "${dawn_root}/third_party/khronos:vulkan_headers" ]
478
479    if (is_chromeos) {
480      sources += [ "white_box/VulkanImageWrappingTestsDmaBuf.cpp" ]
481    } else if (is_linux) {
482      sources += [ "white_box/VulkanImageWrappingTestsOpaqueFD.cpp" ]
483    }
484
485    if (dawn_enable_error_injection) {
486      sources += [ "white_box/VulkanErrorInjectorTests.cpp" ]
487    }
488  }
489
490  sources += [
491    "white_box/BufferAllocatedSizeTests.cpp",
492    "white_box/InternalResourceUsageTests.cpp",
493    "white_box/InternalStorageBufferBindingTests.cpp",
494    "white_box/QueryInternalShaderTests.cpp",
495  ]
496
497  if (dawn_enable_d3d12) {
498    sources += [
499      "white_box/D3D12DescriptorHeapTests.cpp",
500      "white_box/D3D12ResidencyTests.cpp",
501      "white_box/D3D12ResourceHeapTests.cpp",
502    ]
503  }
504
505  if (dawn_enable_metal) {
506    sources += [ "white_box/MetalAutoreleasePoolTests.mm" ]
507  }
508
509  if (dawn_enable_opengl) {
510    deps += [ "${dawn_root}/src/utils:dawn_glfw" ]
511  }
512
513  if (dawn_enable_opengles) {
514    sources += [ "white_box/EGLImageWrappingTests.cpp" ]
515    deps += [ "${skia_third_party_dir}/angle:libEGL" ]
516  }
517
518  libs = []
519}
520
521test("dawn_end2end_tests") {
522  configs += [ "${dawn_root}/src/common:dawn_internal" ]
523
524  deps = [
525    ":dawn_end2end_tests_sources",
526    ":dawn_white_box_tests_sources",
527    ":gmock_and_gtest",
528    "${dawn_root}/src/common",
529    "${dawn_root}/src/dawn:dawn_proc",
530    "${dawn_root}/src/dawn:dawncpp",
531    "${dawn_root}/src/dawn_native:dawn_native_static",
532    "${dawn_root}/src/dawn_wire",
533    "${dawn_root}/src/utils:dawn_utils",
534  ]
535
536  sources = [
537    "DawnTest.cpp",
538    "DawnTest.h",
539  ]
540
541  libs = []
542
543  # When building inside Chromium, use their gtest main function because it is
544  # needed to run in swarming correctly.
545  if (build_with_chromium) {
546    deps += [ ":dawn_end2end_tests_main" ]
547  } else {
548    sources += [ "End2EndTestsMain.cpp" ]
549  }
550
551  if (dawn_enable_opengl) {
552    deps += [ "${dawn_root}/src/utils:dawn_glfw" ]
553  }
554
555  if (is_chromeos) {
556    libs += [ "gbm" ]
557  }
558}
559
560###############################################################################
561# Dawn perf tests
562###############################################################################
563
564test("dawn_perf_tests") {
565  configs += [ "${dawn_root}/src/common:dawn_internal" ]
566
567  deps = [
568    ":gmock_and_gtest",
569    "${dawn_root}/src/common",
570    "${dawn_root}/src/dawn:dawn_proc",
571    "${dawn_root}/src/dawn:dawncpp",
572    "${dawn_root}/src/dawn_native",
573    "${dawn_root}/src/dawn_platform",
574    "${dawn_root}/src/dawn_wire",
575    "${dawn_root}/src/utils:dawn_utils",
576  ]
577
578  sources = [
579    "DawnTest.cpp",
580    "DawnTest.h",
581    "ParamGenerator.h",
582    "ToggleParser.cpp",
583    "ToggleParser.h",
584    "perf_tests/BufferUploadPerf.cpp",
585    "perf_tests/DawnPerfTest.cpp",
586    "perf_tests/DawnPerfTest.h",
587    "perf_tests/DawnPerfTestPlatform.cpp",
588    "perf_tests/DawnPerfTestPlatform.h",
589    "perf_tests/DrawCallPerf.cpp",
590    "perf_tests/ShaderRobustnessPerf.cpp",
591    "perf_tests/SubresourceTrackingPerf.cpp",
592  ]
593
594  libs = []
595
596  # When building inside Chromium, use their gtest main function and the
597  # other perf test scaffolding in order to run in swarming correctly.
598  if (build_with_chromium) {
599    deps += [ ":dawn_perf_tests_main" ]
600    data_deps = [ "${skia_root_dir}/testing:run_perf_test" ]
601  } else {
602    sources += [ "PerfTestsMain.cpp" ]
603  }
604
605  if (dawn_enable_metal) {
606    frameworks = [ "IOSurface.framework" ]
607  }
608
609  if (dawn_enable_opengl) {
610    deps += [ "${dawn_root}/src/utils:dawn_glfw" ]
611  }
612}
613