From dc0de9685a851b52c2b80939c876e8edbab8eb1b Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 17 Jan 2024 21:21:45 -0700 Subject: [PATCH] Add isResultsFile query --- Tools/TestCases/ToolResults.h | 5 +++++ Tools/ToolSummary/ToolSummary.cpp | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tools/TestCases/ToolResults.h b/Tools/TestCases/ToolResults.h index e8972bb..ff7c44f 100644 --- a/Tools/TestCases/ToolResults.h +++ b/Tools/TestCases/ToolResults.h @@ -28,6 +28,11 @@ inline std::string toolNameFromResultsFile(std::filesystem::path path) return file.substr(0, pos); } +inline bool isResultsFile(std::filesystem::path path) +{ + return !toolNameFromResultsFile(path).empty(); +} + struct TestSummary { std::string name; diff --git a/Tools/ToolSummary/ToolSummary.cpp b/Tools/ToolSummary/ToolSummary.cpp index f6edbe4..f96c472 100644 --- a/Tools/ToolSummary/ToolSummary.cpp +++ b/Tools/ToolSummary/ToolSummary.cpp @@ -33,9 +33,7 @@ void scanResultsDirectory(std::filesystem::path dir) { continue; } - - const std::string toolName = testCases::toolNameFromResultsFile(entry.path()); - if (toolName.empty()) + if (!testCases::isResultsFile(entry)) { continue; }