ctest.1.rst 39 KB

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