Browse Source

Merge topic 'instrumentation-rename-hooks'

7c13444fb5 Experimental: Update the Instrumentation UUID
fbb5b47fbf instrumentation: Rename postTest and postInstall hooks

Acked-by: Kitware Robot <[email protected]>
Merge-request: !11148
Brad King 2 months ago
parent
commit
58bde95a0a

+ 4 - 4
Help/dev/experimental.rst

@@ -127,15 +127,15 @@ In order to activate support for the :command:`cmake_instrumentation` command,
 set
 
 * variable ``CMAKE_EXPERIMENTAL_INSTRUMENTATION`` to
-* value ``f4f3d5ea-0915-470f-9628-4615e72f738a``.
+* value ``2555e60c-9119-46fb-af73-8c54e9b6b326``.
 
 To enable instrumentation at the user-level, files should be placed under
 either
-``<CMAKE_CONFIG_DIR>/instrumentation-f4f3d5ea-0915-470f-9628-4615e72f738a`` or
-``<CMAKE_BINARY_DIR>/.cmake/instrumentation-f4f3d5ea-0915-470f-9628-4615e72f738a``.
+``<CMAKE_CONFIG_DIR>/instrumentation-2555e60c-9119-46fb-af73-8c54e9b6b326`` or
+``<CMAKE_BINARY_DIR>/.cmake/instrumentation-2555e60c-9119-46fb-af73-8c54e9b6b326``.
 
 To include instrumentation data in CTest XML files (for submission to CDash),
 you need to set the following environment variables:
 
 * ``CTEST_USE_INSTRUMENTATION=1``
-* ``CTEST_EXPERIMENTAL_INSTRUMENTATION=f4f3d5ea-0915-470f-9628-4615e72f738a``
+* ``CTEST_EXPERIMENTAL_INSTRUMENTATION=2555e60c-9119-46fb-af73-8c54e9b6b326``

+ 3 - 3
Help/manual/cmake-instrumentation.7.rst

@@ -203,8 +203,8 @@ key is required, but all other fields are optional.
   * ``postBuild`` (called when ``ninja`` or ``make`` completes)
   * ``preCMakeBuild`` (called when ``cmake --build`` is invoked)
   * ``postCMakeBuild`` (called when ``cmake --build`` completes)
-  * ``postInstall``
-  * ``postTest``
+  * ``postCMakeInstall``
+  * ``postCTest``
 
   ``preBuild`` and ``postBuild`` are not supported when using the
   :generator:`MSYS Makefiles` or :generator:`FASTBuild` generators.
@@ -264,7 +264,7 @@ Example:
     ],
     "hooks": [
       "postCMakeBuild",
-      "postInstall"
+      "postCMakeInstall"
     ],
     "options": [
       "staticSystemInformation",

+ 1 - 1
Source/cmCTest.cxx

@@ -2673,7 +2673,7 @@ int cmCTest::ExecuteTests(std::vector<std::string> const& args)
     return handler.ProcessHandler();
   };
   int ret = instrumentation.InstrumentCommand("ctest", args, processHandler);
