summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_engine/dag/dag.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-11 14:55:08 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-12 15:43:37 +0200
commitec4fe905bccd666c72e51fe1d822e7a575da8b70 (patch)
treedc44ae8b1e311f9e474b12d5859ef21d7f238730 /test/buildtool/execution_engine/dag/dag.test.cpp
parent711f341fc50cc90906d294f7d027ff8555d92d57 (diff)
downloadjustbuild-ec4fe905bccd666c72e51fe1d822e7a575da8b70.tar.gz
ArtifactFactory: remove Identifier method
...since it is used in tests only. It also duplicated serialization-deserialization of ArtifactDescription.
Diffstat (limited to 'test/buildtool/execution_engine/dag/dag.test.cpp')
-rw-r--r--test/buildtool/execution_engine/dag/dag.test.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/buildtool/execution_engine/dag/dag.test.cpp b/test/buildtool/execution_engine/dag/dag.test.cpp
index cac4b791..ba5a122e 100644
--- a/test/buildtool/execution_engine/dag/dag.test.cpp
+++ b/test/buildtool/execution_engine/dag/dag.test.cpp
@@ -23,6 +23,7 @@
#include "gsl/gsl"
#include "src/buildtool/common/action.hpp"
#include "src/buildtool/common/action_description.hpp"
+#include "src/buildtool/common/artifact_description.hpp"
#include "src/buildtool/common/artifact_factory.hpp"
#include "src/buildtool/common/identifier.hpp"
#include "src/buildtool/execution_engine/dag/dag.hpp"
@@ -45,8 +46,8 @@ void CheckOutputNodesCorrectlyAdded(
std::vector<std::string> const& output_paths) {
std::vector<ArtifactIdentifier> output_ids;
for (auto const& path : output_paths) {
- auto const output_id = ArtifactFactory::Identifier(
- ArtifactFactory::DescribeActionArtifact(action_id, path));
+ auto const output_id =
+ ArtifactDescription::CreateAction(action_id, path).Id();
CHECK(g.ArtifactNodeWithId(output_id) != nullptr);
auto const* action = GetActionOfArtifact(g, output_id);
CHECK(action != nullptr);
@@ -158,12 +159,11 @@ TEST_CASE("AddAction({single action, single output, source file})", "[dag]") {
CheckLocalArtifactsCorrectlyAdded(g, {src_id}, {"main.cpp"});
// All artifacts are the source file and the executable
- CHECK_THAT(g.ArtifactIdentifiers(),
- HasSameUniqueElementsAs<std::unordered_set<ArtifactIdentifier>>(
- {src_id,
- ArtifactFactory::Identifier(
- ArtifactFactory::DescribeActionArtifact(
- action_id, "executable"))}));
+ CHECK_THAT(
+ g.ArtifactIdentifiers(),
+ HasSameUniqueElementsAs<std::unordered_set<ArtifactIdentifier>>(
+ {src_id,
+ ArtifactDescription::CreateAction(action_id, "executable").Id()}));
CHECK(IsValidGraph(g));
}
@@ -189,11 +189,10 @@ TEST_CASE("AddAction({single action, single output, no inputs, env_variables})",
CHECK(action_node->Env() == env_vars);
// All artifacts are the output file
- CHECK_THAT(g.ArtifactIdentifiers(),
- HasSameUniqueElementsAs<std::unordered_set<ArtifactIdentifier>>(
- {ArtifactFactory::Identifier(
- ArtifactFactory::DescribeActionArtifact(action_id,
- "greeting"))}));
+ CHECK_THAT(
+ g.ArtifactIdentifiers(),
+ HasSameUniqueElementsAs<std::unordered_set<ArtifactIdentifier>>(
+ {ArtifactDescription::CreateAction(action_id, "greeting").Id()}));
CHECK(IsValidGraph(g));
}