iOS,macOS: Build/test test_metal_surface_unittests (flutter/engine#56586)

Years ago, @chinmaygarde created TestMetalSurface and wrote a unit test
for it in 2866095b58.

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.
This commit is contained in:
Chris Bracken
2024-11-14 13:11:37 -08:00
committed by GitHub
parent b04f3c826f
commit 87fbedf2e3
3 changed files with 25 additions and 4 deletions

View File

@@ -195,6 +195,7 @@ group("unittests") {
"//flutter/shell/platform/embedder:embedder_a11y_unittests",
"//flutter/shell/platform/embedder:embedder_proctable_unittests",
"//flutter/shell/platform/embedder:embedder_unittests",
"//flutter/testing:testing_unittests",
"//flutter/testing/dart",
"//flutter/testing/smoke_test_failure",
"//flutter/third_party/tonic/tests:tonic_unittests",

View File

@@ -204,10 +204,8 @@ if (is_mac || is_ios) {
"test_metal_surface_impl.h",
"test_metal_surface_impl.mm",
]
deps = [
":skia",
"//flutter/fml",
]
deps = [ "//flutter/fml" ]
public_deps = [ ":skia" ]
# Skia's Vulkan support is enabled for all platforms (except iOS), and so parts of
# Skia's graphics context reference Vulkan symbols.
@@ -246,3 +244,24 @@ if (use_swiftshader) {
]
}
}
if (enable_unittests) {
executable("testing_unittests") {
testonly = true
sources = []
deps = [
":testing_fixtures",
"//flutter/third_party/googletest:gtest",
"//flutter/third_party/googletest:gtest_main",
]
if (test_enable_metal) {
cflags_objc = flutter_cflags_objc_arc
cflags_objcc = flutter_cflags_objcc_arc
sources += [ "test_metal_surface_unittests.cc" ]
deps += [ ":metal" ]
}
}
}

View File

@@ -431,6 +431,7 @@ def run_cc_tests(build_dir, executable_filter, coverage, capture_core_dump):
make_test('fml_unittests'),
make_test('no_dart_plugin_registrant_unittests'),
make_test('runtime_unittests'),
make_test('testing_unittests'),
make_test('tonic_unittests'),
# The image release unit test can take a while on slow machines.
make_test('ui_unittests', flags=repeat_flags + ['--timeout=90']),