ctest-to

The ctest-to program can parse listfiles from a ctest output tree and generate a more structured representation of the test spec.

Usage

usage: ctest-to [-h] [--log-level {debug,info,warning,error}] [--json | --xml]
                [directory]

Parse ctest testfiles and re-emit the test specification in a more structured
format.

positional arguments:
  directory

optional arguments:
  -h, --help            show this help message and exit
  --log-level {debug,info,warning,error}
  --json
  --xml

Example

Here are some examples generated by the ctest file for this repository:

[
  {
    "name": "cmake_format-TestAddCustomCommand",
    "argv": [
      "python",
      "-Bm",
      "cmake_format.command_tests",
      "TestAddCustomCommand"
    ],
    "cwd": "/code/cmake_format/.build/nd.x86/cmake_format/command_tests",
    "props": {
      "working_directory": "/code/cmake_format"
    }
  },
  {
    "name": "cmake_format-TestAddCustomCommand_py3",
    "argv": [
      "python3",
      "-Bm",
      "cmake_format.command_tests",
      "TestAddCustomCommand"
    ],
    "cwd": "/code/cmake_format/.build/nd.x86/cmake_format/command_tests",
    "props": {
      "working_directory": "/code/cmake_format"
    }
  },
...
]
<ctest>
  <test cwd="/code/cmake_format/.build/nd.x86/cmake_format/command_tests" name="cmake_format-TestAddCustomCommand" working_directory="/code/cmake_format">
    <argv>
      <arg value="python"/>
      <arg value="-Bm"/>
      <arg value="cmake_format.command_tests"/>
      <arg value="TestAddCustomCommand"/>
    </argv>
  </test>
  <test cwd="/code/cmake_format/.build/nd.x86/cmake_format/command_tests" name="cmake_format-TestAddCustomCommand_py3" working_directory="/code/cmake_format">
    <argv>
      <arg value="python3"/>
      <arg value="-Bm"/>
      <arg value="cmake_format.command_tests"/>
      <arg value="TestAddCustomCommand"/>
    </argv>
  </test>
...
</ctest>