OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 # ============================================================================== | 5 # ============================================================================== |
6 # TEST SETUP | 6 # TEST SETUP |
7 # ============================================================================== | 7 # ============================================================================== |
8 | 8 |
9 # Define a test as an executable (or apk on Android) with the "testonly" flag | 9 # Define a test as an executable (or apk on Android) with the "testonly" flag |
10 # set. | 10 # set. |
(...skipping 10 matching lines...) Expand all Loading... |
21 # Configs will always be defined since we set_defaults for a component | 21 # Configs will always be defined since we set_defaults for a component |
22 # in the main config. We want to use those rather than whatever came with | 22 # in the main config. We want to use those rather than whatever came with |
23 # the nested shared/static library inside the component. | 23 # the nested shared/static library inside the component. |
24 configs = [] # Prevent list overwriting warning. | 24 configs = [] # Prevent list overwriting warning. |
25 configs = invoker.configs | 25 configs = invoker.configs |
26 | 26 |
27 testonly = true | 27 testonly = true |
28 | 28 |
29 # Don't use "*" to forward all variables since some (like output_name | 29 # Don't use "*" to forward all variables since some (like output_name |
30 # and isolate_file) apply only to the APK below. | 30 # and isolate_file) apply only to the APK below. |
| 31 deps = [] |
31 forward_variables_from(invoker, | 32 forward_variables_from(invoker, |
32 [ | 33 [ |
33 "all_dependent_configs", | 34 "all_dependent_configs", |
34 "allow_circular_includes_from", | 35 "allow_circular_includes_from", |
35 "cflags", | 36 "cflags", |
36 "cflags_c", | 37 "cflags_c", |
37 "cflags_cc", | 38 "cflags_cc", |
38 "check_includes", | 39 "check_includes", |
39 "data", | 40 "data", |
40 "data_deps", | 41 "data_deps", |
41 "datadeps", | 42 "datadeps", |
42 "defines", | 43 "defines", |
| 44 "deps", |
43 "include_dirs", | 45 "include_dirs", |
44 "ldflags", | 46 "ldflags", |
45 "lib_dirs", | 47 "lib_dirs", |
46 "libs", | 48 "libs", |
47 "output_extension", | 49 "output_extension", |
48 "output_name", | 50 "output_name", |
49 "public", | 51 "public", |
50 "public_configs", | 52 "public_configs", |
51 "public_deps", | 53 "public_deps", |
52 "sources", | 54 "sources", |
53 "visibility", | 55 "visibility", |
54 ]) | 56 ]) |
55 | 57 |
56 deps = [] | |
57 if (!defined(invoker.use_default_launcher) || | 58 if (!defined(invoker.use_default_launcher) || |
58 invoker.use_default_launcher) { | 59 invoker.use_default_launcher) { |
59 deps += [ "//testing/android/native_test:native_test_native_code" ] | 60 deps += [ "//testing/android/native_test:native_test_native_code" ] |
60 } | 61 } |
61 if (defined(invoker.deps)) { | |
62 deps += invoker.deps | |
63 } | |
64 } | 62 } |
65 | 63 |
66 unittest_apk(apk_name) { | 64 unittest_apk(apk_name) { |
67 forward_variables_from(invoker, | 65 forward_variables_from(invoker, |
68 [ | 66 [ |
69 "android_manifest", | 67 "android_manifest", |
| 68 "deps", |
70 "use_default_launcher", | 69 "use_default_launcher", |
71 "write_asset_list", | 70 "write_asset_list", |
72 ]) | 71 ]) |
73 | |
74 unittests_dep = ":$library_name" | 72 unittests_dep = ":$library_name" |
75 apk_name = main_target_name | 73 apk_name = main_target_name |
76 if (defined(invoker.output_name)) { | 74 if (defined(invoker.output_name)) { |
77 apk_name = invoker.output_name | 75 apk_name = invoker.output_name |
78 unittests_binary = "lib${apk_name}.so" | 76 unittests_binary = "lib${apk_name}.so" |
79 } | 77 } |
80 deps = [ | 78 deps += [ ":$library_name" ] |
81 ":$library_name", | |
82 ] | |
83 if (defined(invoker.apk_deps)) { | |
84 deps += invoker.apk_deps | |
85 } | |
86 if (defined(invoker.apk_asset_location)) { | 79 if (defined(invoker.apk_asset_location)) { |
87 asset_location = invoker.apk_asset_location | 80 asset_location = invoker.apk_asset_location |
88 } | 81 } |
89 } | 82 } |
90 | 83 |
91 _test_name = main_target_name | 84 _test_name = main_target_name |
92 if (defined(invoker.output_name)) { | 85 if (defined(invoker.output_name)) { |
93 _test_name = invoker.output_name | 86 _test_name = invoker.output_name |
94 } | 87 } |
95 test_runner_script_name = "${_test_name}__test_runner_script" | 88 test_runner_script_name = "${_test_name}__test_runner_script" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 # All shared libraries must have the sanitizer deps to properly link in | 191 # All shared libraries must have the sanitizer deps to properly link in |
199 # asan mode (this target will be empty in other cases). | 192 # asan mode (this target will be empty in other cases). |
200 "//build/config/sanitizers:deps", | 193 "//build/config/sanitizers:deps", |
201 | 194 |
202 # Give tests the default manifest on Windows (a no-op elsewhere). | 195 # Give tests the default manifest on Windows (a no-op elsewhere). |
203 "//build/win:default_exe_manifest", | 196 "//build/win:default_exe_manifest", |
204 ] | 197 ] |
205 } | 198 } |
206 } | 199 } |
207 } | 200 } |
OLD | NEW |