From b393090c220da61dd1c197adfac42dc47ad74f8a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 29 Jul 2024 11:13:08 +0200 Subject: ApiBundle: Use a creator method instead of constructor This will allow for ApiBundle to be used together with the TestApi implementation of IExecutionApi in tests. Also rename CreateRemote method to MakeRemote in order to remove any semantical confusion. --- .../build_engine/target_map/target_map.test.cpp | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'test/buildtool/build_engine/target_map/target_map.test.cpp') diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp index ed859e31..ddcecdd0 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -126,9 +126,9 @@ TEST_CASE("simple targets", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -589,9 +589,9 @@ TEST_CASE("configuration deduplication", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); @@ -699,9 +699,9 @@ TEST_CASE("generator functions in string arguments", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); @@ -821,9 +821,9 @@ TEST_CASE("built-in rules", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); @@ -1055,9 +1055,9 @@ TEST_CASE("target reference", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); @@ -1220,9 +1220,9 @@ TEST_CASE("trees", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); @@ -1349,9 +1349,9 @@ TEST_CASE("RESULT error reporting", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); @@ -1537,9 +1537,9 @@ TEST_CASE("wrong arguments", "[target_map]") { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const apis = ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, &apis); -- cgit v1.2.3