summaryrefslogtreecommitdiff
path: root/test/buildtool/storage/local_cas.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/buildtool/storage/local_cas.test.cpp')
-rw-r--r--test/buildtool/storage/local_cas.test.cpp30
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);