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/storage/local_cas.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/storage/local_cas.test.cpp')
-rw-r--r-- | test/buildtool/storage/local_cas.test.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/test/buildtool/storage/local_cas.test.cpp b/test/buildtool/storage/local_cas.test.cpp index b64ee780..ef77a6a1 100644 --- a/test/buildtool/storage/local_cas.test.cpp +++ b/test/buildtool/storage/local_cas.test.cpp @@ -23,16 +23,15 @@ #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" #include "test/utils/blob_creator.hpp" -#include "test/utils/hermeticity/local.hpp" +#include "test/utils/hermeticity/test_storage_config.hpp" -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalCAS: Add blob to storage from bytes", - "[storage]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalCAS: Add blob to storage from bytes", "[storage]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + auto const& cas = storage.CAS(); std::string test_bytes("test"); - auto const& cas = storage.CAS(); auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_bytes); // check blob not in storage @@ -74,15 +73,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, } } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalCAS: Add blob to storage from non-executable file", - "[storage]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalCAS: Add blob to storage from non-executable file", + "[storage]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + auto const& cas = storage.CAS(); std::filesystem::path non_exec_file{ "test/buildtool/storage/data/non_executable_file"}; - auto const& cas = storage.CAS(); auto test_blob = CreateBlobFromPath(non_exec_file); REQUIRE(test_blob); @@ -125,15 +124,14 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, } } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "LocalCAS: Add blob to storage from executable file", - "[storage]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("LocalCAS: Add blob to storage from executable file", "[storage]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + auto const& cas = storage.CAS(); std::filesystem::path exec_file{ "test/buildtool/storage/data/executable_file"}; - auto const& cas = storage.CAS(); auto test_blob = CreateBlobFromPath(exec_file); REQUIRE(test_blob); |