-  instrumentation.CollectTimingData(cmInstrumentationQuery::Hook::PostTest);
+  instrumentation.CollectTimingData(cmInstrumentationQuery::Hook::PostCTest);
   if (ret < 0) {
     cmCTestLog(this, ERROR_MESSAGE, "Errors while running CTest\n");
     if (!this->Impl->OutputTestOutputOnTestFailure) {

+ 1 - 1
Source/cmExperimental.cxx

@@ -65,7 +65,7 @@ cmExperimental::FeatureData const LookupTable[] = {
     cmExperimental::TryCompileCondition::Never },
   // Instrumentation
   { "Instrumentation",
-    "f4f3d5ea-0915-470f-9628-4615e72f738a",
+    "2555e60c-9119-46fb-af73-8c54e9b6b326",
     "CMAKE_EXPERIMENTAL_INSTRUMENTATION",
     "CMake's support for collecting instrumentation data is experimental. It "
     "is meant only for experimentation and feedback to CMake developers.",

+ 3 - 3
Source/cmInstrumentationQuery.cxx

@@ -20,9 +20,9 @@ std::vector<std::string> const cmInstrumentationQuery::OptionString{
   "cdashVerbose", "trace"
 };
 std::vector<std::string> const cmInstrumentationQuery::HookString{
-  "postGenerate",  "preBuild",        "postBuild",
-  "preCMakeBuild", "postCMakeBuild",  "postTest",
-  "postInstall",   "prepareForCDash", "manual"
+  "postGenerate",     "preBuild",        "postBuild",
+  "preCMakeBuild",    "postCMakeBuild",  "postCTest",
+  "postCMakeInstall", "prepareForCDash", "manual"
 };
 
 namespace ErrorMessages {

+ 2 - 2
Source/cmInstrumentationQuery.h

@@ -29,8 +29,8 @@ public:
     PostBuild,
     PreCMakeBuild,
     PostCMakeBuild,
-    PostTest,
-    PostInstall,
+    PostCTest,
+    PostCMakeInstall,
     PrepareForCDash,
     Manual
   };

+ 2 - 1
Source/cmakemain.cxx

@@ -989,7 +989,8 @@ int do_install(int ac, char const* const* av)
   cm::append(cmd, av, av + ac);
   ret = instrumentation.InstrumentCommand(
     "cmakeInstall", cmd, [doInstall]() { return doInstall(); });
-  instrumentation.CollectTimingData(cmInstrumentationQuery::Hook::PostInstall);
+  instrumentation.CollectTimingData(
+    cmInstrumentationQuery::Hook::PostCMakeInstall);
   return ret;
 #endif
 }

+ 1 - 1
Tests/RunCMake/ConfigDir/check-reply.cmake

@@ -1,6 +1,6 @@
 if (NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply)
   set(RunCMake_TEST_FAILED "Failed to read FileAPI query from user config directory")
 endif()
-if (NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/.cmake/instrumentation-f4f3d5ea-0915-470f-9628-4615e72f738a/v1/data)
+if (NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/.cmake/instrumentation-2555e60c-9119-46fb-af73-8c54e9b6b326/v1/data)
   set(RunCMake_TEST_FAILED "Failed to read Instrumentation query from user config directory")
 endif()

+ 0 - 0
Tests/RunCMake/ConfigDir/config/instrumentation-f4f3d5ea-0915-470f-9628-4615e72f738a/v1/query/query.json → Tests/RunCMake/ConfigDir/config/instrumentation-2555e60c-9119-46fb-af73-8c54e9b6b326/v1/query/query.json


+ 1 - 1
Tests/RunCMake/Instrumentation/RunCMakeTest.cmake

@@ -23,7 +23,7 @@ function(instrument test)
   )
   cmake_parse_arguments(ARGS "${OPTIONS}" "CHECK_SCRIPT;CONFIGURE_ARG" "" ${ARGN})
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test})
-  set(uuid "f4f3d5ea-0915-470f-9628-4615e72f738a")
+  set(uuid "2555e60c-9119-46fb-af73-8c54e9b6b326")
   set(v1 ${RunCMake_TEST_BINARY_DIR}/.cmake/instrumentation-${uuid}/v1)
   set(query_dir ${CMAKE_CURRENT_LIST_DIR}/query)
 

+ 1 - 1
Tests/RunCMake/Instrumentation/bad-hook-stderr.txt

@@ -1,5 +1,5 @@
 ^CMake Error: Could not load instrumentation queries from [^
 ]+:
 bad-hook.json:3: Not a valid hook: "bad hook"
-  "hooks": \["bad hook", "postGenerate", "preCMakeBuild", "postCMakeBuild", "postInstall"\]
+  "hooks": \["bad hook", "postGenerate", "preCMakeBuild", "postCMakeBuild", "postCMakeInstall"\]
             \^$

+ 1 - 1
Tests/RunCMake/Instrumentation/hooks-1-install-stdout.txt

@@ -1 +1 @@
-.*\-\- postInstall$
+.*\-\- postCMakeInstall$

+ 1 - 1
Tests/RunCMake/Instrumentation/hooks-2-test-stdout.txt

@@ -1 +1 @@
-.*\-\- postTest$
+.*\-\- postCTest$

+ 1 - 1
Tests/RunCMake/Instrumentation/project/CMakeLists.txt

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.30)
 project(instrumentation)
 enable_testing()
 if (EXISTS ${INSTRUMENT_COMMAND_FILE})
-  set(CMAKE_EXPERIMENTAL_INSTRUMENTATION "f4f3d5ea-0915-470f-9628-4615e72f738a")
+  set(CMAKE_EXPERIMENTAL_INSTRUMENTATION "2555e60c-9119-46fb-af73-8c54e9b6b326")
   include(${INSTRUMENT_COMMAND_FILE})
 endif()
 

+ 1 - 1
Tests/RunCMake/Instrumentation/query/bad-hook.json.in

@@ -1,4 +1,4 @@
 {
   "version": 1,
-  "hooks": ["bad hook", "postGenerate", "preCMakeBuild", "postCMakeBuild", "postInstall"]
+  "hooks": ["bad hook", "postGenerate", "preCMakeBuild", "postCMakeBuild", "postCMakeInstall"]
 }

