summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-27 16:16:09 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-05 13:32:39 +0200
commit4ebb3bf82551c334d16f4935c751fb554224e19c (patch)
treec358d268e8704bd1b50430f4305ed713b5fb5812 /test
parent9f5dcef077a3db2f6c791e403e5036f6464c9576 (diff)
downloadjustbuild-4ebb3bf82551c334d16f4935c751fb554224e19c.tar.gz
Pass Storage to RepositoryConfig
...and adjust AnalyseContext.
Diffstat (limited to 'test')
-rw-r--r--test/buildtool/build_engine/target_map/target_map.test.cpp16
-rw-r--r--test/buildtool/common/repository_config.test.cpp36
2 files changed, 26 insertions, 26 deletions
diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp
index a3e1d350..bb15a544 100644
--- a/test/buildtool/build_engine/target_map/target_map.test.cpp
+++ b/test/buildtool/build_engine/target_map/target_map.test.cpp
@@ -109,7 +109,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "simple targets", "[target_map]") {
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -557,7 +557,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -650,7 +650,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -753,7 +753,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "built-in rules", "[target_map]") {
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -966,7 +966,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "target reference", "[target_map]") {
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -1112,7 +1112,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "trees", "[target_map]") {
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -1224,7 +1224,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
@@ -1393,7 +1393,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "wrong arguments", "[target_map]") {
RemoteExecutionConfig::RemoteAddress()};
auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
AnalyseContext ctx{.repo_config = &repo_config,
- .target_cache = &Storage::Instance().TargetCache(),
+ .storage = &Storage::Instance(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve ? &*serve : nullptr};
diff --git a/test/buildtool/common/repository_config.test.cpp b/test/buildtool/common/repository_config.test.cpp
index e4b4fd8d..56100643 100644
--- a/test/buildtool/common/repository_config.test.cpp
+++ b/test/buildtool/common/repository_config.test.cpp
@@ -120,7 +120,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
RepositoryConfig config{};
CHECK(config.Info("missing") == nullptr);
- CHECK_FALSE(config.RepositoryKey("missing"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "missing"));
}
TEST_CASE_METHOD(HermeticLocalTestFixture,
@@ -130,7 +130,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
SECTION("for single fixed repository") {
config.SetInfo("foo", CreateFixedRepoInfo());
- auto key = config.RepositoryKey("foo");
+ auto key = config.RepositoryKey(Storage::Instance(), "foo");
REQUIRE(key);
// verify created graph from CAS
@@ -140,15 +140,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
SECTION("for fixed repositories with same missing dependency") {
config.SetInfo("foo", CreateFixedRepoInfo({{"dep", "baz"}}));
config.SetInfo("bar", CreateFixedRepoInfo({{"dep", "baz"}}));
- CHECK_FALSE(config.RepositoryKey("foo"));
- CHECK_FALSE(config.RepositoryKey("bar"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "foo"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "bar"));
}
SECTION("for fixed repositories with different missing dependency") {
config.SetInfo("foo", CreateFixedRepoInfo({{"dep", "baz0"}}));
config.SetInfo("bar", CreateFixedRepoInfo({{"dep", "baz1"}}));
- CHECK_FALSE(config.RepositoryKey("foo"));
- CHECK_FALSE(config.RepositoryKey("bar"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "foo"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "bar"));
}
}
@@ -159,14 +159,14 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
SECTION("for single file repository") {
config.SetInfo("foo", CreateFileRepoInfo());
- CHECK_FALSE(config.RepositoryKey("foo"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "foo"));
}
SECTION("for graph with leaf dependency as file") {
config.SetInfo("foo", CreateFixedRepoInfo({{"bar", "bar"}}));
config.SetInfo("bar", CreateFixedRepoInfo({{"baz", "baz"}}));
config.SetInfo("baz", CreateFileRepoInfo());
- CHECK_FALSE(config.RepositoryKey("foo"));
+ CHECK_FALSE(config.RepositoryKey(Storage::Instance(), "foo"));
}
}
@@ -186,8 +186,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
config.SetInfo("baz1", Copy(baz));
// check if computed key is same
- auto foo_key = config.RepositoryKey("foo");
- auto bar_key = config.RepositoryKey("bar");
+ auto foo_key = config.RepositoryKey(Storage::Instance(), "foo");
+ auto bar_key = config.RepositoryKey(Storage::Instance(), "bar");
REQUIRE(foo_key);
REQUIRE(bar_key);
CHECK(*foo_key == *bar_key);
@@ -205,8 +205,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
config.SetInfo("baz1", Copy(baz));
// check if computed key is same
- auto foo_key = config.RepositoryKey("foo");
- auto bar_key = config.RepositoryKey("bar");
+ auto foo_key = config.RepositoryKey(Storage::Instance(), "foo");
+ auto bar_key = config.RepositoryKey(Storage::Instance(), "bar");
REQUIRE(foo_key);
REQUIRE(bar_key);
CHECK(*foo_key == *bar_key);
@@ -223,8 +223,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
config.SetInfo("baz1", CreateFixedRepoInfo({{"dep", "bar"}}));
// check if computed key is same
- auto foo_key = config.RepositoryKey("foo");
- auto bar_key = config.RepositoryKey("bar");
+ auto foo_key = config.RepositoryKey(Storage::Instance(), "foo");
+ auto bar_key = config.RepositoryKey(Storage::Instance(), "bar");
REQUIRE(foo_key);
REQUIRE(bar_key);
CHECK(*foo_key == *bar_key);
@@ -239,10 +239,10 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
config.SetInfo("baz1", CreateFixedRepoInfo({{"dep", "baz1"}}));
// check if computed key is same
- auto foo_key = config.RepositoryKey("foo");
- auto bar_key = config.RepositoryKey("bar");
- auto baz0_key = config.RepositoryKey("baz0");
- auto baz1_key = config.RepositoryKey("baz1");
+ auto foo_key = config.RepositoryKey(Storage::Instance(), "foo");
+ auto bar_key = config.RepositoryKey(Storage::Instance(), "bar");
+ auto baz0_key = config.RepositoryKey(Storage::Instance(), "baz0");
+ auto baz1_key = config.RepositoryKey(Storage::Instance(), "baz1");
CHECK(foo_key);
CHECK(bar_key);
CHECK(baz0_key);