| # Copyright 2018 The Dawn Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build_overrides/build.gni") |
| import("../../scripts/dawn_overrides_with_defaults.gni") |
| import("${dawn_root}/scripts/dawn_features.gni") |
| import("${dawn_root}/generator/dawn_generator.gni") |
| |
| import("//testing/test.gni") |
| |
| config("mock_dawn_public") { |
| include_dirs = [ target_gen_dir ] |
| } |
| |
| dawn_generator("mock_dawn_gen") { |
| target = "mock_dawn" |
| outputs = [ |
| # TODO once stale versions of "mock_dawn" target are gone from bots, |
| # these can be renamed "mock_dawn.*". |
| "mock/mock_dawn_.h", |
| "mock/mock_dawn_.cpp", |
| ] |
| } |
| |
| test("dawn_unittests") { |
| configs += [ |
| "${dawn_root}:dawn_internal", |
| ":mock_dawn_public", |
| ] |
| |
| deps = [ |
| ":mock_dawn_gen", |
| "${dawn_root}:dawn_common", |
| "${dawn_root}:dawn_headers", |
| "${dawn_root}:dawn_utils", |
| "${dawn_root}:libdawn", |
| "${dawn_root}:libdawn_native_sources", |
| "${dawn_root}:libdawn_wire", |
| "${dawn_root}/third_party:gmock_and_gtest", |
| ] |
| |
| # Add internal Dawn Native headers and config for internal unittests. |
| deps += [ "${dawn_root}:libdawn_native_headers" ] |
| configs += [ "${dawn_root}:libdawn_native_internal" ] |
| |
| sources = get_target_outputs(":mock_dawn_gen") |
| sources += [ |
| "unittests/BitSetIteratorTests.cpp", |
| "unittests/CommandAllocatorTests.cpp", |
| "unittests/EnumClassBitmasksTests.cpp", |
| "unittests/ErrorTests.cpp", |
| "unittests/MathTests.cpp", |
| "unittests/ObjectBaseTests.cpp", |
| "unittests/PerStageTests.cpp", |
| "unittests/RefCountedTests.cpp", |
| "unittests/ResultTests.cpp", |
| "unittests/SerialMapTests.cpp", |
| "unittests/SerialQueueTests.cpp", |
| "unittests/ToBackendTests.cpp", |
| "unittests/WireTests.cpp", |
| "unittests/validation/BindGroupValidationTests.cpp", |
| "unittests/validation/BlendStateValidationTests.cpp", |
| "unittests/validation/BufferValidationTests.cpp", |
| "unittests/validation/CommandBufferValidationTests.cpp", |
| "unittests/validation/ComputeValidationTests.cpp", |
| "unittests/validation/CopyCommandsValidationTests.cpp", |
| "unittests/validation/DepthStencilStateValidationTests.cpp", |
| "unittests/validation/DynamicStateCommandValidationTests.cpp", |
| "unittests/validation/FenceValidationTests.cpp", |
| "unittests/validation/InputStateValidationTests.cpp", |
| "unittests/validation/PushConstantsValidationTests.cpp", |
| "unittests/validation/QueueSubmitValidationTests.cpp", |
| "unittests/validation/RenderPassDescriptorValidationTests.cpp", |
| "unittests/validation/RenderPipelineValidationTests.cpp", |
| "unittests/validation/ShaderModuleValidationTests.cpp", |
| "unittests/validation/TextureViewValidationTests.cpp", |
| "unittests/validation/ValidationTest.cpp", |
| "unittests/validation/ValidationTest.h", |
| "unittests/validation/VertexBufferValidationTests.cpp", |
| ] |
| |
| if (dawn_enable_d3d12) { |
| sources += [ "unittests/d3d12/CopySplitTests.cpp" ] |
| } |
| |
| # When building inside Chromium, use their gtest main function because it is |
| # needed to run in swarming correctly. |
| if (build_with_chromium) { |
| sources += [ "//gpu/dawn_unittests_main.cc" ] |
| } else { |
| sources += [ "UnittestsMain.cpp" ] |
| } |
| } |
| |
| test("dawn_end2end_tests") { |
| configs += [ "${dawn_root}:dawn_internal" ] |
| |
| deps = [ |
| "${dawn_root}:dawn_common", |
| "${dawn_root}:dawn_utils", |
| "${dawn_root}:libdawn", |
| "${dawn_root}:libdawn_native", |
| "${dawn_root}:libdawn_wire", |
| "${dawn_root}/third_party:glfw", |
| "${dawn_root}/third_party:gmock_and_gtest", |
| ] |
| |
| sources = [ |
| "DawnTest.cpp", |
| "DawnTest.h", |
| "end2end/BasicTests.cpp", |
| "end2end/BindGroupTests.cpp", |
| "end2end/BlendStateTests.cpp", |
| "end2end/BufferTests.cpp", |
| "end2end/ComputeCopyStorageBufferTests.cpp", |
| "end2end/CopyTests.cpp", |
| "end2end/DepthStencilStateTests.cpp", |
| "end2end/DrawElementsTests.cpp", |
| "end2end/FenceTests.cpp", |
| "end2end/IndexFormatTests.cpp", |
| "end2end/InputStateTests.cpp", |
| "end2end/PrimitiveTopologyTests.cpp", |
| "end2end/PushConstantTests.cpp", |
| "end2end/RenderPassLoadOpTests.cpp", |
| "end2end/SamplerTests.cpp", |
| "end2end/ScissorTests.cpp", |
| "end2end/TextureViewTests.cpp", |
| "end2end/ViewportOrientationTests.cpp", |
| ] |
| |
| # When building inside Chromium, use their gtest main function because it is |
| # needed to run in swarming correctly. |
| if (build_with_chromium) { |
| sources += [ "//gpu/dawn_end2end_tests_main.cc" ] |
| } else { |
| sources += [ "End2EndTestsMain.cpp" ] |
| } |
| } |