Skip to content

Commit 87fbedf

Browse files
authored
iOS,macOS: Build/test test_metal_surface_unittests (flutter/engine#56586)
Years ago, @chinmaygarde created TestMetalSurface and wrote a unit test for it in 2866095. And some things that should not have been forgotten were lost. History became legend. Legend became myth. And for four and a half years, the test passed out of all knowledge. Until, when chance came, it ensnared a new bearer. The test came to the creature @cbracken, who took it deep into the tunnels of the GN build files. And there it consumed him. The test brought to @cbracken unnatural long life. For 500 hours, it poisoned his mind. And in the gloom of @cbracken's cave, it waited. Darkness crept back into the forests of the world. Rumour grew of a shadow in the East - whispers of a nameless fear. And the Test of Unit perceived its time had now come.
1 parent b04f3c8 commit 87fbedf

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

engine/src/flutter/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ group("unittests") {
195195
"//flutter/shell/platform/embedder:embedder_a11y_unittests",
196196
"//flutter/shell/platform/embedder:embedder_proctable_unittests",
197197
"//flutter/shell/platform/embedder:embedder_unittests",
198+
"//flutter/testing:testing_unittests",
198199
"//flutter/testing/dart",
199200
"//flutter/testing/smoke_test_failure",
200201
"//flutter/third_party/tonic/tests:tonic_unittests",

engine/src/flutter/testing/BUILD.gn

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,8 @@ if (is_mac || is_ios) {
204204
"test_metal_surface_impl.h",
205205
"test_metal_surface_impl.mm",
206206
]
207-
deps = [
208-
":skia",
209-
"//flutter/fml",
210-
]
207+
deps = [ "//flutter/fml" ]
208+
public_deps = [ ":skia" ]
211209

212210
# Skia's Vulkan support is enabled for all platforms (except iOS), and so parts of
213211
# Skia's graphics context reference Vulkan symbols.
@@ -246,3 +244,24 @@ if (use_swiftshader) {
246244
]
247245
}
248246
}
247+
248+
if (enable_unittests) {
249+
executable("testing_unittests") {
250+
testonly = true
251+
252+
sources = []
253+
deps = [
254+
":testing_fixtures",
255+
"//flutter/third_party/googletest:gtest",
256+
"//flutter/third_party/googletest:gtest_main",
257+
]
258+
259+
if (test_enable_metal) {
260+
cflags_objc = flutter_cflags_objc_arc
261+
cflags_objcc = flutter_cflags_objcc_arc
262+
263+
sources += [ "test_metal_surface_unittests.cc" ]
264+
deps += [ ":metal" ]
265+
}
266+
}
267+
}

engine/src/flutter/testing/run_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ def make_test(name, flags=None, extra_env=None):
431431
make_test('fml_unittests'),
432432
make_test('no_dart_plugin_registrant_unittests'),
433433
make_test('runtime_unittests'),
434+
make_test('testing_unittests'),
434435
make_test('tonic_unittests'),
435436
# The image release unit test can take a while on slow machines.
436437
make_test('ui_unittests', flags=repeat_flags + ['--timeout=90']),

0 commit comments

Comments
 (0)