diff options
| author | Dan Engelbrecht <[email protected]> | 2025-10-06 10:18:49 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-06 10:18:49 +0200 |
| commit | d5b2a263e6d4c893c6ec3fb99b36110630da6529 (patch) | |
| tree | 35bfa4c23c838fdbebd07100db2ebf2404977b3f /src/zencore/filesystem.cpp | |
| parent | fix link error with operator new (#553) (diff) | |
| download | zen-d5b2a263e6d4c893c6ec3fb99b36110630da6529.tar.xz zen-d5b2a263e6d4c893c6ec3fb99b36110630da6529.zip | |
speed up tests (#555)
* faster FileSystemTraversal test
* faster jobqueue test
* faster NamedEvent test
* faster cache tests
* faster basic http tests
* faster blockstore test
* faster cache store tests
* faster compactcas tests
* more responsive zenserver launch
* tweak worker pool sizes in tests
Diffstat (limited to 'src/zencore/filesystem.cpp')
| -rw-r--r-- | src/zencore/filesystem.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index 8e6f5085f..d18f21dbe 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -3112,15 +3112,22 @@ TEST_CASE("filesystem") { virtual void VisitFile(const std::filesystem::path& Parent, const path_view& File, uint64_t, uint32_t, uint64_t) override { - bFoundExpected |= std::filesystem::equivalent(Parent / File, Expected); + // std::filesystem::equivalent is *very* expensive on Windows, filter out unlikely candidates + if (ExpectedFilename == ToLower(std::filesystem::path(File).string())) + { + bFoundExpected |= std::filesystem::equivalent(Parent / File, Expected); + } } virtual bool VisitDirectory(const std::filesystem::path&, const path_view&, uint32_t) override { return true; } - bool bFoundExpected = false; + bool bFoundExpected = false; + + std::string ExpectedFilename; std::filesystem::path Expected; } Visitor; - Visitor.Expected = BinPath; + Visitor.ExpectedFilename = ToLower(BinPath.filename().string()); + Visitor.Expected = BinPath; FileSystemTraversal().TraverseFileSystem(BinPath.parent_path().parent_path(), Visitor); CHECK(Visitor.bFoundExpected); |