diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-12 16:09:28 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-16 17:51:12 +0200 |
commit | 62d204ff4cc94c12c1635f189255710901682825 (patch) | |
tree | 0c5cdc5faf98d28ddf74721280756804a6decf83 /test/buildtool/build_engine | |
parent | de3ef374983d987d8ffd8e8516a4877fe68b3e4e (diff) | |
download | justbuild-62d204ff4cc94c12c1635f189255710901682825.tar.gz |
Remove the RemoteExecutionConfig singleton
...and replace it with passed instances created early via a builder
pattern.
Tests are also updated accordingly.
Diffstat (limited to 'test/buildtool/build_engine')
-rw-r--r-- | test/buildtool/build_engine/target_map/target_map.test.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
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 5ec27e97..4d7cef75 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -107,13 +107,14 @@ TEST_CASE("simple targets", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -558,13 +559,14 @@ TEST_CASE("configuration deduplication", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -654,13 +656,14 @@ TEST_CASE("generator functions in string arguments", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -762,13 +765,14 @@ TEST_CASE("built-in rules", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -980,13 +984,14 @@ TEST_CASE("target reference", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -1131,13 +1136,14 @@ TEST_CASE("trees", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -1246,13 +1252,14 @@ TEST_CASE("RESULT error reporting", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, @@ -1420,13 +1427,14 @@ TEST_CASE("wrong arguments", "[target_map]") { REQUIRE(serve_config); LocalExecutionConfig local_exec_config{}; + RemoteExecutionConfig remote_exec_config{}; Auth auth{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RemoteExecutionConfig::Instance()}; + &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, .storage = &storage, |