Skip to content

Commit

Permalink
node: exclude snapshots tests in Windows build (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
canepat committed Jul 12, 2023
1 parent 6b7fc15 commit 9008037
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions silkworm/node/snapshot/index_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@

namespace silkworm::snapshot {

// Exclude tests from Windows build
#ifndef _WIN32

TEST_CASE("Index::Index", "[silkworm][snapshot][index]") {
test_util::SetLogVerbosityGuard guard{log::Level::kNone};
test::TemporarySnapshotFile tmp_snapshot_file{"v1-014500-015000-headers.seg"};
HeaderIndex header_index{*SnapshotPath::parse(tmp_snapshot_file.path().string())};
CHECK_THROWS_AS(header_index.build(), std::logic_error);
}

#ifndef _WIN32
// This unit test fails on Windows with error: SIGSEGV - Segmentation violation signal
TEST_CASE("BodyIndex::build OK", "[silkworm][snapshot][index]") {
test_util::SetLogVerbosityGuard guard{log::Level::kNone};
Expand All @@ -40,7 +42,6 @@ TEST_CASE("BodyIndex::build OK", "[silkworm][snapshot][index]") {
BodyIndex body_index{body_snapshot_path};
CHECK_NOTHROW(body_index.build());
}
#endif // _WIN32

TEST_CASE("TransactionIndex::build KO: empty snapshot", "[silkworm][snapshot][index]") {
test_util::SetLogVerbosityGuard guard{log::Level::kNone};
Expand Down Expand Up @@ -140,4 +141,6 @@ TEST_CASE("TransactionIndex::build OK", "[silkworm][snapshot][index]") {
CHECK_NOTHROW(tx_index.build());
}

#endif // _WIN32

} // namespace silkworm::snapshot
5 changes: 5 additions & 0 deletions silkworm/node/snapshot/repository_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

namespace silkworm::snapshot {

// Exclude tests from Windows build
#ifndef _WIN32

TEST_CASE("SnapshotRepository::SnapshotRepository", "[silkworm][node][snapshot]") {
test_util::SetLogVerbosityGuard guard{log::Level::kNone};
CHECK_NOTHROW(SnapshotRepository{SnapshotSettings{}});
Expand Down Expand Up @@ -201,4 +204,6 @@ TEST_CASE("SnapshotRepository::find_segment", "[silkworm][node][snapshot]") {
}
}

#endif // _WIN32

} // namespace silkworm::snapshot
5 changes: 5 additions & 0 deletions silkworm/node/snapshot/snapshot_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class Snapshot_ForTest : public Snapshot {
void close_index() override {}
};

// Exclude tests from Windows build
#ifndef _WIN32

TEST_CASE("Snapshot::Snapshot", "[silkworm][node][snapshot][snapshot]") {
SECTION("valid") {
std::vector<std::pair<BlockNum, BlockNum>> block_ranges{
Expand Down Expand Up @@ -174,4 +177,6 @@ TEST_CASE("TransactionSnapshot::txn_by_id OK", "[silkworm][node][snapshot][index
}
}

#endif // _WIN32

} // namespace silkworm::snapshot

0 comments on commit 9008037

Please sign in to comment.