Chromium Code Reviews| 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 # This file contains templates which are meant to simplify building and | 5 # This file contains templates which are meant to simplify building and |
| 6 # running test binaries with the Chromecast build infrastructure. See | 6 # running test binaries with the Chromecast build infrastructure. See |
| 7 # documentation above each template for specific use. | 7 # documentation above each template for specific use. |
| 8 # | 8 # |
| 9 # Example Usage | 9 # Example Usage |
| 10 # | 10 # |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 assert(_priority == "1" || _priority == "2" || _priority == "3" || | 190 assert(_priority == "1" || _priority == "2" || _priority == "3" || |
| 191 _priority == "4" || _priority == "5" || _priority == "6" || | 191 _priority == "4" || _priority == "5" || _priority == "6" || |
| 192 _priority == "7" || _priority == "8" || _priority == "9") | 192 _priority == "7" || _priority == "8" || _priority == "9") |
| 193 | 193 |
| 194 # This will be the prefix of each output file. | 194 # This will be the prefix of each output file. |
| 195 _output_prefix = "$_shared_dir/$_priority-$target_name" | 195 _output_prefix = "$_shared_dir/$_priority-$target_name" |
| 196 | 196 |
| 197 # Create a list of all the target names. These must correspond to the name of | 197 # Create a list of all the target names. These must correspond to the name of |
| 198 # the test binary. | 198 # the test binary. |
| 199 _test_names = [] | 199 _test_names = [] |
| 200 foreach(_test, invoker.tests) { | 200 foreach(_test, invoker.tests) { |
|
slan
2017/01/18 17:49:21
nit: This for-loop could be combined with the one
| |
| 201 _test_names += [ get_label_info(_test, "name") ] | 201 _test_names += [ get_label_info(_test, "name") ] |
| 202 } | 202 } |
| 203 | 203 |
| 204 # Create a dummy target so that we can get the runtime deps for each test | |
| 205 # and output them into a file. The runtime deps include all of the data files, | |
| 206 # data directories, and shared libraries that a test needs in order to run. | |
| 207 foreach(_test, invoker.tests) { | |
| 208 _test_name = get_label_info(_test, "name") | |
| 209 group(_test_name + "_cast_runtime_deps") { | |
|
alokp
2017/01/17 21:30:25
"_cast" prefix seems unnecessary
slan
2017/01/18 17:49:21
Actually, I think having "cast" in the name is use
alokp
2017/01/18 23:35:36
Don't we already have test_name in the group targe
slan
2017/01/19 00:15:03
Yes, but since we build tests from other parts of
| |
| 210 testonly = true | |
| 211 data_deps = [ | |
| 212 _test, | |
| 213 ] | |
| 214 write_runtime_deps = "$root_out_dir/${_test_name}.runtime_deps" | |
|
alokp
2017/01/17 21:30:25
I would suggest using a proper file type (txt, jso
slan
2017/01/18 17:49:21
I assume this convention was chosen to match the e
| |
| 215 } | |
| 216 } | |
| 217 | |
| 204 # This action generates a list of target names to build and run. It will be | 218 # This action generates a list of target names to build and run. It will be |
| 205 # depended upon by the "pack_build" action of the cast_test_group_list | 219 # depended upon by the "pack_build" action of the cast_test_group_list |
| 206 # instance which depends on this cast_test_group. | 220 # instance which depends on this cast_test_group. |
| 207 action(target_name + "_create_list") { | 221 action(target_name + "_create_list") { |
| 208 script = "//chromecast/tools/build/generate_test_lists.py" | 222 script = "//chromecast/tools/build/generate_test_lists.py" |
| 209 | 223 |
| 210 outputs = [ | 224 outputs = [ |
| 211 "$_output_prefix.tests", | 225 "$_output_prefix.tests", |
| 212 ] | 226 ] |
| 213 | 227 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 # script executes. | 417 # script executes. |
| 404 deps += _filter_actions | 418 deps += _filter_actions |
| 405 | 419 |
| 406 # If |build_tests| has been set to true, depend on the testing targets so | 420 # If |build_tests| has been set to true, depend on the testing targets so |
| 407 # that the tests are built. | 421 # that the tests are built. |
| 408 if (defined(_build_tests)) { | 422 if (defined(_build_tests)) { |
| 409 deps += _build_tests | 423 deps += _build_tests |
| 410 } | 424 } |
| 411 } | 425 } |
| 412 } | 426 } |
| OLD | NEW |