+ 1 - 1
Tests/RunCMake/Instrumentation/query/cmake-command-trace.cmake

@@ -3,6 +3,6 @@ cmake_instrumentation(
   API_VERSION 1
   DATA_VERSION 1
   OPTIONS trace
-  HOOKS postBuild postInstall postTest
+  HOOKS postBuild postCMakeInstall postCTest
   CALLBACK ${CMAKE_COMMAND} -P ${hook_path} 0 1
 )

+ 1 - 1
Tests/RunCMake/Instrumentation/query/hooks-1.json.in

@@ -1,6 +1,6 @@
 {
   "version": 1,
-  "hooks": ["preCMakeBuild", "postInstall"],
+  "hooks": ["preCMakeBuild", "postCMakeInstall"],
   "callbacks": ["@GET_HOOK@"],
   "options": ["staticSystemInformation"]
 }

+ 1 - 1
Tests/RunCMake/Instrumentation/query/hooks-2.json.in

@@ -1,5 +1,5 @@
 {
   "version": 1,
-  "hooks": ["postGenerate", "postCMakeBuild", "postTest"],
+  "hooks": ["postGenerate", "postCMakeBuild", "postCTest"],
   "callbacks": ["@GET_HOOK@"]
 }

+ 1 - 1
Tests/RunCMake/ctest_instrumentation/CMakeLists.txt.in

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
 @CASE_CMAKELISTS_PREFIX_CODE@
 project(CTestInstrumentation@CASE_NAME@)
 if(USE_INSTRUMENTATION)
-  set(CMAKE_EXPERIMENTAL_INSTRUMENTATION "f4f3d5ea-0915-470f-9628-4615e72f738a")
+  set(CMAKE_EXPERIMENTAL_INSTRUMENTATION "2555e60c-9119-46fb-af73-8c54e9b6b326")
 endif()
 include(CTest)
 add_executable(main main.c)

+ 1 - 1
Tests/RunCMake/ctest_instrumentation/InstrumentationInCTestXML-check.cmake

@@ -1,4 +1,4 @@
-set(timingDir "${RunCMake_TEST_BINARY_DIR}/.cmake/instrumentation-f4f3d5ea-0915-470f-9628-4615e72f738a/v1")
+set(timingDir "${RunCMake_TEST_BINARY_DIR}/.cmake/instrumentation-2555e60c-9119-46fb-af73-8c54e9b6b326/v1")
 file(READ "${timingDir}/query/generated/query-0.json" jsonData)
 string(JSON options GET "${jsonData}" options)
 if (options MATCHES cdashVerbose AND NOT ${RunCMake_USE_VERBOSE_INSTRUMENTATION})

+ 1 - 1
Tests/RunCMake/ctest_instrumentation/RunCMakeTest.cmake

@@ -10,7 +10,7 @@ function(run_InstrumentationInCTestXML CASE_NAME)
     set(RunCMake_USE_VERBOSE_INSTRUMENTATION FALSE)
   endif()
   if(ARGS_USE_INSTRUMENTATION_ENV_VARS)
-    set(ENV{CTEST_EXPERIMENTAL_INSTRUMENTATION} "f4f3d5ea-0915-470f-9628-4615e72f738a")
+    set(ENV{CTEST_EXPERIMENTAL_INSTRUMENTATION} "2555e60c-9119-46fb-af73-8c54e9b6b326")
     set(ENV{CTEST_USE_INSTRUMENTATION} "1")
     set(RunCMake_USE_INSTRUMENTATION TRUE)
   else()

+ 1 - 1
Tests/RunCMake/ctest_labels_for_subprojects/RunCMakeTest.cmake

@@ -38,7 +38,7 @@ file(COPY "${CTEST_RUNCMAKE_SOURCE_DIRECTORY}/MyThirdPartyDependency"
   if(USE_INSTRUMENTATION)
     set(CASE_CMAKELISTS_SUFFIX_CODE [[
   add_subdirectory(MyThirdPartyDependency)
-  set(CMAKE_EXPERIMENTAL_INSTRUMENTATION "f4f3d5ea-0915-470f-9628-4615e72f738a")
+  set(CMAKE_EXPERIMENTAL_INSTRUMENTATION "2555e60c-9119-46fb-af73-8c54e9b6b326")
   cmake_instrumentation(DATA_VERSION 1 API_VERSION 1)
     ]])
     set(RunCMake-check-file CTestScriptVariableCommandLine-check.cmake)