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

[Impeller] split out gradient tests from aiks_unittests #49050

Merged
merged 7 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@
../../../flutter/impeller/.clang-format
../../../flutter/impeller/.gitignore
../../../flutter/impeller/README.md
../../../flutter/impeller/aiks/aiks_gradient_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.h
../../../flutter/impeller/aiks/canvas_recorder_unittests.cc
../../../flutter/impeller/aiks/canvas_unittests.cc
../../../flutter/impeller/aiks/testing
Expand Down
80 changes: 46 additions & 34 deletions impeller/aiks/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,60 @@ impeller_component("aiks_playground") {
]
}

impeller_component("aiks_unittests") {
impeller_component("context_spy") {
testonly = true

sources = [
"aiks_unittests.cc",
"canvas_recorder_unittests.cc",
"canvas_unittests.cc",
"testing/context_mock.h",
"testing/context_spy.cc",
"testing/context_spy.h",
"trace_serializer_unittests.cc",
]
deps = [
":aiks",
":aiks_playground",
"//flutter/impeller/geometry:geometry_asserts",
"//flutter/impeller/golden_tests:golden_playground_test",
"//flutter/impeller/playground:playground_test",
"//flutter/impeller/scene",
"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
"//flutter/impeller/renderer",
"//flutter/testing:testing_lib",
"//flutter/third_party/txt",
]
}

template("aiks_unittests_component") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only way I could figure out how to share these files. The way the golden tests works is that they have to be compiled with a specific define.

target_name = invoker.target_name
predefined_sources = [
"aiks_gradient_unittests.cc",
"aiks_unittests.cc",
"aiks_unittests.h",
]
additional_sources = []
if (defined(invoker.sources)) {
additional_sources = invoker.sources
}
impeller_component(target_name) {
testonly = true
if (defined(invoker.defines)) {
defines = invoker.defines
}
sources = predefined_sources + additional_sources
deps = [
":aiks",
":aiks_playground",
":context_spy",
"//flutter/impeller/geometry:geometry_asserts",
"//flutter/impeller/golden_tests:golden_playground_test",
"//flutter/impeller/playground:playground_test",
"//flutter/impeller/scene",
"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
"//flutter/testing:testing_lib",
"//flutter/third_party/txt",
]
if (defined(invoker.public_configs)) {
public_configs = invoker.public_configs
}
}
}

aiks_unittests_component("aiks_unittests") {
sources = [
"canvas_recorder_unittests.cc",
"canvas_unittests.cc",
"trace_serializer_unittests.cc",
]

if (!impeller_trace_canvas) {
Expand All @@ -97,31 +129,11 @@ impeller_component("aiks_unittests") {
}
}

impeller_component("aiks_unittests_golden") {
testonly = true

aiks_unittests_component("aiks_unittests_golden") {
defines = [
"IMPELLER_GOLDEN_TESTS",
"IMPELLER_ENABLE_VALIDATION=1",
]

sources = [
"aiks_unittests.cc",
"testing/context_mock.h",
"testing/context_spy.cc",
"testing/context_spy.h",
]
deps = [
":aiks",
":aiks_playground",
"//flutter/impeller/geometry:geometry_asserts",
"//flutter/impeller/golden_tests:golden_playground_test",
"//flutter/impeller/playground:playground_test",
"//flutter/impeller/scene",
"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
"//flutter/testing:testing_lib",
"//flutter/third_party/txt",
]
}

executable("canvas_benchmarks") {
Expand Down
Loading