From cf04253130030bc28866d10aa1f8fe1353643d42 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 24 Nov 2023 11:31:42 +0100 Subject: 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. --- .../build_engine/base_maps/expression_map.test.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'test/buildtool/build_engine/base_maps/expression_map.test.cpp') diff --git a/test/buildtool/build_engine/base_maps/expression_map.test.cpp b/test/buildtool/build_engine/base_maps/expression_map.test.cpp index 89b73d33..392d81ba 100644 --- a/test/buildtool/build_engine/base_maps/expression_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/expression_map.test.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/expression_map.hpp" @@ -26,7 +27,7 @@ namespace { using namespace BuildMaps::Base; // NOLINT -void SetupConfig(bool use_git) { +auto SetupConfig(bool use_git) -> RepositoryConfig { auto root = FileRoot{kBasePath / "data_expr"}; if (use_git) { auto repo_path = CreateTestRepo(); @@ -35,17 +36,17 @@ void SetupConfig(bool use_git) { REQUIRE(git_root); root = std::move(*git_root); } - RepositoryConfig::Instance().Reset(); - RepositoryConfig::Instance().SetInfo( - "", RepositoryConfig::RepositoryInfo{root}); + RepositoryConfig repo_config{}; + repo_config.SetInfo("", RepositoryConfig::RepositoryInfo{root}); + return repo_config; } auto ReadExpressionFunction(EntityName const& id, ExpressionFunctionMap::Consumer value_checker, bool use_git = false) -> bool { - SetupConfig(use_git); - auto expr_file_map = CreateExpressionFileMap(0); - auto expr_func_map = CreateExpressionMap(&expr_file_map); + auto repo_config = SetupConfig(use_git); + auto expr_file_map = CreateExpressionFileMap(&repo_config, 0); + auto expr_func_map = CreateExpressionMap(&expr_file_map, &repo_config); bool success{true}; { -- cgit v1.2.3