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

Commit 3a2ccfe

Browse files
committed
Add flow_unittests to Fuchsia
1 parent 218e85c commit 3a2ccfe

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

BUILD.gn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ group("flutter") {
9595

9696
# Fuchsia currently only supports a subset of our unit tests
9797
if (is_fuchsia) {
98-
public_deps += [ "$flutter_root/fml:fml_tests" ]
98+
public_deps += [
99+
"$flutter_root/flow:flow_tests",
100+
"$flutter_root/fml:fml_tests",
101+
]
99102
}
100103
}
101104

flow/BUILD.gn

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
if (is_fuchsia) {
66
import("//build/fuchsia/sdk.gni")
7+
import("$flutter_root/tools/fuchsia/fuchsia_archive.gni")
78
}
8-
99
import("$flutter_root/testing/testing.gni")
1010

1111
source_set("flow") {
@@ -164,3 +164,38 @@ executable("flow_unittests") {
164164
"//third_party/skia",
165165
]
166166
}
167+
168+
if (is_fuchsia) {
169+
fuchsia_archive("flow_tests") {
170+
testonly = true
171+
172+
deps = [
173+
":flow_unittests",
174+
]
175+
176+
binary = "flow_unittests"
177+
178+
libraries = common_libs
179+
180+
meta_dir = "$flutter_root/testing/fuchsia/meta"
181+
cmx_file = "$meta_dir/fuchsia_test.cmx"
182+
183+
resources = [
184+
{
185+
path = rebase_path(
186+
"$flutter_root/testing/resources/performance_overlay_gold_60fps.png")
187+
dest = "flutter/testing/resources/performance_overlay_gold_60fps.png"
188+
},
189+
{
190+
path = rebase_path(
191+
"$flutter_root/testing/resources/performance_overlay_gold_90fps.png")
192+
dest = "flutter/testing/resources/performance_overlay_gold_90fps.png"
193+
},
194+
{
195+
path = rebase_path(
196+
"$flutter_root/testing/resources/performance_overlay_gold_120fps.png")
197+
dest = "flutter/testing/resources/performance_overlay_gold_120fps.png"
198+
},
199+
]
200+
}
201+
}

flow/flow_run_all_unittests.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include "flutter/fml/build_config.h"
1718
#include "flutter/fml/command_line.h"
1819
#include "flutter/fml/logging.h"
1920
#include "gtest/gtest.h"
@@ -23,8 +24,14 @@
2324
int main(int argc, char** argv) {
2425
testing::InitGoogleTest(&argc, argv);
2526
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);
27+
28+
#if defined(OS_FUCHSIA)
29+
flutter::SetGoldenDir(cmd.GetOptionValueWithDefault(
30+
"golden-dir", "/pkg/data/flutter/testing/resources"));
31+
#else
2632
flutter::SetGoldenDir(
2733
cmd.GetOptionValueWithDefault("golden-dir", "flutter/testing/resources"));
34+
#endif
2835
flutter::SetFontFile(cmd.GetOptionValueWithDefault(
2936
"font-file",
3037
"flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf"));

fml/BUILD.gn

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5-
import("//build/fuchsia/sdk.gni")
6-
import("$flutter_root/testing/testing.gni")
7-
85
if (is_fuchsia) {
6+
import("//build/fuchsia/sdk.gni")
97
import("$flutter_root/tools/fuchsia/fuchsia_archive.gni")
108
}
9+
import("$flutter_root/testing/testing.gni")
1110

1211
source_set("fml") {
1312
sources = [

0 commit comments

Comments
 (0)