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

Commit 2994f7e

Browse files
authored
v1.12.13+hotfix.5 cherry-picks (#14287)
* 253851e Move Fuchsia unit test runners into engine repo
1 parent 204112d commit 2994f7e

File tree

4 files changed

+58
-6
lines changed

4 files changed

+58
-6
lines changed

BUILD.gn

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ group("flutter") {
9292
]
9393
}
9494
}
95-
96-
# Fuchsia currently only supports a subset of our unit tests
97-
if (is_fuchsia) {
98-
public_deps += [ "$flutter_root/fml:fml_tests" ]
99-
}
10095
}
10196

10297
config("config") {
@@ -124,3 +119,18 @@ group("dist") {
124119
"$flutter_root/sky/dist",
125120
]
126121
}
122+
123+
# Fuchsia currently only supports a subset of our unit tests
124+
# When adding a new dep here, please also ensure the dep is added to
125+
# testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars
126+
if (is_fuchsia) {
127+
group("fuchsia_tests") {
128+
testonly = true
129+
130+
deps = [
131+
# TODO(gw280): Re-enable fml_tests on Fuchsia (https://github.com/flutter/flutter/issues/46122)
132+
# "$flutter_root/fml:fml_tests",
133+
"$flutter_root/shell/platform/fuchsia/flutter:flutter_runner_tests",
134+
]
135+
}
136+
}

testing/fuchsia/run_tests.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
# This expects the device to be in zedboot mode, with a zedboot that is
4+
# is compatible with the Fuchsia system image provided.
5+
#
6+
# The first and only parameter should be the path to the Fuchsia system image
7+
# tarball, e.g. `./fuchsia-test.sh generic-x64.tgz`.
8+
#
9+
# This script expects `pm`, `dev_finder`, and `fuchsia_ctl` to all be in the
10+
# same directory as the script, as well as the `flutter_aot_runner-0.far` and
11+
# the `flutter_runner_tests-0.far`. It is written to be run from its own
12+
# directory, and will fail if run from other directories or via sym-links.
13+
14+
set -Ee
15+
16+
# The nodes are named blah-blah--four-word-fuchsia-id
17+
device_name=${SWARMING_BOT_ID#*--}
18+
19+
if [ -z "$device_name" ]
20+
then
21+
echo "No device found. Aborting."
22+
exit 1
23+
else
24+
echo "Connecting to device $device_name"
25+
fi
26+
27+
reboot() {
28+
# note: this will set an exit code of 255, which we can ignore.
29+
./fuchsia_ctl -d $device_name ssh -c "dm reboot-recovery" || true
30+
}
31+
32+
trap reboot EXIT
33+
34+
./fuchsia_ctl -d $device_name pave -i $1
35+
36+
# TODO(gw280): Enable tests using JIT runner
37+
./fuchsia_ctl -d $device_name test \
38+
-f flutter_aot_runner-0.far \
39+
-f flutter_runner_tests-0.far \
40+
-t flutter_runner_tests
41+

testing/fuchsia/test_fars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flutter_runner_tests-0.far

tools/fuchsia/fuchsia_archive.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ template("fuchsia_archive") {
6868
"$cmx_file",
6969
]
7070
outputs = [
71-
"$far_base_dir/meta/{{source_file_part}}",
71+
"$far_base_dir/meta/${pkg_target_name}.cmx",
7272
]
7373
}
7474

0 commit comments

Comments
 (0)