aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-02 09:37:14 +0100
committerGitHub Enterprise <[email protected]>2026-03-02 09:37:14 +0100
commitd604351cb5dc3032a7cb8c84d6ad5f1480325e5c (patch)
treeecf3e5a0de3ae58e2f81988b72ae520a347d4433 /src/zenstore
parentadded `--verbose` option to zenserver-test and `xmake test` (#798) (diff)
downloadzen-d604351cb5dc3032a7cb8c84d6ad5f1480325e5c.tar.xz
zen-d604351cb5dc3032a7cb8c84d6ad5f1480325e5c.zip
Add test suites (#799)
Makes all test cases part of a test suite. Test suites are named after the module and the name of the file containing the implementation of the test. * This allows for better and more predictable filtering of which test cases to run which should also be able to reduce the time CI spends in tests since it can filter on the tests for that particular module. Also improves `xmake test` behaviour: * instead of an explicit list of projects just enumerate the test projects which are available based on build system state * also introduces logic to avoid running `xmake config` unnecessarily which would invalidate the existing build and do lots of unnecessary work since dependencies were invalidated by the updated config * also invokes build only for the chosen test targets As a bonus, also adds `xmake sln --open` which allows opening IDE after generation of solution/xmake project is done.
Diffstat (limited to 'src/zenstore')
-rw-r--r--src/zenstore/blockstore.cpp4
-rw-r--r--src/zenstore/buildstore/buildstore.cpp4
-rw-r--r--src/zenstore/cache/cachepolicy.cpp5
-rw-r--r--src/zenstore/cache/structuredcachestore.cpp4
-rw-r--r--src/zenstore/cas.cpp4
-rw-r--r--src/zenstore/compactcas.cpp4
-rw-r--r--src/zenstore/filecas.cpp4
-rw-r--r--src/zenstore/gc.cpp4
-rw-r--r--src/zenstore/projectstore.cpp4
-rw-r--r--src/zenstore/workspaces.cpp4
10 files changed, 41 insertions, 0 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp
index 3ea91ead6..6197c7f24 100644
--- a/src/zenstore/blockstore.cpp
+++ b/src/zenstore/blockstore.cpp
@@ -1556,6 +1556,8 @@ BlockStore::GetMetaData(uint32_t BlockIndex) const
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.blockstore");
+
TEST_CASE("blockstore.blockstoredisklocation")
{
BlockStoreLocation Zero = BlockStoreLocation{.BlockIndex = 0, .Offset = 0, .Size = 0};
@@ -2427,6 +2429,8 @@ TEST_CASE("blockstore.BlockStoreFileAppender")
}
}
+TEST_SUITE_END();
+
#endif
void
diff --git a/src/zenstore/buildstore/buildstore.cpp b/src/zenstore/buildstore/buildstore.cpp
index aa37e75fe..49ed7cdd2 100644
--- a/src/zenstore/buildstore/buildstore.cpp
+++ b/src/zenstore/buildstore/buildstore.cpp
@@ -1372,6 +1372,8 @@ BuildStore::LockState(GcCtx& Ctx)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.buildstore");
+
TEST_CASE("BuildStore.Blobs")
{
ScopedTemporaryDirectory _;
@@ -1821,6 +1823,8 @@ TEST_CASE("BuildStore.SizeLimit")
}
}
+TEST_SUITE_END();
+
void
buildstore_forcelink()
{
diff --git a/src/zenstore/cache/cachepolicy.cpp b/src/zenstore/cache/cachepolicy.cpp
index ca8a95ca1..ce6a14bd9 100644
--- a/src/zenstore/cache/cachepolicy.cpp
+++ b/src/zenstore/cache/cachepolicy.cpp
@@ -284,6 +284,9 @@ CacheRecordPolicyBuilder::Build()
}
#if ZEN_WITH_TESTS
+
+TEST_SUITE_BEGIN("store.cachepolicy");
+
TEST_CASE("cachepolicy")
{
SUBCASE("atomics serialization")
@@ -416,6 +419,8 @@ TEST_CASE("cacherecordpolicy")
CHECK(Loaded.IsNull());
}
}
+
+TEST_SUITE_END();
#endif
void
diff --git a/src/zenstore/cache/structuredcachestore.cpp b/src/zenstore/cache/structuredcachestore.cpp
index d8a5755c5..18023e2d6 100644
--- a/src/zenstore/cache/structuredcachestore.cpp
+++ b/src/zenstore/cache/structuredcachestore.cpp
@@ -1395,6 +1395,8 @@ namespace testutils {
} // namespace testutils
+TEST_SUITE_BEGIN("store.structuredcachestore");
+
TEST_CASE("cachestore.store")
{
ScopedTemporaryDirectory TempDir;
@@ -2744,6 +2746,8 @@ TEST_CASE("cachestore.newgc.basics")
}
}
+TEST_SUITE_END();
+
#endif
void
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index 7402d92d3..f80952322 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -512,6 +512,8 @@ CreateCasStore(GcManager& Gc)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.cas");
+
TEST_CASE("CasStore")
{
ScopedTemporaryDirectory TempDir;
@@ -553,6 +555,8 @@ TEST_CASE("CasStore")
CHECK(Lookup2);
}
+TEST_SUITE_END();
+
void
CAS_forcelink()
{
diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp
index 5d8f95c9e..21411df59 100644
--- a/src/zenstore/compactcas.cpp
+++ b/src/zenstore/compactcas.cpp
@@ -1348,6 +1348,8 @@ CasContainerStrategy::OpenContainer(bool IsNewStore)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.compactcas");
+
TEST_CASE("compactcas.hex")
{
uint32_t Value;
@@ -2159,6 +2161,8 @@ TEST_CASE("compactcas.iteratechunks")
}
}
+TEST_SUITE_END();
+
#endif
void
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp
index 31b3a68c4..295451818 100644
--- a/src/zenstore/filecas.cpp
+++ b/src/zenstore/filecas.cpp
@@ -1496,6 +1496,8 @@ FileCasStrategy::CreateReferencePruner(GcCtx& Ctx, GcReferenceStoreStats&)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.filecas");
+
TEST_CASE("cas.chunk.mismatch")
{
}
@@ -1793,6 +1795,8 @@ TEST_CASE("cas.file.move")
# endif
}
+TEST_SUITE_END();
+
#endif
void
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index c3bdc59f0..b3450b805 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -3049,6 +3049,8 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.gc");
+
TEST_CASE("gc.diskusagewindow")
{
DiskUsageWindow Stats;
@@ -3380,6 +3382,8 @@ TEST_CASE("gc.attachmentrange")
CHECK(AttachmentRangeMax == IoHash::Max);
}
+TEST_SUITE_END();
+
#endif
void
diff --git a/src/zenstore/projectstore.cpp b/src/zenstore/projectstore.cpp
index 1ab2b317a..217336eec 100644
--- a/src/zenstore/projectstore.cpp
+++ b/src/zenstore/projectstore.cpp
@@ -6802,6 +6802,8 @@ namespace testutils {
} // namespace testutils
+TEST_SUITE_BEGIN("store.projectstore");
+
TEST_CASE("project.opkeys")
{
using namespace std::literals;
@@ -8473,6 +8475,8 @@ TEST_CASE("project.store.iterateoplog")
}
}
+TEST_SUITE_END();
+
#endif
void
diff --git a/src/zenstore/workspaces.cpp b/src/zenstore/workspaces.cpp
index f0f975af4..df3cd31ef 100644
--- a/src/zenstore/workspaces.cpp
+++ b/src/zenstore/workspaces.cpp
@@ -1356,6 +1356,8 @@ namespace {
} // namespace
+TEST_SUITE_BEGIN("store.workspaces");
+
TEST_CASE("workspaces.scanfolder")
{
using namespace std::literals;
@@ -1559,6 +1561,8 @@ TEST_CASE("workspace.share.alias")
CHECK(!WS.GetShareAlias("my_share").has_value());
}
+TEST_SUITE_END();
+
#endif
void