ctest.1.rst 39 KB

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