summaryrefslogtreecommitdiff
path: root/test/buildtool/build_engine
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-16 10:17:38 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-16 14:49:38 +0200
commit9f5e7e5dbb9370273dda5d8b246abe4878a6d285 (patch)
tree21aeff5bc1f9adda5180501919cf6c3213e2e985 /test/buildtool/build_engine
parent7877411f13cd7517b1521a67142c9b597a09f0db (diff)
downloadjustbuild-9f5e7e5dbb9370273dda5d8b246abe4878a6d285.tar.gz
Check compatibility in the test of source_map
Diffstat (limited to 'test/buildtool/build_engine')
-rw-r--r--test/buildtool/build_engine/base_maps/source_map.test.cpp8
-rw-r--r--test/buildtool/build_engine/base_maps/test_repo.hpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/test/buildtool/build_engine/base_maps/source_map.test.cpp b/test/buildtool/build_engine/base_maps/source_map.test.cpp
index 4096e505..36a58895 100644
--- a/test/buildtool/build_engine/base_maps/source_map.test.cpp
+++ b/test/buildtool/build_engine/base_maps/source_map.test.cpp
@@ -102,7 +102,7 @@ TEST_CASE("from file") {
CHECK(ReadSourceTarget(name, consumer, /*use_git=*/true));
CHECK(artifacts["file"]["type"] == "KNOWN");
CHECK(artifacts["file"]["data"]["id"] ==
- "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391");
+ (Compatibility::IsCompatible() ? kEmptySha256 : kEmptySha1));
CHECK(artifacts["file"]["data"]["size"] == 0);
}
}
@@ -168,7 +168,7 @@ TEST_CASE("subdir file") {
CHECK(ReadSourceTarget(name, consumer, /*use_git=*/true));
CHECK(artifacts["bar/file"]["type"] == "KNOWN");
CHECK(artifacts["bar/file"]["data"]["id"] ==
- "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391");
+ (Compatibility::IsCompatible() ? kEmptySha256 : kEmptySha1));
CHECK(artifacts["bar/file"]["data"]["size"] == 0);
}
}
@@ -189,7 +189,9 @@ TEST_CASE("subdir symlink") {
SECTION("via git tree") {
CHECK(ReadSourceTarget(name, consumer, /*use_git=*/true));
CHECK(artifacts["link"]["type"] == "KNOWN");
- CHECK(artifacts["link"]["data"]["id"] == kSrcLinkId);
+ CHECK(artifacts["link"]["data"]["id"] == (Compatibility::IsCompatible()
+ ? kSrcLinkIdSha256
+ : kSrcLinkIdSha1));
CHECK(artifacts["link"]["data"]["size"] == 5); // content: dummy
}
}
diff --git a/test/buildtool/build_engine/base_maps/test_repo.hpp b/test/buildtool/build_engine/base_maps/test_repo.hpp
index 7190f081..08acbdab 100644
--- a/test/buildtool/build_engine/base_maps/test_repo.hpp
+++ b/test/buildtool/build_engine/base_maps/test_repo.hpp
@@ -30,14 +30,20 @@ static auto const kBasePath =
static auto const kBundlePath = kBasePath / "data/test_repo.bundle";
static auto const kSrcTreeId =
std::string{"6d57ba31821f69286e280334e4fd5f9dbd141721"};
-static auto const kSrcLinkId =
+static auto const kSrcLinkIdSha1 =
std::string{"2995a4d0e74917fd3e1383c577d0fc301fff1b04"};
+static auto const kSrcLinkIdSha256 = std::string{
+ "b5a2c96250612366ea272ffac6d9744aaf4b45aacd96aa7cfcb931ee3b558259"};
static auto const kRuleTreeId =
std::string{"c6dd902c9d4e7afa8b20eb04e58503e63ecab84d"};
static auto const kExprTreeId =
std::string{"4946bd21d0a5b3e0c82d6944f3d47adaf1bb66f7"};
static auto const kJsonTreeId =
std::string{"6982563dfc4dcdd1362792dbbc9d8243968d1ec9"};
+static auto const kEmptySha1 =
+ std::string{"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"};
+static auto const kEmptySha256 = std::string{
+ "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"};
[[nodiscard]] static inline auto GetTestDir() -> std::filesystem::path {
auto* tmp_dir = std::getenv("TEST_TMPDIR");