ctest.1.rst 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272
  1. .. cmake-manual-description: CTest Command-Line Reference
  2. ctest(1)
  3. ********
  4. .. contents::
  5. Synopsis
  6. ========
  7. .. parsed-literal::
  8. ctest [<options>]
  9. ctest --build-and-test <path-to-source> <path-to-build>
  10. --build-generator <generator> [<options>...]
  11. [--build-options <opts>...] [--test-command <command> [<args>...]]
  12. ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
  13. [-- <dashboard-options>...]
  14. Description
  15. ===========
  16. The **ctest** executable is the CMake test driver program.
  17. CMake-generated build trees created for projects that use the
  18. :command:`enable_testing` and :command:`add_test` commands have testing support.
  19. This program will run the tests and report results.
  20. Options
  21. =======
  22. ``-C <cfg>, --build-config <cfg>``
  23. Choose configuration to test.
  24. Some CMake-generated build trees can have multiple build
  25. configurations in the same tree. This option can be used to specify
  26. which one should be tested. Example configurations are ``Debug`` and
  27. ``Release``.
  28. ``--progress``
  29. Enable short progress output from tests.
  30. When the output of **ctest** is being sent directly to a terminal, the
  31. progress through the set of tests is reported by updating the same line
  32. rather than printing start and end messages for each test on new lines.
  33. This can significantly reduce the verbosity of the test output.
  34. Test completion messages are still output on their own line for failed
  35. tests and the final test summary will also still be logged.
  36. This option can also be enabled by setting the environment variable
  37. :envvar:`CTEST_PROGRESS_OUTPUT`.
  38. ``-V,--verbose``
  39. Enable verbose output from tests.
  40. Test output is normally suppressed and only summary information is
  41. displayed. This option will show all test output.
  42. ``-VV,--extra-verbose``
  43. Enable more verbose output from tests.
  44. Test output is normally suppressed and only summary information is
  45. displayed. This option will show even more test output.
  46. ``--debug``
  47. Displaying more verbose internals of CTest.
  48. This feature will result in a large number of output that is mostly
  49. useful for debugging dashboard problems.
  50. ``--output-on-failure``
  51. Output anything outputted by the test program if the test should fail.
  52. This option can also be enabled by setting the
  53. :envvar:`CTEST_OUTPUT_ON_FAILURE` environment variable
  54. ``-F``
  55. Enable failover.
  56. This option allows CTest to resume a test set execution that was
  57. previously interrupted. If no interruption occurred, the ``-F`` option
  58. will have no effect.
  59. ``-j <jobs>, --parallel <jobs>``
  60. Run the tests in parallel using the given number of jobs.
  61. This option tells CTest to run the tests in parallel using given
  62. number of jobs. This option can also be set by setting the
  63. :envvar:`CTEST_PARALLEL_LEVEL` environment variable.
  64. This option can be used with the :prop_test:`PROCESSORS` test property.
  65. See `Label and Subproject Summary`_.
  66. ``--test-load <level>``
  67. While running tests in parallel (e.g. with ``-j``), try not to start
  68. tests when they may cause the CPU load to pass above a given threshold.
  69. When ``ctest`` is run as a `Dashboard Client`_ this sets the
  70. ``TestLoad`` option of the `CTest Test Step`_.
  71. ``-Q,--quiet``
  72. Make CTest quiet.
  73. This option will suppress all the output. The output log file will
  74. still be generated if the ``--output-log`` is specified. Options such
  75. as ``--verbose``, ``--extra-verbose``, and ``--debug`` are ignored
  76. if ``--quiet`` is specified.
  77. ``-O <file>, --output-log <file>``
  78. Output to log file.
  79. This option tells CTest to write all its output to a ``<file>`` log file.
  80. ``-N,--show-only[=<format>]``
  81. Disable actual execution of tests.
  82. This option tells CTest to list the tests that would be run but not
  83. actually run them. Useful in conjunction with the ``-R`` and ``-E``
  84. options.
  85. ``<format>`` can be one of the following values.
  86. ``human``
  87. Human-friendly output. This is not guaranteed to be stable.
  88. This is the default.
  89. ``json-v1``
  90. Dump the test information in JSON format.
  91. See `Show as JSON Object Model`_.
  92. ``-L <regex>, --label-regex <regex>``
  93. Run tests with labels matching regular expression.
  94. This option tells CTest to run only the tests whose labels match the
  95. given regular expression.
  96. ``-R <regex>, --tests-regex <regex>``
  97. Run tests matching regular expression.
  98. This option tells CTest to run only the tests whose names match the
  99. given regular expression.
  100. ``-E <regex>, --exclude-regex <regex>``
  101. Exclude tests matching regular expression.
  102. This option tells CTest to NOT run the tests whose names match the
  103. given regular expression.
  104. ``-LE <regex>, --label-exclude <regex>``
  105. Exclude tests with labels matching regular expression.
  106. This option tells CTest to NOT run the tests whose labels match the
  107. given regular expression.
  108. ``-FA <regex>, --fixture-exclude-any <regex>``
  109. Exclude fixtures matching ``<regex>`` from automatically adding any tests to
  110. the test set.
  111. If a test in the set of tests to be executed requires a particular fixture,
  112. that fixture's setup and cleanup tests would normally be added to the test set
  113. automatically. This option prevents adding setup or cleanup tests for fixtures
  114. matching the ``<regex>``. Note that all other fixture behavior is retained,
  115. including test dependencies and skipping tests that have fixture setup tests
  116. that fail.
  117. ``-FS <regex>, --fixture-exclude-setup <regex>``
  118. Same as ``-FA`` except only matching setup tests are excluded.
  119. ``-FC <regex>, --fixture-exclude-cleanup <regex>``
  120. Same as ``-FA`` except only matching cleanup tests are excluded.
  121. ``-D <dashboard>, --dashboard <dashboard>``
  122. Execute dashboard test.
  123. This option tells CTest to act as a CDash client and perform a
  124. dashboard test. All tests are ``<Mode><Test>``, where ``<Mode>`` can be
  125. ``Experimental``, ``Nightly``, and ``Continuous``, and ``<Test>`` can be
  126. ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  127. ``Coverage``, and ``Submit``.
  128. See `Dashboard Client`_.
  129. ``-D <var>:<type>=<value>``
  130. Define a variable for script mode.
  131. Pass in variable values on the command line. Use in conjunction
  132. with ``-S`` to pass variable values to a dashboard script. Parsing ``-D``
  133. arguments as variable values is only attempted if the value
  134. following ``-D`` does not match any of the known dashboard types.
  135. ``-M <model>, --test-model <model>``
  136. Sets the model for a dashboard.
  137. This option tells CTest to act as a CDash client where the ``<model>``
  138. can be ``Experimental``, ``Nightly``, and ``Continuous``.
  139. Combining ``-M`` and ``-T`` is similar to ``-D``.
  140. See `Dashboard Client`_.
  141. ``-T <action>, --test-action <action>``
  142. Sets the dashboard action to perform.
  143. This option tells CTest to act as a CDash client and perform some
  144. action such as ``start``, ``build``, ``test`` etc. See
  145. `Dashboard Client Steps`_ for the full list of actions.
  146. Combining ``-M`` and ``-T`` is similar to ``-D``.
  147. See `Dashboard Client`_.
  148. ``-S <script>, --script <script>``
  149. Execute a dashboard for a configuration.
  150. This option tells CTest to load in a configuration script which sets
  151. a number of parameters such as the binary and source directories.
  152. Then CTest will do what is required to create and run a dashboard.
  153. This option basically sets up a dashboard and then runs ``ctest -D``
  154. with the appropriate options.
  155. See `Dashboard Client`_.
  156. ``-SP <script>, --script-new-process <script>``
  157. Execute a dashboard for a configuration.
  158. This option does the same operations as ``-S`` but it will do them in a
  159. separate process. This is primarily useful in cases where the
  160. script may modify the environment and you do not want the modified
  161. environment to impact other ``-S`` scripts.
  162. See `Dashboard Client`_.
  163. ``-I [Start,End,Stride,test#,test#|Test file], --tests-information``
  164. Run a specific number of tests by number.
  165. This option causes CTest to run tests starting at number ``Start``,
  166. ending at number ``End``, and incrementing by ``Stride``. Any additional
  167. numbers after ``Stride`` are considered individual test numbers. ``Start``,
  168. ``End``, or ``Stride`` can be empty. Optionally a file can be given that
  169. contains the same syntax as the command line.
  170. ``-U, --union``
  171. Take the Union of ``-I`` and ``-R``.
  172. When both ``-R`` and ``-I`` are specified by default the intersection of
  173. tests are run. By specifying ``-U`` the union of tests is run instead.
  174. ``--rerun-failed``
  175. Run only the tests that failed previously.
  176. This option tells CTest to perform only the tests that failed during
  177. its previous run. When this option is specified, CTest ignores all
  178. other options intended to modify the list of tests to run (``-L``, ``-R``,
  179. ``-E``, ``-LE``, ``-I``, etc). In the event that CTest runs and no tests
  180. fail, subsequent calls to CTest with the ``--rerun-failed`` option will run
  181. the set of tests that most recently failed (if any).
  182. ``--repeat-until-fail <n>``
  183. Require each test to run ``<n>`` times without failing in order to pass.
  184. This is useful in finding sporadic failures in test cases.
  185. ``--max-width <width>``
  186. Set the max width for a test name to output.
  187. Set the maximum width for each test name to show in the output.
  188. This allows the user to widen the output to avoid clipping the test
  189. name which can be very annoying.
  190. ``--interactive-debug-mode [0|1]``
  191. Set the interactive mode to ``0`` or ``1``.
  192. This option causes CTest to run tests in either an interactive mode
  193. or a non-interactive mode. On Windows this means that in
  194. non-interactive mode, all system debug pop up windows are blocked.
  195. In dashboard mode (``Experimental``, ``Nightly``, ``Continuous``), the default
  196. is non-interactive. When just running tests not for a dashboard the
  197. default is to allow popups and interactive debugging.
  198. ``--no-label-summary``
  199. Disable timing summary information for labels.
  200. This option tells CTest not to print summary information for each
  201. label associated with the tests run. If there are no labels on the
  202. tests, nothing extra is printed.
  203. See `Label and Subproject Summary`_.
  204. ``--no-subproject-summary``
  205. Disable timing summary information for subprojects.
  206. This option tells CTest not to print summary information for each
  207. subproject associated with the tests run. If there are no subprojects on the
  208. tests, nothing extra is printed.
  209. See `Label and Subproject Summary`_.
  210. ``--build-and-test``
  211. See `Build and Test Mode`_.
  212. ``--test-output-size-passed <size>``
  213. Limit the output for passed tests to ``<size>`` bytes.
  214. ``--test-output-size-failed <size>``
  215. Limit the output for failed tests to ``<size>`` bytes.
  216. ``--overwrite``
  217. Overwrite CTest configuration option.
  218. By default CTest uses configuration options from configuration file.
  219. This option will overwrite the configuration option.
  220. ``--force-new-ctest-process``
  221. Run child CTest instances as new processes.
  222. By default CTest will run child CTest instances within the same
  223. process. If this behavior is not desired, this argument will
  224. enforce new processes for child CTest processes.
  225. ``--schedule-random``
  226. Use a random order for scheduling tests.
  227. This option will run the tests in a random order. It is commonly
  228. used to detect implicit dependencies in a test suite.
  229. ``--submit-index``
  230. Legacy option for old Dart2 dashboard server feature.
  231. Do not use.
  232. ``--timeout <seconds>``
  233. Set the default test timeout.
  234. This option effectively sets a timeout on all tests that do not
  235. already have a timeout set on them via the :prop_test:`TIMEOUT`
  236. property.
  237. ``--stop-time <time>``
  238. Set a time at which all tests should stop running.
  239. Set a real time of day at which all tests should timeout. Example:
  240. ``7:00:00 -0400``. Any time format understood by the curl date parser
  241. is accepted. Local time is assumed if no timezone is specified.
  242. ``--print-labels``
  243. Print all available test labels.
  244. This option will not run any tests, it will simply print the list of
  245. all labels associated with the test set.
  246. .. include:: OPTIONS_HELP.txt
  247. .. _`Label and Subproject Summary`:
  248. Label and Subproject Summary
  249. ============================
  250. CTest prints timing summary information for each ``LABEL`` and subproject
  251. associated with the tests run. The label time summary will not include labels
  252. that are mapped to subprojects.
  253. When the :prop_test:`PROCESSORS` test property is set, CTest will display a
  254. weighted test timing result in label and subproject summaries. The time is
  255. reported with `sec*proc` instead of just `sec`.
  256. The weighted time summary reported for each label or subproject ``j``
  257. is computed as::
  258. Weighted Time Summary for Label/Subproject j =
  259. sum(raw_test_time[j,i] * num_processors[j,i], i=1...num_tests[j])
  260. for labels/subprojects j=1...total
  261. where:
  262. * ``raw_test_time[j,i]``: Wall-clock time for the ``i`` test
  263. for the ``j`` label or subproject
  264. * ``num_processors[j,i]``: Value of the CTest :prop_test:`PROCESSORS` property
  265. for the ``i`` test for the ``j`` label or subproject
  266. * ``num_tests[j]``: Number of tests associated with the ``j`` label or subproject
  267. * ``total``: Total number of labels or subprojects that have at least one test run
  268. Therefore, the weighted time summary for each label or subproject represents
  269. the amount of time that CTest gave to run the tests for each label or
  270. subproject and gives a good representation of the total expense of the tests
  271. for each label or subproject when compared to other labels or subprojects.
  272. For example, if ``SubprojectA`` showed ``100 sec*proc`` and ``SubprojectB`` showed
  273. ``10 sec*proc``, then CTest allocated approximately 10 times the CPU/core time
  274. to run the tests for ``SubprojectA`` than for ``SubprojectB`` (e.g. so if effort
  275. is going to be expended to reduce the cost of the test suite for the whole
  276. project, then reducing the cost of the test suite for ``SubprojectA`` would
  277. likely have a larger impact than effort to reduce the cost of the test suite
  278. for ``SubprojectB``).
  279. .. _`Build and Test Mode`:
  280. Build and Test Mode
  281. ===================
  282. CTest provides a command-line signature to configure (i.e. run cmake on),
  283. build, and/or execute a test::
  284. ctest --build-and-test <path-to-source> <path-to-build>
  285. --build-generator <generator>
  286. [<options>...]
  287. [--build-options <opts>...]
  288. [--test-command <command> [<args>...]]
  289. The configure and test steps are optional. The arguments to this command line
  290. are the source and binary directories. The ``--build-generator`` option *must*
  291. be provided to use ``--build-and-test``. If ``--test-command`` is specified
  292. then that will be run after the build is complete. Other options that affect
  293. this mode include:
  294. ``--build-target``
  295. Specify a specific target to build.
  296. If left out the ``all`` target is built.
  297. ``--build-nocmake``
  298. Run the build without running cmake first.
  299. Skip the cmake step.
  300. ``--build-run-dir``
  301. Specify directory to run programs from.
  302. Directory where programs will be after it has been compiled.
  303. ``--build-two-config``
  304. Run CMake twice.
  305. ``--build-exe-dir``
  306. Specify the directory for the executable.
  307. ``--build-generator``
  308. Specify the generator to use. See the :manual:`cmake-generators(7)` manual.
  309. ``--build-generator-platform``
  310. Specify the generator-specific platform.
  311. ``--build-generator-toolset``
  312. Specify the generator-specific toolset.
  313. ``--build-project``
  314. Specify the name of the project to build.
  315. ``--build-makeprogram``
  316. Specify the explicit make program to be used by CMake when configuring and
  317. building the project. Only applicable for Make and Ninja based generators.
  318. ``--build-noclean``
  319. Skip the make clean step.
  320. ``--build-config-sample``
  321. A sample executable to use to determine the configuration that
  322. should be used. e.g. ``Debug``, ``Release`` etc.
  323. ``--build-options``
  324. Additional options for configuring the build (i.e. for CMake, not for
  325. the build tool). Note that if this is specified, the ``--build-options``
  326. keyword and its arguments must be the last option given on the command
  327. line, with the possible exception of ``--test-command``.
  328. ``--test-command``
  329. The command to run as the test step with the ``--build-and-test`` option.
  330. All arguments following this keyword will be assumed to be part of the
  331. test command line, so it must be the last option given.
  332. ``--test-timeout``
  333. The time limit in seconds
  334. .. _`Dashboard Client`:
  335. Dashboard Client
  336. ================
  337. CTest can operate as a client for the `CDash`_ software quality dashboard
  338. application. As a dashboard client, CTest performs a sequence of steps
  339. to configure, build, and test software, and then submits the results to
  340. a `CDash`_ server. The command-line signature used to submit to `CDash`_ is::
  341. ctest (-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>)
  342. [-- <dashboard-options>...]
  343. Options for Dashboard Client include:
  344. ``--track <track>``
  345. Specify the track to submit dashboard to
  346. Submit dashboard to specified track instead of default one. By
  347. default, the dashboard is submitted to Nightly, Experimental, or
  348. Continuous track, but by specifying this option, the track can be
  349. arbitrary.
  350. ``-A <file>, --add-notes <file>``
  351. Add a notes file with submission.
  352. This option tells CTest to include a notes file when submitting
  353. dashboard.
  354. ``--tomorrow-tag``
  355. ``Nightly`` or ``Experimental`` starts with next day tag.
  356. This is useful if the build will not finish in one day.
  357. ``--extra-submit <file>[;<file>]``
  358. Submit extra files to the dashboard.
  359. This option will submit extra files to the dashboard.
  360. ``--http1.0``
  361. Submit using `HTTP 1.0`.
  362. This option will force CTest to use `HTTP 1.0` to submit files to the
  363. dashboard, instead of `HTTP 1.1`.
  364. ``--no-compress-output``
  365. Do not compress test output when submitting.
  366. This flag will turn off automatic compression of test output. Use
  367. this to maintain compatibility with an older version of CDash which
  368. doesn't support compressed test output.
  369. Dashboard Client Steps
  370. ----------------------
  371. CTest defines an ordered list of testing steps of which some or all may
  372. be run as a dashboard client:
  373. ``Start``
  374. Start a new dashboard submission to be composed of results recorded
  375. by the following steps.
  376. See the `CTest Start Step`_ section below.
  377. ``Update``
  378. Update the source tree from its version control repository.
  379. Record the old and new versions and the list of updated source files.
  380. See the `CTest Update Step`_ section below.
  381. ``Configure``
  382. Configure the software by running a command in the build tree.
  383. Record the configuration output log.
  384. See the `CTest Configure Step`_ section below.
  385. ``Build``
  386. Build the software by running a command in the build tree.
  387. Record the build output log and detect warnings and errors.
  388. See the `CTest Build Step`_ section below.
  389. ``Test``
  390. Test the software by loading a ``CTestTestfile.cmake``
  391. from the build tree and executing the defined tests.
  392. Record the output and result of each test.
  393. See the `CTest Test Step`_ section below.
  394. ``Coverage``
  395. Compute coverage of the source code by running a coverage
  396. analysis tool and recording its output.
  397. See the `CTest Coverage Step`_ section below.
  398. ``MemCheck``
  399. Run the software test suite through a memory check tool.
  400. Record the test output, results, and issues reported by the tool.
  401. See the `CTest MemCheck Step`_ section below.
  402. ``Submit``
  403. Submit results recorded from other testing steps to the
  404. software quality dashboard server.
  405. See the `CTest Submit Step`_ section below.
  406. Dashboard Client Modes
  407. ----------------------
  408. CTest defines three modes of operation as a dashboard client:
  409. ``Nightly``
  410. This mode is intended to be invoked once per day, typically at night.
  411. It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  412. ``Coverage``, and ``Submit`` steps by default. Selected steps run even
  413. if the ``Update`` step reports no changes to the source tree.
  414. ``Continuous``
  415. This mode is intended to be invoked repeatedly throughout the day.
  416. It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  417. ``Coverage``, and ``Submit`` steps by default, but exits after the
  418. ``Update`` step if it reports no changes to the source tree.
  419. ``Experimental``
  420. This mode is intended to be invoked by a developer to test local changes.
  421. It enables the ``Start``, ``Configure``, ``Build``, ``Test``, ``Coverage``,
  422. and ``Submit`` steps by default.
  423. Dashboard Client via CTest Command-Line
  424. ---------------------------------------
  425. CTest can perform testing on an already-generated build tree.
  426. Run the ``ctest`` command with the current working directory set
  427. to the build tree and use one of these signatures::
  428. ctest -D <mode>[<step>]
  429. ctest -M <mode> [ -T <step> ]...
  430. The ``<mode>`` must be one of the above `Dashboard Client Modes`_,
  431. and each ``<step>`` must be one of the above `Dashboard Client Steps`_.
  432. CTest reads the `Dashboard Client Configuration`_ settings from
  433. a file in the build tree called either ``CTestConfiguration.ini``
  434. or ``DartConfiguration.tcl`` (the names are historical). The format
  435. of the file is::
  436. # Lines starting in '#' are comments.
  437. # Other non-blank lines are key-value pairs.
  438. <setting>: <value>
  439. where ``<setting>`` is the setting name and ``<value>`` is the
  440. setting value.
  441. In build trees generated by CMake, this configuration file is
  442. generated by the :module:`CTest` module if included by the project.
  443. The module uses variables to obtain a value for each setting
  444. as documented with the settings below.
  445. .. _`CTest Script`:
  446. Dashboard Client via CTest Script
  447. ---------------------------------
  448. CTest can perform testing driven by a :manual:`cmake-language(7)`
  449. script that creates and maintains the source and build tree as
  450. well as performing the testing steps. Run the ``ctest`` command
  451. with the current working directory set outside of any build tree
  452. and use one of these signatures::
  453. ctest -S <script>
  454. ctest -SP <script>
  455. The ``<script>`` file must call :ref:`CTest Commands` commands
  456. to run testing steps explicitly as documented below. The commands
  457. obtain `Dashboard Client Configuration`_ settings from their
  458. arguments or from variables set in the script.
  459. Dashboard Client Configuration
  460. ==============================
  461. The `Dashboard Client Steps`_ may be configured by named
  462. settings as documented in the following sections.
  463. .. _`CTest Start Step`:
  464. CTest Start Step
  465. ----------------
  466. Start a new dashboard submission to be composed of results recorded
  467. by the following steps.
  468. In a `CTest Script`_, the :command:`ctest_start` command runs this step.
  469. Arguments to the command may specify some of the step settings.
  470. The command first runs the command-line specified by the
  471. ``CTEST_CHECKOUT_COMMAND`` variable, if set, to initialize the source
  472. directory.
  473. Configuration settings include:
  474. ``BuildDirectory``
  475. The full path to the project build tree.
  476. * `CTest Script`_ variable: :variable:`CTEST_BINARY_DIRECTORY`
  477. * :module:`CTest` module variable: :variable:`PROJECT_BINARY_DIR`
  478. ``SourceDirectory``
  479. The full path to the project source tree.
  480. * `CTest Script`_ variable: :variable:`CTEST_SOURCE_DIRECTORY`
  481. * :module:`CTest` module variable: :variable:`PROJECT_SOURCE_DIR`
  482. .. _`CTest Update Step`:
  483. CTest Update Step
  484. -----------------
  485. In a `CTest Script`_, the :command:`ctest_update` command runs this step.
  486. Arguments to the command may specify some of the step settings.
  487. Configuration settings to specify the version control tool include:
  488. ``BZRCommand``
  489. ``bzr`` command-line tool to use if source tree is managed by Bazaar.
  490. * `CTest Script`_ variable: :variable:`CTEST_BZR_COMMAND`
  491. * :module:`CTest` module variable: none
  492. ``BZRUpdateOptions``
  493. Command-line options to the ``BZRCommand`` when updating the source.
  494. * `CTest Script`_ variable: :variable:`CTEST_BZR_UPDATE_OPTIONS`
  495. * :module:`CTest` module variable: none
  496. ``CVSCommand``
  497. ``cvs`` command-line tool to use if source tree is managed by CVS.
  498. * `CTest Script`_ variable: :variable:`CTEST_CVS_COMMAND`
  499. * :module:`CTest` module variable: ``CVSCOMMAND``
  500. ``CVSUpdateOptions``
  501. Command-line options to the ``CVSCommand`` when updating the source.
  502. * `CTest Script`_ variable: :variable:`CTEST_CVS_UPDATE_OPTIONS`
  503. * :module:`CTest` module variable: ``CVS_UPDATE_OPTIONS``
  504. ``GITCommand``
  505. ``git`` command-line tool to use if source tree is managed by Git.
  506. * `CTest Script`_ variable: :variable:`CTEST_GIT_COMMAND`
  507. * :module:`CTest` module variable: ``GITCOMMAND``
  508. The source tree is updated by ``git fetch`` followed by
  509. ``git reset --hard`` to the ``FETCH_HEAD``. The result is the same
  510. as ``git pull`` except that any local modifications are overwritten.
  511. Use ``GITUpdateCustom`` to specify a different approach.
  512. ``GITInitSubmodules``
  513. If set, CTest will update the repository's submodules before updating.
  514. * `CTest Script`_ variable: :variable:`CTEST_GIT_INIT_SUBMODULES`
  515. * :module:`CTest` module variable: ``CTEST_GIT_INIT_SUBMODULES``
  516. ``GITUpdateCustom``
  517. Specify a custom command line (as a semicolon-separated list) to run
  518. in the source tree (Git work tree) to update it instead of running
  519. the ``GITCommand``.
  520. * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_CUSTOM`
  521. * :module:`CTest` module variable: ``CTEST_GIT_UPDATE_CUSTOM``
  522. ``GITUpdateOptions``
  523. Command-line options to the ``GITCommand`` when updating the source.
  524. * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_OPTIONS`
  525. * :module:`CTest` module variable: ``GIT_UPDATE_OPTIONS``
  526. ``HGCommand``
  527. ``hg`` command-line tool to use if source tree is managed by Mercurial.
  528. * `CTest Script`_ variable: :variable:`CTEST_HG_COMMAND`
  529. * :module:`CTest` module variable: none
  530. ``HGUpdateOptions``
  531. Command-line options to the ``HGCommand`` when updating the source.
  532. * `CTest Script`_ variable: :variable:`CTEST_HG_UPDATE_OPTIONS`
  533. * :module:`CTest` module variable: none
  534. ``P4Client``
  535. Value of the ``-c`` option to the ``P4Command``.
  536. * `CTest Script`_ variable: :variable:`CTEST_P4_CLIENT`
  537. * :module:`CTest` module variable: ``CTEST_P4_CLIENT``
  538. ``P4Command``
  539. ``p4`` command-line tool to use if source tree is managed by Perforce.
  540. * `CTest Script`_ variable: :variable:`CTEST_P4_COMMAND`
  541. * :module:`CTest` module variable: ``P4COMMAND``
  542. ``P4Options``
  543. Command-line options to the ``P4Command`` for all invocations.
  544. * `CTest Script`_ variable: :variable:`CTEST_P4_OPTIONS`
  545. * :module:`CTest` module variable: ``CTEST_P4_OPTIONS``
  546. ``P4UpdateCustom``
  547. Specify a custom command line (as a semicolon-separated list) to run
  548. in the source tree (Perforce tree) to update it instead of running
  549. the ``P4Command``.
  550. * `CTest Script`_ variable: none
  551. * :module:`CTest` module variable: ``CTEST_P4_UPDATE_CUSTOM``
  552. ``P4UpdateOptions``
  553. Command-line options to the ``P4Command`` when updating the source.
  554. * `CTest Script`_ variable: :variable:`CTEST_P4_UPDATE_OPTIONS`
  555. * :module:`CTest` module variable: ``CTEST_P4_UPDATE_OPTIONS``
  556. ``SVNCommand``
  557. ``svn`` command-line tool to use if source tree is managed by Subversion.
  558. * `CTest Script`_ variable: :variable:`CTEST_SVN_COMMAND`
  559. * :module:`CTest` module variable: ``SVNCOMMAND``
  560. ``SVNOptions``
  561. Command-line options to the ``SVNCommand`` for all invocations.
  562. * `CTest Script`_ variable: :variable:`CTEST_SVN_OPTIONS`
  563. * :module:`CTest` module variable: ``CTEST_SVN_OPTIONS``
  564. ``SVNUpdateOptions``
  565. Command-line options to the ``SVNCommand`` when updating the source.
  566. * `CTest Script`_ variable: :variable:`CTEST_SVN_UPDATE_OPTIONS`
  567. * :module:`CTest` module variable: ``SVN_UPDATE_OPTIONS``
  568. ``UpdateCommand``
  569. Specify the version-control command-line tool to use without
  570. detecting the VCS that manages the source tree.
  571. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_COMMAND`
  572. * :module:`CTest` module variable: ``<VCS>COMMAND``
  573. when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_COMMAND``
  574. ``UpdateOptions``
  575. Command-line options to the ``UpdateCommand``.
  576. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_OPTIONS`
  577. * :module:`CTest` module variable: ``<VCS>_UPDATE_OPTIONS``
  578. when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_OPTIONS``
  579. ``UpdateType``
  580. Specify the version-control system that manages the source
  581. tree if it cannot be detected automatically.
  582. The value may be ``bzr``, ``cvs``, ``git``, ``hg``,
  583. ``p4``, or ``svn``.
  584. * `CTest Script`_ variable: none, detected from source tree
  585. * :module:`CTest` module variable: ``UPDATE_TYPE`` if set,
  586. else ``CTEST_UPDATE_TYPE``
  587. .. _`UpdateVersionOnly`:
  588. ``UpdateVersionOnly``
  589. Specify that you want the version control update command to only
  590. discover the current version that is checked out, and not to update
  591. to a different version.
  592. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_VERSION_ONLY`
  593. .. _`UpdateVersionOverride`:
  594. ``UpdateVersionOverride``
  595. Specify the current version of your source tree.
  596. When this variable is set to a non-empty string, CTest will report the value
  597. you specified rather than using the update command to discover the current
  598. version that is checked out. Use of this variable supersedes
  599. ``UpdateVersionOnly``. Like ``UpdateVersionOnly``, using this variable tells
  600. CTest not to update the source tree to a different version.
  601. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_VERSION_OVERRIDE`
  602. Additional configuration settings include:
  603. ``NightlyStartTime``
  604. In the ``Nightly`` dashboard mode, specify the "nightly start time".
  605. With centralized version control systems (``cvs`` and ``svn``),
  606. the ``Update`` step checks out the version of the software as of
  607. this time so that multiple clients choose a common version to test.
  608. This is not well-defined in distributed version-control systems so
  609. the setting is ignored.
  610. * `CTest Script`_ variable: :variable:`CTEST_NIGHTLY_START_TIME`
  611. * :module:`CTest` module variable: ``NIGHTLY_START_TIME`` if set,
  612. else ``CTEST_NIGHTLY_START_TIME``
  613. .. _`CTest Configure Step`:
  614. CTest Configure Step
  615. --------------------
  616. In a `CTest Script`_, the :command:`ctest_configure` command runs this step.
  617. Arguments to the command may specify some of the step settings.
  618. Configuration settings include:
  619. ``ConfigureCommand``
  620. Command-line to launch the software configuration process.
  621. It will be executed in the location specified by the
  622. ``BuildDirectory`` setting.
  623. * `CTest Script`_ variable: :variable:`CTEST_CONFIGURE_COMMAND`
  624. * :module:`CTest` module variable: :variable:`CMAKE_COMMAND`
  625. followed by :variable:`PROJECT_SOURCE_DIR`
  626. ``LabelsForSubprojects``
  627. Specify a semicolon-separated list of labels that will be treated as
  628. subprojects. This mapping will be passed on to CDash when configure, test or
  629. build results are submitted.
  630. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  631. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  632. See `Label and Subproject Summary`_.
  633. .. _`CTest Build Step`:
  634. CTest Build Step
  635. ----------------
  636. In a `CTest Script`_, the :command:`ctest_build` command runs this step.
  637. Arguments to the command may specify some of the step settings.
  638. Configuration settings include:
  639. ``DefaultCTestConfigurationType``
  640. When the build system to be launched allows build-time selection
  641. of the configuration (e.g. ``Debug``, ``Release``), this specifies
  642. the default configuration to be built when no ``-C`` option is
  643. given to the ``ctest`` command. The value will be substituted into
  644. the value of ``MakeCommand`` to replace the literal string
  645. ``${CTEST_CONFIGURATION_TYPE}`` if it appears.
  646. * `CTest Script`_ variable: :variable:`CTEST_CONFIGURATION_TYPE`
  647. * :module:`CTest` module variable: ``DEFAULT_CTEST_CONFIGURATION_TYPE``,
  648. initialized by the :envvar:`CMAKE_CONFIG_TYPE` environment variable
  649. ``LabelsForSubprojects``
  650. Specify a semicolon-separated list of labels that will be treated as
  651. subprojects. This mapping will be passed on to CDash when configure, test or
  652. build results are submitted.
  653. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  654. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  655. See `Label and Subproject Summary`_.
  656. ``MakeCommand``
  657. Command-line to launch the software build process.
  658. It will be executed in the location specified by the
  659. ``BuildDirectory`` setting.
  660. * `CTest Script`_ variable: :variable:`CTEST_BUILD_COMMAND`
  661. * :module:`CTest` module variable: ``MAKECOMMAND``,
  662. initialized by the :command:`build_command` command
  663. ``UseLaunchers``
  664. For build trees generated by CMake using one of the
  665. :ref:`Makefile Generators` or the :generator:`Ninja`
  666. generator, specify whether the
  667. ``CTEST_USE_LAUNCHERS`` feature is enabled by the
  668. :module:`CTestUseLaunchers` module (also included by the
  669. :module:`CTest` module). When enabled, the generated build
  670. system wraps each invocation of the compiler, linker, or
  671. custom command line with a "launcher" that communicates
  672. with CTest via environment variables and files to report
  673. granular build warning and error information. Otherwise,
  674. CTest must "scrape" the build output log for diagnostics.
  675. * `CTest Script`_ variable: :variable:`CTEST_USE_LAUNCHERS`
  676. * :module:`CTest` module variable: ``CTEST_USE_LAUNCHERS``
  677. .. _`CTest Test Step`:
  678. CTest Test Step
  679. ---------------
  680. In a `CTest Script`_, the :command:`ctest_test` command runs this step.
  681. Arguments to the command may specify some of the step settings.
  682. Configuration settings include:
  683. ``LabelsForSubprojects``
  684. Specify a semicolon-separated list of labels that will be treated as
  685. subprojects. This mapping will be passed on to CDash when configure, test or
  686. build results are submitted.
  687. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  688. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  689. See `Label and Subproject Summary`_.
  690. ``TestLoad``
  691. While running tests in parallel (e.g. with ``-j``), try not to start
  692. tests when they may cause the CPU load to pass above a given threshold.
  693. * `CTest Script`_ variable: :variable:`CTEST_TEST_LOAD`
  694. * :module:`CTest` module variable: ``CTEST_TEST_LOAD``
  695. ``TimeOut``
  696. The default timeout for each test if not specified by the
  697. :prop_test:`TIMEOUT` test property.
  698. * `CTest Script`_ variable: :variable:`CTEST_TEST_TIMEOUT`
  699. * :module:`CTest` module variable: ``DART_TESTING_TIMEOUT``
  700. .. _`CTest Coverage Step`:
  701. CTest Coverage Step
  702. -------------------
  703. In a `CTest Script`_, the :command:`ctest_coverage` command runs this step.
  704. Arguments to the command may specify some of the step settings.
  705. Configuration settings include:
  706. ``CoverageCommand``
  707. Command-line tool to perform software coverage analysis.
  708. It will be executed in the location specified by the
  709. ``BuildDirectory`` setting.
  710. * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_COMMAND`
  711. * :module:`CTest` module variable: ``COVERAGE_COMMAND``
  712. ``CoverageExtraFlags``
  713. Specify command-line options to the ``CoverageCommand`` tool.
  714. * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_EXTRA_FLAGS`
  715. * :module:`CTest` module variable: ``COVERAGE_EXTRA_FLAGS``
  716. These options are the first arguments passed to ``CoverageCommand``.
  717. .. _`CTest MemCheck Step`:
  718. CTest MemCheck Step
  719. -------------------
  720. In a `CTest Script`_, the :command:`ctest_memcheck` command runs this step.
  721. Arguments to the command may specify some of the step settings.
  722. Configuration settings include:
  723. ``MemoryCheckCommand``
  724. Command-line tool to perform dynamic analysis. Test command lines
  725. will be launched through this tool.
  726. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND`
  727. * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND``
  728. ``MemoryCheckCommandOptions``
  729. Specify command-line options to the ``MemoryCheckCommand`` tool.
  730. They will be placed prior to the test command line.
  731. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND_OPTIONS`
  732. * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND_OPTIONS``
  733. ``MemoryCheckType``
  734. Specify the type of memory checking to perform.
  735. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_TYPE`
  736. * :module:`CTest` module variable: ``MEMORYCHECK_TYPE``
  737. ``MemoryCheckSanitizerOptions``
  738. Specify options to sanitizers when running with a sanitize-enabled build.
  739. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SANITIZER_OPTIONS`
  740. * :module:`CTest` module variable: ``MEMORYCHECK_SANITIZER_OPTIONS``
  741. ``MemoryCheckSuppressionFile``
  742. Specify a file containing suppression rules for the
  743. ``MemoryCheckCommand`` tool. It will be passed with options
  744. appropriate to the tool.
  745. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SUPPRESSIONS_FILE`
  746. * :module:`CTest` module variable: ``MEMORYCHECK_SUPPRESSIONS_FILE``
  747. Additional configuration settings include:
  748. ``BoundsCheckerCommand``
  749. Specify a ``MemoryCheckCommand`` that is known to be command-line
  750. compatible with Bounds Checker.
  751. * `CTest Script`_ variable: none
  752. * :module:`CTest` module variable: none
  753. ``PurifyCommand``
  754. Specify a ``MemoryCheckCommand`` that is known to be command-line
  755. compatible with Purify.
  756. * `CTest Script`_ variable: none
  757. * :module:`CTest` module variable: ``PURIFYCOMMAND``
  758. ``ValgrindCommand``
  759. Specify a ``MemoryCheckCommand`` that is known to be command-line
  760. compatible with Valgrind.
  761. * `CTest Script`_ variable: none
  762. * :module:`CTest` module variable: ``VALGRIND_COMMAND``
  763. ``ValgrindCommandOptions``
  764. Specify command-line options to the ``ValgrindCommand`` tool.
  765. They will be placed prior to the test command line.
  766. * `CTest Script`_ variable: none
  767. * :module:`CTest` module variable: ``VALGRIND_COMMAND_OPTIONS``
  768. .. _`CTest Submit Step`:
  769. CTest Submit Step
  770. -----------------
  771. In a `CTest Script`_, the :command:`ctest_submit` command runs this step.
  772. Arguments to the command may specify some of the step settings.
  773. Configuration settings include:
  774. ``BuildName``
  775. Describe the dashboard client platform with a short string.
  776. (Operating system, compiler, etc.)
  777. * `CTest Script`_ variable: :variable:`CTEST_BUILD_NAME`
  778. * :module:`CTest` module variable: ``BUILDNAME``
  779. ``CDashVersion``
  780. Legacy option. Not used.
  781. * `CTest Script`_ variable: none, detected from server
  782. * :module:`CTest` module variable: ``CTEST_CDASH_VERSION``
  783. ``CTestSubmitRetryCount``
  784. Specify a number of attempts to retry submission on network failure.
  785. * `CTest Script`_ variable: none,
  786. use the :command:`ctest_submit` ``RETRY_COUNT`` option.
  787. * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_COUNT``
  788. ``CTestSubmitRetryDelay``
  789. Specify a delay before retrying submission on network failure.
  790. * `CTest Script`_ variable: none,
  791. use the :command:`ctest_submit` ``RETRY_DELAY`` option.
  792. * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_DELAY``
  793. ``CurlOptions``
  794. Specify a semicolon-separated list of options to control the
  795. Curl library that CTest uses internally to connect to the
  796. server. Possible options are ``CURLOPT_SSL_VERIFYPEER_OFF``
  797. and ``CURLOPT_SSL_VERIFYHOST_OFF``.
  798. * `CTest Script`_ variable: :variable:`CTEST_CURL_OPTIONS`
  799. * :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
  800. ``DropLocation``
  801. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  802. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  803. ``DropLocation``.
  804. * `CTest Script`_ variable: :variable:`CTEST_DROP_LOCATION`
  805. * :module:`CTest` module variable: ``DROP_LOCATION`` if set,
  806. else ``CTEST_DROP_LOCATION``
  807. ``DropMethod``
  808. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  809. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  810. ``DropLocation``.
  811. * `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
  812. * :module:`CTest` module variable: ``DROP_METHOD`` if set,
  813. else ``CTEST_DROP_METHOD``
  814. ``DropSite``
  815. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  816. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  817. ``DropLocation``.
  818. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
  819. * :module:`CTest` module variable: ``DROP_SITE`` if set,
  820. else ``CTEST_DROP_SITE``
  821. ``DropSitePassword``
  822. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  823. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  824. ``DropLocation``.
  825. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_PASSWORD`
  826. * :module:`CTest` module variable: ``DROP_SITE_PASSWORD`` if set,
  827. else ``CTEST_DROP_SITE_PASWORD``
  828. ``DropSiteUser``
  829. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  830. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  831. ``DropLocation``.
  832. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_USER`
  833. * :module:`CTest` module variable: ``DROP_SITE_USER`` if set,
  834. else ``CTEST_DROP_SITE_USER``
  835. ``IsCDash``
  836. Legacy option. Not used.
  837. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH`
  838. * :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
  839. ``ScpCommand``
  840. Legacy option. Not used.
  841. * `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
  842. * :module:`CTest` module variable: ``SCPCOMMAND``
  843. ``Site``
  844. Describe the dashboard client host site with a short string.
  845. (Hostname, domain, etc.)
  846. * `CTest Script`_ variable: :variable:`CTEST_SITE`
  847. * :module:`CTest` module variable: ``SITE``,
  848. initialized by the :command:`site_name` command
  849. ``SubmitURL``
  850. The ``http`` or ``https`` URL of the dashboard server to send the submission
  851. to.
  852. * `CTest Script`_ variable: :variable:`CTEST_SUBMIT_URL`
  853. * :module:`CTest` module variable: ``SUBMIT_URL`` if set,
  854. else ``CTEST_SUBMIT_URL``
  855. ``TriggerSite``
  856. Legacy option. Not used.
  857. * `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE`
  858. * :module:`CTest` module variable: ``TRIGGER_SITE`` if set,
  859. else ``CTEST_TRIGGER_SITE``
  860. .. _`Show as JSON Object Model`:
  861. Show as JSON Object Model
  862. =========================
  863. When the ``--show-only=json-v1`` command line option is given, the test
  864. information is output in JSON format. Version 1.0 of the JSON object
  865. model is defined as follows:
  866. ``kind``
  867. The string "ctestInfo".
  868. ``version``
  869. A JSON object specifying the version components. Its members are
  870. ``major``
  871. A non-negative integer specifying the major version component.
  872. ``minor``
  873. A non-negative integer specifying the minor version component.
  874. ``backtraceGraph``
  875. JSON object representing backtrace information with the
  876. following members:
  877. ``commands``
  878. List of command names.
  879. ``files``
  880. List of file names.
  881. ``nodes``
  882. List of node JSON objects with members:
  883. ``command``
  884. Index into the ``commands`` member of the ``backtraceGraph``.
  885. ``file``
  886. Index into the ``files`` member of the ``backtraceGraph``.
  887. ``line``
  888. Line number in the file where the backtrace was added.
  889. ``parent``
  890. Index into the ``nodes`` member of the ``backtraceGraph``
  891. representing the parent in the graph.
  892. ``tests``
  893. A JSON array listing information about each test. Each entry
  894. is a JSON object with members:
  895. ``name``
  896. Test name.
  897. ``config``
  898. Configuration that the test can run on.
  899. Empty string means any config.
  900. ``command``
  901. List where the first element is the test command and the
  902. remaining elements are the command arguments.
  903. ``backtrace``
  904. Index into the ``nodes`` member of the ``backtraceGraph``.
  905. ``properties``
  906. Test properties.
  907. Can contain keys for each of the supported test properties.
  908. See Also
  909. ========
  910. .. include:: LINKS.txt
  911. .. _`CDash`: http://cdash.org/