diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-08 11:28:13 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-16 17:51:12 +0200 |
commit | 978de9de55d9592c258052dd52dc25c788a89d78 (patch) | |
tree | dff959d84f1d95af1f0546471d3b2c7eaa47dbc2 /test/buildtool/execution_api/local/local_api.test.cpp | |
parent | b4cd4d0c0d1b526eab3549c9cba12179dbba3a3f (diff) | |
download | justbuild-978de9de55d9592c258052dd52dc25c788a89d78.tar.gz |
Remove the LocalExecutionConfig singleton
...and replace it with passed instances created early via a builder
pattern.
Diffstat (limited to 'test/buildtool/execution_api/local/local_api.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/local/local_api.test.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/buildtool/execution_api/local/local_api.test.cpp b/test/buildtool/execution_api/local/local_api.test.cpp index 164226b9..6a6b899a 100644 --- a/test/buildtool/execution_api/local/local_api.test.cpp +++ b/test/buildtool/execution_api/local/local_api.test.cpp @@ -51,8 +51,8 @@ class FactoryApi final { TEST_CASE("LocalAPI: No input, no output", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestNoInputNoOutput(api_factory, {}, /*is_hermetic=*/true); } @@ -60,8 +60,8 @@ TEST_CASE("LocalAPI: No input, no output", "[execution_api]") { TEST_CASE("LocalAPI: No input, create output", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestNoInputCreateOutput(api_factory, {}, /*is_hermetic=*/true); } @@ -69,8 +69,8 @@ TEST_CASE("LocalAPI: No input, create output", "[execution_api]") { TEST_CASE("LocalAPI: One input copied to output", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestOneInputCopiedToOutput(api_factory, {}, /*is_hermetic=*/true); } @@ -78,8 +78,8 @@ TEST_CASE("LocalAPI: One input copied to output", "[execution_api]") { TEST_CASE("LocalAPI: Non-zero exit code, create output", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestNonZeroExitCodeCreateOutput(api_factory, {}); } @@ -87,8 +87,8 @@ TEST_CASE("LocalAPI: Non-zero exit code, create output", "[execution_api]") { TEST_CASE("LocalAPI: Retrieve two identical trees to path", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestRetrieveTwoIdenticalTreesToPath( api_factory, {}, "two_trees", /*is_hermetic=*/true); @@ -98,8 +98,8 @@ TEST_CASE("LocalAPI: Retrieve file and symlink with same content to path", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestRetrieveFileAndSymlinkWithSameContentToPath( api_factory, {}, "file_and_symlink", /*is_hermetic=*/true); @@ -108,8 +108,8 @@ TEST_CASE("LocalAPI: Retrieve file and symlink with same content to path", TEST_CASE("LocalAPI: Retrieve mixed blobs and trees", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestRetrieveMixedBlobsAndTrees( api_factory, {}, "blobs_and_trees", /*is_hermetic=*/true); @@ -118,8 +118,8 @@ TEST_CASE("LocalAPI: Retrieve mixed blobs and trees", "[execution_api]") { TEST_CASE("LocalAPI: Create directory prior to execution", "[execution_api]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); - FactoryApi api_factory( - &storage_config.Get(), &storage, &LocalExecutionConfig::Instance()); + auto const local_exec_config = SetLauncher(); + FactoryApi api_factory(&storage_config.Get(), &storage, &local_exec_config); TestCreateDirPriorToExecution(api_factory, {}, /*is_hermetic=*/true); } |