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.
115template (" 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