mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
@@ -423,6 +423,10 @@ and contain the following data:
|
||||
contains information about the CMake configure and generate steps
|
||||
responsible for generating the ``command`` in this snippet.
|
||||
|
||||
``showOnly``
|
||||
A boolean representing whether the ``--show-only`` option was passed to
|
||||
``ctest``. Only included when ``role`` is ``ctest``.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
@@ -2672,7 +2672,10 @@ int cmCTest::ExecuteTests(std::vector<std::string> const& args)
|
||||
auto processHandler = [&handler]() -> int {
|
||||
return handler.ProcessHandler();
|
||||
};
|
||||
int ret = instrumentation.InstrumentCommand("ctest", args, processHandler);
|
||||
std::map<std::string, std::string> data;
|
||||
data["showOnly"] = this->GetShowOnly() ? "1" : "0";
|
||||
int ret =
|
||||
instrumentation.InstrumentCommand("ctest", args, processHandler, data);
|
||||
instrumentation.CollectTimingData(cmInstrumentationQuery::Hook::PostCTest);
|
||||
if (ret < 0) {
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Errors while running CTest\n");
|
||||
|
||||
@@ -663,6 +663,8 @@ int cmInstrumentation::InstrumentCommand(
|
||||
for (auto const& item : data.value()) {
|
||||
if (item.first == "role" && !item.second.empty()) {
|
||||
command_type = item.second;
|
||||
} else if (item.first == "showOnly") {
|
||||
root[item.first] = item.second == "1" ? true : false;
|
||||
} else if (!item.second.empty()) {
|
||||
root[item.first] = item.second;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ function(snippet_has_fields snippet contents)
|
||||
json_has_key("${snippet}" "${contents}" outputs)
|
||||
json_has_key("${snippet}" "${contents}" outputSizes)
|
||||
json_has_key("${snippet}" "${contents}" config)
|
||||
elseif (filename MATCHES "^ctest-*")
|
||||
json_has_key("${snippet}" "${contents}" showOnly)
|
||||
elseif (filename MATCHES "^test-*")
|
||||
json_has_key("${snippet}" "${contents}" testName)
|
||||
json_has_key("${snippet}" "${contents}" config)
|
||||
|
||||
Reference in New Issue
Block a user