| OLD | NEW |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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("//services/catalog/public/tools/catalog.gni") | 5 import("//services/catalog/public/tools/catalog.gni") |
| 6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
| 7 | 7 |
| 8 # Generates a unittest binary with a baked-in Service Manager catalog manifest. | 8 # Generates a unittest binary with a baked-in Service Manager catalog manifest. |
| 9 # | 9 # |
| 10 # Parameters: | 10 # Parameters: |
| 11 # | 11 # |
| 12 # catalog | 12 # catalog |
| 13 # The catalog target whose output should be used as the static catalog | 13 # The catalog target whose output should be used as the static catalog |
| 14 # manifest for this test binary. | 14 # manifest for this test binary. |
| 15 # | 15 # |
| 16 template("service_test") { | 16 template("service_test") { |
| 17 assert(defined(invoker.catalog), "service_test must specify a catalog") | 17 assert(defined(invoker.catalog), "service_test must specify a catalog") |
| 18 | 18 |
| 19 catalog_source_target = "${target_name}__catalog_source" | 19 catalog_source_target = "${target_name}__catalog_source" |
| 20 | 20 |
| 21 test(target_name) { | 21 test(target_name) { |
| 22 forward_variables_from(invoker, "*", [ "catalog" ]) | 22 forward_variables_from(invoker, "*", [ "catalog" ]) |
| 23 | 23 |
| 24 if (!defined(deps)) { | 24 if (!defined(deps)) { |
| 25 deps = [] | 25 deps = [] |
| 26 } | 26 } |
| 27 deps += [ | 27 deps += [ |
| 28 ":$catalog_source_target", | 28 ":$catalog_source_target", |
| 29 "//services/service_manager/public/cpp/test:run_all_service_tests_with_cat
alog", | 29 "//services/service_manager/public/cpp/test:run_all_service_tests", |
| 30 ] | 30 ] |
| 31 } | 31 } |
| 32 | 32 |
| 33 catalog_cpp_source(catalog_source_target) { | 33 catalog_cpp_source(catalog_source_target) { |
| 34 catalog = invoker.catalog | 34 catalog = invoker.catalog |
| 35 generated_function_name = "service_manager::test::CreateTestCatalog" | 35 generated_function_name = "service_manager::test::CreateTestCatalog" |
| 36 } | 36 } |
| 37 } | 37 } |
| OLD | NEW |