You can use the ctest command line options to find the exact line in your CMakeLists.txt hierarchy where the add_test() call was made. We can use the --show-only=json-v1 option to display JSON-formatted meta-data about a test:
ctest -R test_some_side_corner_item_XYZ --show-only=json-v1
An example of what this prints would be:
{
"backtraceGraph" :
{
"commands" :
[
"add_test"
],
"files" :
[
"C:/workspace/myproject/CMakeLists.txt"
],
"nodes" :
[
{
"file" : 0
},
{
"command" : 0,
"file" : 0,
"line" : 34,
"parent" : 0
}
]
},
...
This lists the CMakeLists.txt file where add_test() was called for this test, and the line number ("line" : 34) where it was called.
From the CMake documentation, the --show-only option will not actually run the test, but will only display its information:
-N,--show-only[=<format>]
Disable actual execution of tests.
This option tells CTest to list the tests that would be run but not actually run them. Useful in conjunction with the -R and -E options.
Note, the -R option is a regex to match the test(s) you want, so to get an exact match, you can anchor the test name with ^ and $:
ctest -R ^test_some_side_corner_item_XYZ$ --show-only=json-v1
track backyou mean like track back in time? So can't you justgrep -r test_some_side_corner_item_XYZyour project?that we can add macros on top of add_test()- so add a macro on top of add_test that logs all of it's uses. And then you'll see. - KamilCuk