mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-09 01:01:12 +00:00
cmake: Store lowercase command names in profiling output
This ensures commands can be properly aggregated by tools processing the profiling output. Fixes: #20946
This commit is contained in:
@@ -58,7 +58,7 @@ void cmMakefileProfilingData::StartEntry(const cmListFileFunction& lff,
|
|||||||
cmsys::SystemInformation info;
|
cmsys::SystemInformation info;
|
||||||
Json::Value v;
|
Json::Value v;
|
||||||
v["ph"] = "B";
|
v["ph"] = "B";
|
||||||
v["name"] = lff.Name.Original;
|
v["name"] = lff.Name.Lower;
|
||||||
v["cat"] = "cmake";
|
v["cat"] = "cmake";
|
||||||
v["ts"] = Json::Value::UInt64(
|
v["ts"] = Json::Value::UInt64(
|
||||||
std::chrono::duration_cast<std::chrono::microseconds>(
|
std::chrono::duration_cast<std::chrono::microseconds>(
|
||||||
|
|||||||
@@ -16,3 +16,16 @@ if (NOT JSON_TRAILER MATCHES "^}]$")
|
|||||||
set(RunCMake_TEST_FAILED "Expected valid JSON end")
|
set(RunCMake_TEST_FAILED "Expected valid JSON end")
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
file(STRINGS ${ProfilingTestOutput} upperCaseCommand
|
||||||
|
REGEX [["name"[ ]*:[ ]*"__TESTING_COMMAND_CASE"]])
|
||||||
|
if (NOT "${upperCaseCommand}" STREQUAL "")
|
||||||
|
set(RunCMake_TEST_FAILED "Command name not stored in lowercase")
|
||||||
|
endif()
|
||||||
|
file(STRINGS ${ProfilingTestOutput} lowerCaseCommand
|
||||||
|
REGEX [["name"[ ]*:[ ]*"__testing_command_case"]])
|
||||||
|
list(LENGTH lowerCaseCommand numInvocations)
|
||||||
|
if (NOT numInvocations EQUAL 1)
|
||||||
|
set(RunCMake_TEST_FAILED
|
||||||
|
"Unexpected number of lowercase command names: ${numInvocations}")
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
# This file is intentionally left blank
|
function(__testing_command_case)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# This must not appear in the profiling output as uppercase
|
||||||
|
__TESTING_COMMAND_CASE()
|
||||||
|
|||||||
Reference in New Issue
Block a user