Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230)

This reverts commit 4e4fb4608d.

This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
This commit is contained in:
Chris Bracken
2018-12-15 14:43:26 -08:00
committed by GitHub
parent 1ff3da8881
commit 566db0ecb8
4 changed files with 18 additions and 37 deletions

View File

@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
void main() {
void simple_main() {
print("Hello");
}

View File

@@ -1 +1 @@
void main() {}
void main() {}

View File

@@ -22,14 +22,17 @@ TEST(EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs) {
return false;
};
std::string main =
std::string(testing::GetFixturesPath()) + "/simple_main.dart";
FlutterRendererConfig config = {};
config.type = FlutterRendererType::kSoftware;
config.software = renderer;
FlutterProjectArgs args = {};
args.struct_size = sizeof(FlutterProjectArgs);
args.assets_path = testing::GetFixturesPath();
args.main_path = "";
args.assets_path = "";
args.main_path = main.c_str();
args.packages_path = "";
FlutterEngine engine = nullptr;

View File

@@ -2,21 +2,18 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/dart/build/dart/dart_action.gni")
# Builds test fixtures for a unit test.
#
# Generates a directory structure containing an assets directory and the Dart
# code to execute compiled to kernel, emitted to assets/kernel_blob.bin.
template("test_fixtures") {
testonly = true
assert(defined(invoker.fixtures), "Test fixtures must be specified.")
fixtures_location = "$target_gen_dir/$target_name/assets"
fixtures_location_file = "$target_gen_dir/$target_name/test_fixtures_location.cc"
fixtures_name_target_name = target_name + "_gen_fixtures_name"
fixtures_source_set_target_name = target_name + "_gen_fixtures_source_set"
fixtures_copy_target_name = target_name + "_copy_fixtures"
fixtures_location = "$target_gen_dir/fixtures"
fixtures_location_file = "$target_gen_dir/test_fixtures_location.cc"
action(fixtures_name_target_name) {
script = "$flutter_root/testing/build/gen_fixtures_location_symbol.py"
@@ -32,9 +29,7 @@ template("test_fixtures") {
]
}
fixtures_source_set_target_name = target_name + "_gen_fixtures_source_set"
source_set(fixtures_source_set_target_name) {
testonly = true
sources = [
fixtures_location_file,
]
@@ -44,33 +39,16 @@ template("test_fixtures") {
]
}
fixtures_kernel_target_name = target_name + "_kernel"
prebuilt_dart_action(fixtures_kernel_target_name) {
testonly = true
script = "$root_out_dir/frontend_server.dart.snapshot"
fixture_paths = []
foreach(fixture, invoker.fixtures) {
fixture_paths += [ rebase_path(fixture) ]
}
inputs = fixture_paths
outputs = ["$fixtures_location/kernel_blob.bin"]
args = [
"--sdk-root", rebase_path("$root_out_dir/flutter_patched_sdk"),
"--strong",
"--target", "flutter",
"--output-dill", rebase_path("$fixtures_location/kernel_blob.bin"),
] + fixture_paths
deps = [
"//third_party/dart/utils/kernel-service:frontend_server"
copy(fixtures_copy_target_name) {
sources = invoker.fixtures
outputs = [
"$fixtures_location/{{source_file_part}}",
]
}
group(target_name) {
testonly = true
deps = [
":$fixtures_kernel_target_name",
":$fixtures_copy_target_name",
":$fixtures_source_set_target_name",
]
}