diff options
| author | Stefan Boberg <[email protected]> | 2026-03-02 09:37:14 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-02 09:37:14 +0100 |
| commit | d604351cb5dc3032a7cb8c84d6ad5f1480325e5c (patch) | |
| tree | ecf3e5a0de3ae58e2f81988b72ae520a347d4433 /src/zenremotestore | |
| parent | added `--verbose` option to zenserver-test and `xmake test` (#798) (diff) | |
| download | zen-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/zenremotestore')
| -rw-r--r-- | src/zenremotestore/builds/buildmanifest.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/builds/buildsavedstate.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/builds/buildstorageoperations.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/chunking/chunkblock.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/chunking/chunkedcontent.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/chunking/chunkedfile.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/chunking/chunkingcache.cpp | 4 | ||||
| -rw-r--r-- | src/zenremotestore/filesystemutils.cpp | 4 |
8 files changed, 32 insertions, 0 deletions
diff --git a/src/zenremotestore/builds/buildmanifest.cpp b/src/zenremotestore/builds/buildmanifest.cpp index 051436e96..738e4b33b 100644 --- a/src/zenremotestore/builds/buildmanifest.cpp +++ b/src/zenremotestore/builds/buildmanifest.cpp @@ -97,6 +97,8 @@ ParseBuildManifest(const std::filesystem::path& ManifestPath) } #if ZEN_WITH_TESTS +TEST_SUITE_BEGIN("remotestore.buildmanifest"); + TEST_CASE("buildmanifest.unstructured") { ScopedTemporaryDirectory Root; @@ -163,6 +165,8 @@ TEST_CASE("buildmanifest.structured") CHECK_EQ(Manifest.Parts[1].Files[0].generic_string(), "baz.pdb"); } +TEST_SUITE_END(); + void buildmanifest_forcelink() { diff --git a/src/zenremotestore/builds/buildsavedstate.cpp b/src/zenremotestore/builds/buildsavedstate.cpp index 1d1f4605f..0685bf679 100644 --- a/src/zenremotestore/builds/buildsavedstate.cpp +++ b/src/zenremotestore/builds/buildsavedstate.cpp @@ -588,6 +588,8 @@ namespace buildsavestate_test { } } // namespace buildsavestate_test +TEST_SUITE_BEGIN("remotestore.buildsavedstate"); + TEST_CASE("buildsavestate.BuildsSelection") { using namespace buildsavestate_test; @@ -696,6 +698,8 @@ TEST_CASE("buildsavestate.DownloadedPaths") } } +TEST_SUITE_END(); + #endif // ZEN_WITH_TESTS } // namespace zen diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp index 08a896f37..5deb00707 100644 --- a/src/zenremotestore/builds/buildstorageoperations.cpp +++ b/src/zenremotestore/builds/buildstorageoperations.cpp @@ -7641,6 +7641,8 @@ namespace buildstorageoperations_testutils { } // namespace buildstorageoperations_testutils +TEST_SUITE_BEGIN("remotestore.buildstorageoperations"); + TEST_CASE("buildstorageoperations.upload.folder") { using namespace buildstorageoperations_testutils; @@ -7933,6 +7935,8 @@ TEST_CASE("buildstorageoperations.upload.multipart") } } +TEST_SUITE_END(); + void buildstorageoperations_forcelink() { diff --git a/src/zenremotestore/chunking/chunkblock.cpp b/src/zenremotestore/chunking/chunkblock.cpp index d203e0292..3a4e6011d 100644 --- a/src/zenremotestore/chunking/chunkblock.cpp +++ b/src/zenremotestore/chunking/chunkblock.cpp @@ -1047,6 +1047,8 @@ namespace testutils { } // namespace testutils +TEST_SUITE_BEGIN("remotestore.chunkblock"); + TEST_CASE("chunkblock.block") { using namespace std::literals; @@ -1315,6 +1317,8 @@ TEST_CASE("chunkblock.reuseblocks") } } +TEST_SUITE_END(); + void chunkblock_forcelink() { diff --git a/src/zenremotestore/chunking/chunkedcontent.cpp b/src/zenremotestore/chunking/chunkedcontent.cpp index 26d179f14..62c927508 100644 --- a/src/zenremotestore/chunking/chunkedcontent.cpp +++ b/src/zenremotestore/chunking/chunkedcontent.cpp @@ -1706,6 +1706,8 @@ namespace chunkedcontent_testutils { } // namespace chunkedcontent_testutils +TEST_SUITE_BEGIN("remotestore.chunkedcontent"); + TEST_CASE("chunkedcontent.DeletePathsFromContent") { FastRandom BaseRandom; @@ -1924,6 +1926,8 @@ TEST_CASE("chunkedcontent.ApplyChunkedContentOverlay") } } +TEST_SUITE_END(); + #endif // ZEN_WITH_TESTS } // namespace zen diff --git a/src/zenremotestore/chunking/chunkedfile.cpp b/src/zenremotestore/chunking/chunkedfile.cpp index 652110605..633ddfd0d 100644 --- a/src/zenremotestore/chunking/chunkedfile.cpp +++ b/src/zenremotestore/chunking/chunkedfile.cpp @@ -211,6 +211,8 @@ ZEN_THIRD_PARTY_INCLUDES_END namespace zen { # if 0 +TEST_SUITE_BEGIN("remotestore.chunkedfile"); + TEST_CASE("chunkedfile.findparams") { # if 1 @@ -513,6 +515,8 @@ TEST_CASE("chunkedfile.findparams") // WorkLatch.CountDown(); // WorkLatch.Wait(); } + +TEST_SUITE_END(); # endif // 0 void diff --git a/src/zenremotestore/chunking/chunkingcache.cpp b/src/zenremotestore/chunking/chunkingcache.cpp index 7f0a26330..f4e1c7837 100644 --- a/src/zenremotestore/chunking/chunkingcache.cpp +++ b/src/zenremotestore/chunking/chunkingcache.cpp @@ -461,6 +461,8 @@ namespace chunkingcache_testutils { } } // namespace chunkingcache_testutils +TEST_SUITE_BEGIN("remotestore.chunkingcache"); + TEST_CASE("chunkingcache.nullchunkingcache") { using namespace chunkingcache_testutils; @@ -617,6 +619,8 @@ TEST_CASE("chunkingcache.diskchunkingcache") } } +TEST_SUITE_END(); + void chunkingcache_forcelink() { diff --git a/src/zenremotestore/filesystemutils.cpp b/src/zenremotestore/filesystemutils.cpp index fa1ce6f78..fdb2143d8 100644 --- a/src/zenremotestore/filesystemutils.cpp +++ b/src/zenremotestore/filesystemutils.cpp @@ -637,6 +637,8 @@ namespace { void GenerateFile(const std::filesystem::path& Path) { BasicFile _(Path, BasicFile::Mode::kTruncate); } } // namespace +TEST_SUITE_BEGIN("remotestore.filesystemutils"); + TEST_CASE("filesystemutils.CleanDirectory") { ScopedTemporaryDirectory TmpDir; @@ -692,6 +694,8 @@ TEST_CASE("filesystemutils.CleanDirectory") CHECK(!IsFile(TmpDir.Path() / "CantDeleteMe2" / "deleteme")); } +TEST_SUITE_END(); + #endif } // namespace zen |