Skip to content

Commit 4941125

Browse files
authored
Revert "Compile embedder unit test Dart to kernel (flutter#7227)" (flutter#7230)
This reverts commit ac9e521. This broke dynamic release mode builds of //flutter/runtime:runtime_fixtures_kernel (likely all product-mode builds).
1 parent f7d91d6 commit 4941125

File tree

4 files changed

+18
-37
lines changed

4 files changed

+18
-37
lines changed

runtime/fixtures/simple_main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
void main() {
5+
void simple_main() {
66
print("Hello");
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
void main() {}
1+
void main() {}

shell/platform/embedder/tests/embedder_unittests.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ TEST(EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs) {
2222
return false;
2323
};
2424

25+
std::string main =
26+
std::string(testing::GetFixturesPath()) + "/simple_main.dart";
27+
2528
FlutterRendererConfig config = {};
2629
config.type = FlutterRendererType::kSoftware;
2730
config.software = renderer;
2831

2932
FlutterProjectArgs args = {};
3033
args.struct_size = sizeof(FlutterProjectArgs);
31-
args.assets_path = testing::GetFixturesPath();
32-
args.main_path = "";
34+
args.assets_path = "";
35+
args.main_path = main.c_str();
3336
args.packages_path = "";
3437

3538
FlutterEngine engine = nullptr;

testing/testing.gni

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
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("//third_party/dart/build/dart/dart_action.gni")
6-
7-
# Builds test fixtures for a unit test.
8-
#
9-
# Generates a directory structure containing an assets directory and the Dart
10-
# code to execute compiled to kernel, emitted to assets/kernel_blob.bin.
115
template("test_fixtures") {
126
testonly = true
137

148
assert(defined(invoker.fixtures), "Test fixtures must be specified.")
159

16-
fixtures_location = "$target_gen_dir/$target_name/assets"
17-
fixtures_location_file = "$target_gen_dir/$target_name/test_fixtures_location.cc"
18-
1910
fixtures_name_target_name = target_name + "_gen_fixtures_name"
11+
fixtures_source_set_target_name = target_name + "_gen_fixtures_source_set"
12+
fixtures_copy_target_name = target_name + "_copy_fixtures"
13+
14+
fixtures_location = "$target_gen_dir/fixtures"
15+
fixtures_location_file = "$target_gen_dir/test_fixtures_location.cc"
16+
2017
action(fixtures_name_target_name) {
2118
script = "$flutter_root/testing/build/gen_fixtures_location_symbol.py"
2219

@@ -32,9 +29,7 @@ template("test_fixtures") {
3229
]
3330
}
3431

35-
fixtures_source_set_target_name = target_name + "_gen_fixtures_source_set"
3632
source_set(fixtures_source_set_target_name) {
37-
testonly = true
3833
sources = [
3934
fixtures_location_file,
4035
]
@@ -44,33 +39,16 @@ template("test_fixtures") {
4439
]
4540
}
4641

47-
fixtures_kernel_target_name = target_name + "_kernel"
48-
prebuilt_dart_action(fixtures_kernel_target_name) {
49-
testonly = true
50-
script = "$root_out_dir/frontend_server.dart.snapshot"
51-
52-
fixture_paths = []
53-
foreach(fixture, invoker.fixtures) {
54-
fixture_paths += [ rebase_path(fixture) ]
55-
}
56-
inputs = fixture_paths
57-
outputs = ["$fixtures_location/kernel_blob.bin"]
58-
59-
args = [
60-
"--sdk-root", rebase_path("$root_out_dir/flutter_patched_sdk"),
61-
"--strong",
62-
"--target", "flutter",
63-
"--output-dill", rebase_path("$fixtures_location/kernel_blob.bin"),
64-
] + fixture_paths
65-
deps = [
66-
"//third_party/dart/utils/kernel-service:frontend_server"
42+
copy(fixtures_copy_target_name) {
43+
sources = invoker.fixtures
44+
outputs = [
45+
"$fixtures_location/{{source_file_part}}",
6746
]
6847
}
6948

7049
group(target_name) {
71-
testonly = true
7250
deps = [
73-
":$fixtures_kernel_target_name",
51+
":$fixtures_copy_target_name",
7452
":$fixtures_source_set_target_name",
7553
]
7654
}

0 commit comments

Comments
 (0)