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

Commit f1b35fe

Browse files
committed
Add flow_unittests to Fuchsia
1 parent fd6239f commit f1b35fe

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

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)