forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
182 lines (150 loc) · 3.76 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# 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/common/config.gni")
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:gmock",
"//third_party/googletest:gtest",
]
public_configs = [ "//flutter:config" ]
}
source_set("testing") {
testonly = true
sources = [
"debugger_detection.cc",
"debugger_detection.h",
"run_all_unittests.cc",
"test_timeout_listener.cc",
"test_timeout_listener.h",
]
public_deps = [ ":testing_lib" ]
}
source_set("dart") {
testonly = true
sources = [
"dart_isolate_runner.cc",
"dart_isolate_runner.h",
"elf_loader.cc",
"elf_loader.h",
"test_dart_native_resolver.cc",
"test_dart_native_resolver.h",
]
public_deps = [
":testing_lib",
"//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",
]
}
source_set("fixture_test") {
testonly = true
sources = [
"fixture_test.cc",
"fixture_test.h",
]
public_deps = [
":dart",
"//flutter/common",
"//flutter/runtime",
]
}
if (enable_unittests) {
source_set("vulkan") {
testonly = true
deps = [
":skia",
"//flutter/fml",
]
# SwiftShader only supports x86/x64_64
if (target_cpu == "x86" || target_cpu == "x64") {
configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ]
deps += [ "//third_party/swiftshader_flutter:swiftshader_vulkan" ]
}
}
# SwiftShader only supports x86/x64_64
if (target_cpu == "x86" || target_cpu == "x64") {
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_gl",
]
}
}
# 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 = [
":metal",
":skia",
":testing",
":testing_fixtures",
"//flutter/runtime:libdart",
]
}
}