Revert "Create new src/tests BUILD.gn file."

This reverts commit 672d29d14c.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=913171

Original change's description:
> Create new src/tests BUILD.gn file.
> 
> Move all test-related build stuff into its own BUILD.gn file. This
> required moving the dawn_generator template into a common file, so it
> can be called by both BUILD.gn and src/tests/BUILD.gn.
> 
> [This is a reland of https://dawn-review.googlesource.com/c/dawn/+/2940
> with a fix for mock_dawn.]
> 
> Bug: dawn:61
> Change-Id: Id1e6d0c2b07caa2610cebe206511e972ac18fe8d
> Reviewed-on: https://dawn-review.googlesource.com/c/3020
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Stephen White <senorblanco@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,senorblanco@chromium.org

Change-Id: I54cdc558b128935dc8a8d22ec2b5e879271c35ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:61
Reviewed-on: https://dawn-review.googlesource.com/c/3080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2018-12-08 10:35:53 +00:00
committed by Commit Bot service account
parent 672d29d14c
commit 48a1923afb
7 changed files with 225 additions and 288 deletions

View File

@@ -1,149 +0,0 @@
# 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" ]
}
}

View File

@@ -13,7 +13,7 @@
// limitations under the License.
#include "gtest/gtest.h"
#include "mock/mock_dawn_.h"
#include "mock/mock_dawn.h"
#include "common/Assert.h"
#include "dawn_wire/Wire.h"