@@ -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
127139executable (" canvas_benchmarks" ) {
0 commit comments