diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-04 12:25:20 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 13:32:39 +0200 |
commit | 5140befaa10f65145fe041b416b7764127efc379 (patch) | |
tree | 9bb8d66c31455d275e5870e69c10d31789fb6c0a /test/buildtool/execution_api/local/local_execution.test.cpp | |
parent | e8992e622278d093165b3a0d8271a14424b61775 (diff) | |
download | justbuild-5140befaa10f65145fe041b416b7764127efc379.tar.gz |
Convert Storage to a general class
Diffstat (limited to 'test/buildtool/execution_api/local/local_execution.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/local/local_execution.test.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index 6f9ccfb1..480b34df 100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -61,9 +61,10 @@ inline void SetLauncher() { TEST_CASE_METHOD(HermeticLocalTestFixture, "LocalExecution: No input, no output", "[execution_api]") { + auto const storage = Storage::Create(&StorageConfig::Instance()); + RepositoryConfig repo_config{}; - auto api = LocalApi( - &StorageConfig::Instance(), &Storage::Instance(), &repo_config); + auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); std::string test_content("test"); std::vector<std::string> const cmdline = {"echo", "-n", test_content}; @@ -108,9 +109,9 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "LocalExecution: No input, no output, env variables used", "[execution_api]") { + auto const storage = Storage::Create(&StorageConfig::Instance()); RepositoryConfig repo_config{}; - auto api = LocalApi( - &StorageConfig::Instance(), &Storage::Instance(), &repo_config); + auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); std::string test_content("test from env var"); std::vector<std::string> const cmdline = { @@ -159,9 +160,9 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "LocalExecution: No input, create output", "[execution_api]") { + auto const storage = Storage::Create(&StorageConfig::Instance()); RepositoryConfig repo_config{}; - auto api = LocalApi( - &StorageConfig::Instance(), &Storage::Instance(), &repo_config); + auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); std::string test_content("test"); auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_content); @@ -216,9 +217,9 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "LocalExecution: One input copied to output", "[execution_api]") { + auto const storage = Storage::Create(&StorageConfig::Instance()); RepositoryConfig repo_config{}; - auto api = LocalApi( - &StorageConfig::Instance(), &Storage::Instance(), &repo_config); + auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); std::string test_content("test"); auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_content); @@ -287,9 +288,9 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "LocalExecution: Cache failed action's result", "[execution_api]") { + auto const storage = Storage::Create(&StorageConfig::Instance()); RepositoryConfig repo_config{}; - auto api = LocalApi( - &StorageConfig::Instance(), &Storage::Instance(), &repo_config); + auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); auto flag = GetTestDir() / "flag"; std::vector<std::string> const cmdline = { |