Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 882849b

Browse files
authored
[Impeller] split out gradient tests from aiks_unittests (#49050)
issue flutter/flutter#140106 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 9b716e0 commit 882849b

File tree

7 files changed

+805
-743
lines changed

7 files changed

+805
-743
lines changed

ci/licenses_golden/excluded_files

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@
123123
../../../flutter/impeller/.clang-format
124124
../../../flutter/impeller/.gitignore
125125
../../../flutter/impeller/README.md
126+
../../../flutter/impeller/aiks/aiks_gradient_unittests.cc
126127
../../../flutter/impeller/aiks/aiks_unittests.cc
128+
../../../flutter/impeller/aiks/aiks_unittests.h
127129
../../../flutter/impeller/aiks/canvas_recorder_unittests.cc
128130
../../../flutter/impeller/aiks/canvas_unittests.cc
129131
../../../flutter/impeller/aiks/testing

impeller/aiks/BUILD.gn

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -67,28 +67,60 @@ impeller_component("aiks_playground") {
6767
]
6868
}
6969

70-
impeller_component("aiks_unittests") {
70+
impeller_component("context_spy") {
7171
testonly = true
7272

7373
sources = [
74-
"aiks_unittests.cc",
75-
"canvas_recorder_unittests.cc",
76-
"canvas_unittests.cc",
7774
"testing/context_mock.h",
7875
"testing/context_spy.cc",
7976
"testing/context_spy.h",
80-
"trace_serializer_unittests.cc",
8177
]
8278
deps = [
83-
":aiks",
84-
":aiks_playground",
85-
"//flutter/impeller/geometry:geometry_asserts",
86-
"//flutter/impeller/golden_tests:golden_playground_test",
87-
"//flutter/impeller/playground:playground_test",
88-
"//flutter/impeller/scene",
89-
"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
79+
"//flutter/impeller/renderer",
9080
"//flutter/testing:testing_lib",
91-
"//flutter/third_party/txt",
81+
]
82+
}
83+
84+
template("aiks_unittests_component") {
85+
target_name = invoker.target_name
86+
predefined_sources = [
87+
"aiks_gradient_unittests.cc",
88+
"aiks_unittests.cc",
89+
"aiks_unittests.h",
90+
]
91+
additional_sources = []
92+
if (defined(invoker.sources)) {
93+
additional_sources = invoker.sources
94+
}
95+
impeller_component(target_name) {
96+
testonly = true
97+
if (defined(invoker.defines)) {
98+
defines = invoker.defines
99+
}
100+
sources = predefined_sources + additional_sources
101+
deps = [
102+
":aiks",
103+
":aiks_playground",
104+
":context_spy",
105+
"//flutter/impeller/geometry:geometry_asserts",
106+
"//flutter/impeller/golden_tests:golden_playground_test",
107+
"//flutter/impeller/playground:playground_test",
108+
"//flutter/impeller/scene",
109+
"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
110+
"//flutter/testing:testing_lib",
111+
"//flutter/third_party/txt",
112+
]
113+
if (defined(invoker.public_configs)) {
114+
public_configs = invoker.public_configs
115+
}
116+
}
117+
}
118+
119+
aiks_unittests_component("aiks_unittests") {
120+
sources = [
121+
"canvas_recorder_unittests.cc",
122+
"canvas_unittests.cc",
123+
"trace_serializer_unittests.cc",
92124
]
93125

94126
if (!impeller_trace_canvas) {
@@ -97,31 +129,11 @@ impeller_component("aiks_unittests") {
97129
}
98130
}
99131

100-
impeller_component("aiks_unittests_golden") {
101-
testonly = true
102-
132+
aiks_unittests_component("aiks_unittests_golden") {
103133
defines = [
104134
"IMPELLER_GOLDEN_TESTS",
105135
"IMPELLER_ENABLE_VALIDATION=1",
106136
]
107-
108-
sources = [
109-
"aiks_unittests.cc",
110-
"testing/context_mock.h",
111-
"testing/context_spy.cc",
112-
"testing/context_spy.h",
113-
]
114-
deps = [
115-
":aiks",
116-
":aiks_playground",
117-
"//flutter/impeller/geometry:geometry_asserts",
118-
"//flutter/impeller/golden_tests:golden_playground_test",
119-
"//flutter/impeller/playground:playground_test",
120-
"//flutter/impeller/scene",
121-
"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
122-
"//flutter/testing:testing_lib",
123-
"//flutter/third_party/txt",
124-
]
125137
}
126138

127139
executable("canvas_benchmarks") {

0 commit comments

Comments
 (0)