diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-02 13:21:14 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 13:32:39 +0200 |
commit | d202e8f6051df5eb89d0f2eb1b9ac7109d204f56 (patch) | |
tree | 562d90c0a5396a259d11c4288162403489a6e4fd /test/buildtool/execution_api/local/local_execution.test.cpp | |
parent | 5140befaa10f65145fe041b416b7764127efc379 (diff) | |
download | justbuild-d202e8f6051df5eb89d0f2eb1b9ac7109d204f56.tar.gz |
Remove HermeticLocalTestFixture
...and create StorageConfig and Storage in place if needed.
Diffstat (limited to 'test/buildtool/execution_api/local/local_execution.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/local/local_execution.test.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index 480b34df..bbd48ddc 100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -28,7 +28,7 @@ #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" -#include "test/utils/hermeticity/local.hpp" +#include "test/utils/hermeticity/test_storage_config.hpp" namespace { @@ -58,13 +58,12 @@ inline void SetLauncher() { } // namespace -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalExecution: No input, no output", - "[execution_api]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalExecution: No input, no output", "[execution_api]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); RepositoryConfig repo_config{}; - auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); + auto api = LocalApi(&storage_config.Get(), &storage, &repo_config); std::string test_content("test"); std::vector<std::string> const cmdline = {"echo", "-n", test_content}; @@ -106,12 +105,13 @@ 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()); +TEST_CASE("LocalExecution: No input, no output, env variables used", + "[execution_api]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; - auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); + auto api = LocalApi(&storage_config.Get(), &storage, &repo_config); std::string test_content("test from env var"); std::vector<std::string> const cmdline = { @@ -157,12 +157,12 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, } } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalExecution: No input, create output", - "[execution_api]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalExecution: No input, create output", "[execution_api]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; - auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); + auto api = LocalApi(&storage_config.Get(), &storage, &repo_config); std::string test_content("test"); auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_content); @@ -214,12 +214,12 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, } } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalExecution: One input copied to output", - "[execution_api]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalExecution: One input copied to output", "[execution_api]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; - auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); + auto api = LocalApi(&storage_config.Get(), &storage, &repo_config); std::string test_content("test"); auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_content); @@ -285,12 +285,12 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, } } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalExecution: Cache failed action's result", - "[execution_api]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalExecution: Cache failed action's result", "[execution_api]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; - auto api = LocalApi(&StorageConfig::Instance(), &storage, &repo_config); + auto api = LocalApi(&storage_config.Get(), &storage, &repo_config); auto flag = GetTestDir() / "flag"; std::vector<std::string> const cmdline = { |