mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This was only necessary when the Engine had to build in multiple buildroots where the sources where checked out at different paths relative to the buildroot. This is no longer the case and there are already cases GN rules have been written that mix and match variable usage with the direct specification of the path to the Flutter sources relative to the sole buildroot.
146 lines
2.9 KiB
Plaintext
146 lines
2.9 KiB
Plaintext
# Copyright 2013 The Flutter Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import("//flutter/shell/config.gni")
|
|
import("testing.gni")
|
|
|
|
source_set("testing_lib") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"assertions.h",
|
|
"testing.cc",
|
|
"testing.h",
|
|
"thread_test.cc",
|
|
"thread_test.h",
|
|
]
|
|
|
|
public_deps = [
|
|
"//flutter/fml",
|
|
"//third_party/googletest:gtest",
|
|
]
|
|
public_configs = [ "//flutter:config" ]
|
|
}
|
|
|
|
source_set("testing") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"run_all_unittests.cc",
|
|
]
|
|
|
|
public_deps = [
|
|
":testing_lib",
|
|
]
|
|
}
|
|
|
|
source_set("dart") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"elf_loader.cc",
|
|
"elf_loader.h",
|
|
"test_dart_native_resolver.cc",
|
|
"test_dart_native_resolver.h",
|
|
]
|
|
|
|
public_deps = [
|
|
":testing",
|
|
"//flutter/common",
|
|
"//flutter/runtime",
|
|
"//flutter/runtime:libdart",
|
|
"//flutter/third_party/tonic",
|
|
"//third_party/dart/runtime/bin:elf_loader",
|
|
"//third_party/skia",
|
|
]
|
|
}
|
|
|
|
source_set("skia") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"assertions_skia.cc",
|
|
"assertions_skia.h",
|
|
"canvas_test.h",
|
|
"mock_canvas.cc",
|
|
"mock_canvas.h",
|
|
]
|
|
|
|
public_deps = [
|
|
":testing_lib",
|
|
"//third_party/skia",
|
|
]
|
|
}
|
|
|
|
if (current_toolchain == host_toolchain) {
|
|
source_set("opengl") {
|
|
testonly = true
|
|
|
|
configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ]
|
|
|
|
sources = [
|
|
"test_gl_surface.cc",
|
|
"test_gl_surface.h",
|
|
]
|
|
|
|
deps = [
|
|
":skia",
|
|
"//flutter/fml",
|
|
"//third_party/swiftshader_flutter:swiftshader",
|
|
]
|
|
}
|
|
|
|
# All targets on all platforms should be able to use the Metal utilities. On
|
|
# platforms where Metal is not available, the tests must be skipped or
|
|
# implemented to use another available client rendering API. This is usually
|
|
# either OpenGL which is portably implemented via SwiftShader or the software
|
|
# backend. This way, all tests compile on all platforms but the Metal backend
|
|
# is exercised on platforms where Metal itself is available.
|
|
source_set("metal") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"test_metal_surface.cc",
|
|
"test_metal_surface.h",
|
|
]
|
|
|
|
defines = []
|
|
|
|
if (shell_enable_metal) {
|
|
sources += [ "test_metal_surface_impl.mm" ]
|
|
defines += [ "TESTING_ENABLE_METAL" ]
|
|
}
|
|
|
|
deps = [
|
|
":skia",
|
|
"//flutter/fml",
|
|
]
|
|
}
|
|
|
|
test_fixtures("testing_fixtures") {
|
|
fixtures = []
|
|
}
|
|
|
|
# The //flutter/testing library provides utility methods to other test targets.
|
|
# This test target tests the testing utilities.
|
|
executable("testing_unittests") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"mock_canvas_unittests.cc",
|
|
"test_metal_surface_unittests.cc",
|
|
]
|
|
|
|
deps = [
|
|
":dart",
|
|
":metal",
|
|
":opengl",
|
|
":skia",
|
|
":testing",
|
|
":testing_fixtures",
|
|
":testing_lib",
|
|
]
|
|
}
|
|
}
|