summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-22 17:35:17 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-22 19:07:46 +0100
commitd58620bcf328a500b964fd9190f712c96d6a136e (patch)
tree46347f268ef86fc9955982d5f9d15cf8959fa314 /test
parente555d27ccfdddcec9bee97263a2fea265ee0d0aa (diff)
downloadjustbuild-d58620bcf328a500b964fd9190f712c96d6a136e.tar.gz
Absent target: deduplicate serve calls asking for flexible variables
For an absent export target, the first step of analysis is to ask serve for the flexible variables. The answer to this request is, however, independent of the configuration for this target. So we can avoid calls by caching the answer in an additional map.
Diffstat (limited to 'test')
-rw-r--r--test/buildtool/build_engine/target_map/target_map.test.cpp88
1 files changed, 72 insertions, 16 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 47d68894..b7a3a1e7 100644
--- a/test/buildtool/build_engine/target_map/target_map.test.cpp
+++ b/test/buildtool/build_engine/target_map/target_map.test.cpp
@@ -86,8 +86,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "simple targets", "[target_map]") {
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -439,8 +446,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -515,8 +529,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -601,8 +622,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "built-in rules", "[target_map]") {
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -797,8 +825,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "target reference", "[target_map]") {
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -926,8 +961,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "trees", "[target_map]") {
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -1021,8 +1063,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,
@@ -1173,8 +1222,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, "wrong arguments", "[target_map]") {
BuildMaps::Target::ResultTargetMap result_map{0};
Statistics stats{};
Progress exports_progress{};
- auto absent_target_map = BuildMaps::Target::CreateAbsentTargetMap(
- &result_map, &repo_config, &stats, &exports_progress, 0);
+ auto absent_target_variables_map =
+ BuildMaps::Target::CreateAbsentTargetVariablesMap(0);
+ auto absent_target_map =
+ BuildMaps::Target::CreateAbsentTargetMap(&result_map,
+ &absent_target_variables_map,
+ &repo_config,
+ &stats,
+ &exports_progress,
+ 0);
auto target_map =
BuildMaps::Target::CreateTargetMap(&source,
&targets_file_map,