OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//mojo/public/tools/bindings/mojom.gni") | 5 import("//mojo/public/tools/bindings/mojom.gni") |
6 | 6 |
| 7 action("generate_test_snapshot_bin") { |
| 8 deps = [ |
| 9 "//dart/runtime/bin:gen_snapshot", |
| 10 ] |
| 11 inputs = [ |
| 12 "test_snapshot.dart", |
| 13 "//dart/runtime/tools/create_snapshot_bin.py", |
| 14 "//mojo/dart/embedder/builtin.dart", |
| 15 "//mojo/public/dart/bindings.dart", |
| 16 "//mojo/public/dart/core.dart", |
| 17 "//mojo/public/dart/src/buffer.dart", |
| 18 "//mojo/public/dart/src/client.dart", |
| 19 "//mojo/public/dart/src/codec.dart", |
| 20 "//mojo/public/dart/src/data_pipe.dart", |
| 21 "//mojo/public/dart/src/drain_data.dart", |
| 22 "//mojo/public/dart/src/event_stream.dart", |
| 23 "//mojo/public/dart/src/handle.dart", |
| 24 "//mojo/public/dart/src/handle_watcher.dart", |
| 25 "//mojo/public/dart/src/interface.dart", |
| 26 "//mojo/public/dart/src/message.dart", |
| 27 "//mojo/public/dart/src/message_pipe.dart", |
| 28 "//mojo/public/dart/src/struct.dart", |
| 29 "//mojo/public/dart/src/timer_impl.dart", |
| 30 "//mojo/public/dart/src/timer_queue.dart", |
| 31 "//mojo/public/dart/src/types.dart", |
| 32 ] |
| 33 output = "$target_gen_dir/test_snapshot_gen.bin" |
| 34 outputs = [ |
| 35 output, |
| 36 ] |
| 37 |
| 38 script = "//dart/runtime/tools/create_snapshot_bin.py" |
| 39 builtin_path = rebase_path("//mojo/dart/embedder/builtin.dart") |
| 40 bindings_path = rebase_path("//mojo/public/dart/bindings.dart") |
| 41 core_path = rebase_path("//mojo/public/dart/core.dart") |
| 42 args = [ |
| 43 "--executable", rebase_path("$root_out_dir/gen_snapshot"), |
| 44 "--package_root", rebase_path("$root_gen_dir"), |
| 45 "--script", rebase_path("test_snapshot.dart"), |
| 46 "--output_bin", rebase_path(output, root_build_dir), |
| 47 "--target_os", os, |
| 48 "--url_mapping=dart:mojo_bindings,$bindings_path", |
| 49 "--url_mapping=dart:mojo_builtin,$builtin_path", |
| 50 "--url_mapping=dart:mojo_core,$core_path", |
| 51 ] |
| 52 } |
| 53 |
| 54 action("generate_test_snapshot_file") { |
| 55 deps = [ |
| 56 ":generate_test_snapshot_bin", |
| 57 ] |
| 58 inputs = [ |
| 59 "//dart/runtime/tools/create_snapshot_file.py", |
| 60 "//mojo/dart/embedder/snapshot.cc.tmpl", |
| 61 "$target_gen_dir/test_snapshot_gen.bin", |
| 62 ] |
| 63 output = "$target_gen_dir/test_snapshot.cc" |
| 64 outputs = [ |
| 65 output, |
| 66 ] |
| 67 |
| 68 script = "//dart/runtime/tools/create_snapshot_file.py" |
| 69 args = [ |
| 70 "--input_bin", rebase_path("$target_gen_dir/test_snapshot_gen.bin"), |
| 71 "--input_cc", rebase_path("//mojo/dart/embedder/snapshot.cc.tmpl"), |
| 72 "--output", rebase_path(output), |
| 73 ] |
| 74 } |
| 75 |
| 76 source_set("dart_controller_for_test") { |
| 77 testonly=true |
| 78 sources = [ |
| 79 "$target_gen_dir/test_snapshot.cc", |
| 80 ] |
| 81 |
| 82 deps = [ |
| 83 ":generate_test_snapshot_file", |
| 84 "//mojo/dart/embedder:dart_controller_no_snapshot", |
| 85 ] |
| 86 } |
| 87 |
7 test("dart_unittests") { | 88 test("dart_unittests") { |
8 sources = [ | 89 sources = [ |
9 "run_dart_tests.cc", | 90 "run_dart_tests.cc", |
10 ] | 91 ] |
11 deps = [ | 92 deps = [ |
| 93 ":dart_controller_for_test", |
12 ":dart_to_cpp_unittests", | 94 ":dart_to_cpp_unittests", |
13 ":expect", | 95 ":expect", |
14 "//base", | 96 "//base", |
15 "//crypto:crypto", | 97 "//crypto:crypto", |
16 "//mojo/dart/embedder:dart_controller", | 98 "//mojo/dart/embedder:dart_controller_no_snapshot", |
17 "//mojo/edk/test:run_all_unittests", | 99 "//mojo/edk/test:run_all_unittests", |
18 "//mojo/edk/test:test_support", | 100 "//mojo/edk/test:test_support", |
19 "//mojo/public/cpp/environment", | 101 "//mojo/public/cpp/environment", |
20 "//mojo/public/cpp/system", | 102 "//mojo/public/cpp/system", |
21 "//mojo/public/cpp/utility", | 103 "//mojo/public/cpp/utility", |
22 "//mojo/environment:chromium", | 104 "//mojo/environment:chromium", |
23 "//testing/gtest", | 105 "//testing/gtest", |
24 ] | 106 ] |
25 } | 107 } |
26 | 108 |
27 copy("expect") { | 109 copy("expect") { |
28 sources = [ | 110 sources = [ |
29 "//mojo/dart/testing/expect.dart", | 111 "//mojo/dart/testing/expect.dart", |
30 ] | 112 ] |
31 outputs = [ | 113 outputs = [ |
32 "{{source_gen_dir}}/{{source_file_part}}", | 114 "{{source_gen_dir}}/{{source_file_part}}", |
33 ] | 115 ] |
34 } | 116 } |
35 | 117 |
36 source_set("dart_to_cpp_unittests") { | 118 source_set("dart_to_cpp_unittests") { |
37 testonly = true | 119 testonly = true |
38 sources = [ | 120 sources = [ |
39 "dart_to_cpp_tests.cc", | 121 "dart_to_cpp_tests.cc", |
40 ] | 122 ] |
41 deps = [ | 123 deps = [ |
| 124 ":dart_controller_for_test", |
42 ":dart_to_cpp_bindings", | 125 ":dart_to_cpp_bindings", |
43 "//base", | 126 "//base", |
44 "//crypto", | 127 "//crypto", |
45 "//mojo/dart/embedder:dart_controller", | 128 "//mojo/dart/embedder:dart_controller_no_snapshot", |
46 "//mojo/edk/test:test_support", | 129 "//mojo/edk/test:test_support", |
47 "//mojo/public/cpp/bindings", | 130 "//mojo/public/cpp/bindings", |
48 "//mojo/public/cpp/system", | 131 "//mojo/public/cpp/system", |
49 "//mojo/public/interfaces/bindings/tests:test_interfaces", | 132 "//mojo/public/interfaces/bindings/tests:test_interfaces", |
50 "//testing/gtest", | 133 "//testing/gtest", |
51 ] | 134 ] |
52 } | 135 } |
53 | 136 |
54 mojom("dart_to_cpp_bindings") { | 137 mojom("dart_to_cpp_bindings") { |
55 sources = [ | 138 sources = [ |
56 "dart_to_cpp.mojom", | 139 "dart_to_cpp.mojom", |
57 ] | 140 ] |
58 } | 141 } |
OLD | NEW |