summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_engine/executor/executor.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-09-12 14:28:13 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-09-13 14:41:00 +0200
commit5fb67de531fead44123ff30ee5cf37340fc63a0b (patch)
tree0e1c7c8810e8ee311467e5e07ebb8ff2902adf28 /test/buildtool/execution_engine/executor/executor.test.cpp
parentdd15af0ba4b22348e38d535aadc9fa5e929f3824 (diff)
downloadjustbuild-5fb67de531fead44123ff30ee5cf37340fc63a0b.tar.gz
Use TestHashType in tests
...instead of calling ProtocolTraits::IsCompatible
Diffstat (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp')
-rw-r--r--test/buildtool/execution_engine/executor/executor.test.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp
index d0533f9c..48bcf082 100644
--- a/test/buildtool/execution_engine/executor/executor.test.cpp
+++ b/test/buildtool/execution_engine/executor/executor.test.cpp
@@ -29,7 +29,6 @@
#include "src/buildtool/common/artifact_description.hpp"
#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/common/artifact_digest_factory.hpp"
-#include "src/buildtool/common/protocol_traits.hpp"
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/common/statistics.hpp"
#include "src/buildtool/crypto/hash_function.hpp"
@@ -40,6 +39,7 @@
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/progress_reporting/progress.hpp"
#include "test/utils/executor/test_api_bundle.hpp"
+#include "test/utils/hermeticity/test_hash_function_type.hpp"
/// \brief Mockup API test config.
struct TestApiConfig {
@@ -64,9 +64,7 @@ struct TestApiConfig {
};
static auto NamedDigest(std::string const& str) -> ArtifactDigest {
- HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible()
- ? HashFunction::Type::PlainSHA256
- : HashFunction::Type::GitSHA1};
+ HashFunction const hash_function{TestHashType::ReadFromEnvironment()};
return ArtifactDigestFactory::HashDataAs<ObjectType::File>(hash_function,
str);
}
@@ -305,9 +303,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") {
DependencyGraph g;
auto [config, repo_config] = CreateTest(&g, workspace_path);
- HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible()
- ? HashFunction::Type::PlainSHA256
- : HashFunction::Type::GitSHA1};
+ HashFunction const hash_function{TestHashType::ReadFromEnvironment()};
auto const local_cpp_id =
ArtifactDescription::CreateLocal("local.cpp", "").Id();
@@ -383,9 +379,7 @@ TEST_CASE("Executor: Process action", "[executor]") {
DependencyGraph g;
auto [config, repo_config] = CreateTest(&g, workspace_path);
- HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible()
- ? HashFunction::Type::PlainSHA256
- : HashFunction::Type::GitSHA1};
+ HashFunction const hash_function{TestHashType::ReadFromEnvironment()};
auto const local_cpp_id =
ArtifactDescription::CreateLocal("local.cpp", "").Id();