| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 ":$library_name", | 124 ":$library_name", |
| 125 ] | 125 ] |
| 126 if (defined(invoker.apk_deps)) { | 126 if (defined(invoker.apk_deps)) { |
| 127 deps += invoker.apk_deps | 127 deps += invoker.apk_deps |
| 128 } | 128 } |
| 129 if (defined(invoker.apk_asset_location)) { | 129 if (defined(invoker.apk_asset_location)) { |
| 130 asset_location = invoker.apk_asset_location | 130 asset_location = invoker.apk_asset_location |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 test_name = main_target_name |
| 135 if (defined(invoker.output_name)) { |
| 136 test_name = invoker.output_name |
| 137 } |
| 138 test_runner_script_name = "${test_name}__test_runner_script" |
| 139 test_runner_script(test_runner_script_name) { |
| 140 test_name = test_name |
| 141 test_type = "gtest" |
| 142 test_suite = test_name |
| 143 if (defined(invoker.isolate_file)) { |
| 144 isolate_file = invoker.isolate_file |
| 145 } |
| 146 } |
| 147 |
| 134 group(target_name) { | 148 group(target_name) { |
| 135 testonly = true | 149 testonly = true |
| 136 | 150 datadeps = [ |
| 151 ":$test_runner_script_name", |
| 152 ] |
| 137 deps = [ | 153 deps = [ |
| 138 ":$library_name", | 154 ":$library_name", |
| 139 ":$apk_name", | 155 ":$apk_name", |
| 140 ] | 156 ] |
| 141 } | 157 } |
| 142 } else { | 158 } else { |
| 143 executable(target_name) { | 159 executable(target_name) { |
| 144 # See above. | 160 # See above. |
| 145 configs = [] # Prevent list overwriting warning. | 161 configs = [] # Prevent list overwriting warning. |
| 146 configs = invoker.configs | 162 configs = invoker.configs |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 247 } |
| 232 if (defined(invoker.sources)) { | 248 if (defined(invoker.sources)) { |
| 233 sources = invoker.sources | 249 sources = invoker.sources |
| 234 } | 250 } |
| 235 if (defined(invoker.visibility)) { | 251 if (defined(invoker.visibility)) { |
| 236 visibility = invoker.visibility | 252 visibility = invoker.visibility |
| 237 } | 253 } |
| 238 } | 254 } |
| 239 } | 255 } |
| 240 } | 256 } |
| OLD | NEW |