diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-24 11:31:42 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-27 15:03:20 +0100 |
commit | cf04253130030bc28866d10aa1f8fe1353643d42 (patch) | |
tree | ef7049624771866455105a8dab7b001840139701 /test/buildtool/common/repository_config.test.cpp | |
parent | bc09302c2772c979c45ecc716c36e4a70bb484ac (diff) | |
download | justbuild-cf04253130030bc28866d10aa1f8fe1353643d42.tar.gz |
Refactoring RepositoryConfig
With the introduction of 'just serve', export targets can now be
built also independently from one another based on their
corresponding minimal repository configuration, as stored in the
target cache key.
In this context, this commit changes the RepositoryConfig usage
from one global (static) instance to pointers passed as necessary
throughout the code.
Diffstat (limited to 'test/buildtool/common/repository_config.test.cpp')
-rw-r--r-- | test/buildtool/common/repository_config.test.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/buildtool/common/repository_config.test.cpp b/test/buildtool/common/repository_config.test.cpp index cfde95ed..6eaec044 100644 --- a/test/buildtool/common/repository_config.test.cpp +++ b/test/buildtool/common/repository_config.test.cpp @@ -104,8 +104,7 @@ template <class T> TEST_CASE_METHOD(HermeticLocalTestFixture, "Test missing repository", "[repository_config]") { - auto& config = RepositoryConfig::Instance(); - config.Reset(); + RepositoryConfig config{}; CHECK(config.Info("missing") == nullptr); CHECK_FALSE(config.RepositoryKey("missing")); @@ -114,8 +113,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "Compute key of fixed repository", "[repository_config]") { - auto& config = RepositoryConfig::Instance(); - config.Reset(); + RepositoryConfig config{}; SECTION("for single fixed repository") { config.SetInfo("foo", CreateFixedRepoInfo()); @@ -144,8 +142,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "Compute key of file repository", "[repository_config]") { - auto& config = RepositoryConfig::Instance(); - config.Reset(); + RepositoryConfig config{}; SECTION("for single file repository") { config.SetInfo("foo", CreateFileRepoInfo()); @@ -163,8 +160,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, TEST_CASE_METHOD(HermeticLocalTestFixture, "Compare key of two repos with same content", "[repository_config]") { - auto& config = RepositoryConfig::Instance(); - config.Reset(); + RepositoryConfig config{}; // create two different repo infos with same content (baz should be same) config.SetInfo("foo", CreateFixedRepoInfo({{"dep", "baz0"}})); |