ctest.1.rst 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130
  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 wall clock
  235. time for the test run will be multiplied by this property to give a better
  236. idea of how much cpu resource CTest allocated for the test. The time is
  237. reported with `sec*proc` instead of just `sec`.
  238. .. _`Build and Test Mode`:
  239. Build and Test Mode
  240. ===================
  241. CTest provides a command-line signature to to configure (i.e. run cmake on),
  242. build, and or execute a test::
  243. ctest --build-and-test <path-to-source> <path-to-build>
  244. --build-generator <generator> [<options>...] [-- <build-options>...]
  245. [--test-command <test>]
  246. The configure and test steps are optional. The arguments to this command line
  247. are the source and binary directories. The ``--build-generator`` option *must*
  248. be provided to use ``--build-and-test``. If ``--test-command`` is specified
  249. then that will be run after the build is complete. Other options that affect
  250. this mode include:
  251. ``--build-target``
  252. Specify a specific target to build.
  253. If left out the ``all`` target is built.
  254. ``--build-nocmake``
  255. Run the build without running cmake first.
  256. Skip the cmake step.
  257. ``--build-run-dir``
  258. Specify directory to run programs from.
  259. Directory where programs will be after it has been compiled.
  260. ``--build-two-config``
  261. Run CMake twice.
  262. ``--build-exe-dir``
  263. Specify the directory for the executable.
  264. ``--build-generator``
  265. Specify the generator to use. See the :manual:`cmake-generators(7)` manual.
  266. ``--build-generator-platform``
  267. Specify the generator-specific platform.
  268. ``--build-generator-toolset``
  269. Specify the generator-specific toolset.
  270. ``--build-project``
  271. Specify the name of the project to build.
  272. ``--build-makeprogram``
  273. Override the make program chosen by CTest with a given one.
  274. ``--build-noclean``
  275. Skip the make clean step.
  276. ``--build-config-sample``
  277. A sample executable to use to determine the configuration that
  278. should be used. e.g. Debug/Release/etc.
  279. ``--build-options``
  280. Add extra options to the build step.
  281. This option must be the last option with the exception of
  282. ``--test-command``
  283. ``--test-command``
  284. The test to run with the ``--build-and-test`` option.
  285. ``--test-timeout``
  286. The time limit in seconds
  287. .. _`Dashboard Client`:
  288. Dashboard Client
  289. ================
  290. CTest can operate as a client for the `CDash`_ software quality dashboard
  291. application. As a dashboard client, CTest performs a sequence of steps
  292. to configure, build, and test software, and then submits the results to
  293. a `CDash`_ server. The command-line signature used to submit to `CDash`_ is::
  294. ctest (-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>)
  295. [-- <dashboard-options>...]
  296. Options for Dashboard Client include:
  297. ``--track <track>``
  298. Specify the track to submit dashboard to
  299. Submit dashboard to specified track instead of default one. By
  300. default, the dashboard is submitted to Nightly, Experimental, or
  301. Continuous track, but by specifying this option, the track can be
  302. arbitrary.
  303. ``-A <file>, --add-notes <file>``
  304. Add a notes file with submission.
  305. This option tells CTest to include a notes file when submitting
  306. dashboard.
  307. ``--tomorrow-tag``
  308. Nightly or experimental starts with next day tag.
  309. This is useful if the build will not finish in one day.
  310. ``--extra-submit <file>[;<file>]``
  311. Submit extra files to the dashboard.
  312. This option will submit extra files to the dashboard.
  313. ``--http1.0``
  314. Submit using HTTP 1.0.
  315. This option will force CTest to use HTTP 1.0 to submit files to the
  316. dashboard, instead of HTTP 1.1.
  317. ``--no-compress-output``
  318. Do not compress test output when submitting.
  319. This flag will turn off automatic compression of test output. Use
  320. this to maintain compatibility with an older version of CDash which
  321. doesn't support compressed test output.
  322. Dashboard Client Steps
  323. ----------------------
  324. CTest defines an ordered list of testing steps of which some or all may
  325. be run as a dashboard client:
  326. ``Start``
  327. Start a new dashboard submission to be composed of results recorded
  328. by the following steps.
  329. See the `CTest Start Step`_ section below.
  330. ``Update``
  331. Update the source tree from its version control repository.
  332. Record the old and new versions and the list of updated source files.
  333. See the `CTest Update Step`_ section below.
  334. ``Configure``
  335. Configure the software by running a command in the build tree.
  336. Record the configuration output log.
  337. See the `CTest Configure Step`_ section below.
  338. ``Build``
  339. Build the software by running a command in the build tree.
  340. Record the build output log and detect warnings and errors.
  341. See the `CTest Build Step`_ section below.
  342. ``Test``
  343. Test the software by loading a ``CTestTestfile.cmake``
  344. from the build tree and executing the defined tests.
  345. Record the output and result of each test.
  346. See the `CTest Test Step`_ section below.
  347. ``Coverage``
  348. Compute coverage of the source code by running a coverage
  349. analysis tool and recording its output.
  350. See the `CTest Coverage Step`_ section below.
  351. ``MemCheck``
  352. Run the software test suite through a memory check tool.
  353. Record the test output, results, and issues reported by the tool.
  354. See the `CTest MemCheck Step`_ section below.
  355. ``Submit``
  356. Submit results recorded from other testing steps to the
  357. software quality dashboard server.
  358. See the `CTest Submit Step`_ section below.
  359. Dashboard Client Modes
  360. ----------------------
  361. CTest defines three modes of operation as a dashboard client:
  362. ``Nightly``
  363. This mode is intended to be invoked once per day, typically at night.
  364. It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  365. ``Coverage``, and ``Submit`` steps by default. Selected steps run even
  366. if the ``Update`` step reports no changes to the source tree.
  367. ``Continuous``
  368. This mode is intended to be invoked repeatedly throughout the day.
  369. It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  370. ``Coverage``, and ``Submit`` steps by default, but exits after the
  371. ``Update`` step if it reports no changes to the source tree.
  372. ``Experimental``
  373. This mode is intended to be invoked by a developer to test local changes.
  374. It enables the ``Start``, ``Configure``, ``Build``, ``Test``, ``Coverage``,
  375. and ``Submit`` steps by default.
  376. Dashboard Client via CTest Command-Line
  377. ---------------------------------------
  378. CTest can perform testing on an already-generated build tree.
  379. Run the ``ctest`` command with the current working directory set
  380. to the build tree and use one of these signatures::
  381. ctest -D <mode>[<step>]
  382. ctest -M <mode> [ -T <step> ]...
  383. The ``<mode>`` must be one of the above `Dashboard Client Modes`_,
  384. and each ``<step>`` must be one of the above `Dashboard Client Steps`_.
  385. CTest reads the `Dashboard Client Configuration`_ settings from
  386. a file in the build tree called either ``CTestConfiguration.ini``
  387. or ``DartConfiguration.tcl`` (the names are historical). The format
  388. of the file is::
  389. # Lines starting in '#' are comments.
  390. # Other non-blank lines are key-value pairs.
  391. <setting>: <value>
  392. where ``<setting>`` is the setting name and ``<value>`` is the
  393. setting value.
  394. In build trees generated by CMake, this configuration file is
  395. generated by the :module:`CTest` module if included by the project.
  396. The module uses variables to obtain a value for each setting
  397. as documented with the settings below.
  398. .. _`CTest Script`:
  399. Dashboard Client via CTest Script
  400. ---------------------------------
  401. CTest can perform testing driven by a :manual:`cmake-language(7)`
  402. script that creates and maintains the source and build tree as
  403. well as performing the testing steps. Run the ``ctest`` command
  404. with the current working directory set outside of any build tree
  405. and use one of these signatures::
  406. ctest -S <script>
  407. ctest -SP <script>
  408. The ``<script>`` file must call :ref:`CTest Commands` commands
  409. to run testing steps explicitly as documented below. The commands
  410. obtain `Dashboard Client Configuration`_ settings from their
  411. arguments or from variables set in the script.
  412. Dashboard Client Configuration
  413. ==============================
  414. The `Dashboard Client Steps`_ may be configured by named
  415. settings as documented in the following sections.
  416. .. _`CTest Start Step`:
  417. CTest Start Step
  418. ----------------
  419. Start a new dashboard submission to be composed of results recorded
  420. by the following steps.
  421. In a `CTest Script`_, the :command:`ctest_start` command runs this step.
  422. Arguments to the command may specify some of the step settings.
  423. The command first runs the command-line specified by the
  424. ``CTEST_CHECKOUT_COMMAND`` variable, if set, to initialize the source
  425. directory.
  426. Configuration settings include:
  427. ``BuildDirectory``
  428. The full path to the project build tree.
  429. * `CTest Script`_ variable: :variable:`CTEST_BINARY_DIRECTORY`
  430. * :module:`CTest` module variable: :variable:`PROJECT_BINARY_DIR`
  431. ``SourceDirectory``
  432. The full path to the project source tree.
  433. * `CTest Script`_ variable: :variable:`CTEST_SOURCE_DIRECTORY`
  434. * :module:`CTest` module variable: :variable:`PROJECT_SOURCE_DIR`
  435. .. _`CTest Update Step`:
  436. CTest Update Step
  437. -----------------
  438. In a `CTest Script`_, the :command:`ctest_update` command runs this step.
  439. Arguments to the command may specify some of the step settings.
  440. Configuration settings to specify the version control tool include:
  441. ``BZRCommand``
  442. ``bzr`` command-line tool to use if source tree is managed by Bazaar.
  443. * `CTest Script`_ variable: :variable:`CTEST_BZR_COMMAND`
  444. * :module:`CTest` module variable: none
  445. ``BZRUpdateOptions``
  446. Command-line options to the ``BZRCommand`` when updating the source.
  447. * `CTest Script`_ variable: :variable:`CTEST_BZR_UPDATE_OPTIONS`
  448. * :module:`CTest` module variable: none
  449. ``CVSCommand``
  450. ``cvs`` command-line tool to use if source tree is managed by CVS.
  451. * `CTest Script`_ variable: :variable:`CTEST_CVS_COMMAND`
  452. * :module:`CTest` module variable: ``CVSCOMMAND``
  453. ``CVSUpdateOptions``
  454. Command-line options to the ``CVSCommand`` when updating the source.
  455. * `CTest Script`_ variable: :variable:`CTEST_CVS_UPDATE_OPTIONS`
  456. * :module:`CTest` module variable: ``CVS_UPDATE_OPTIONS``
  457. ``GITCommand``
  458. ``git`` command-line tool to use if source tree is managed by Git.
  459. * `CTest Script`_ variable: :variable:`CTEST_GIT_COMMAND`
  460. * :module:`CTest` module variable: ``GITCOMMAND``
  461. The source tree is updated by ``git fetch`` followed by
  462. ``git reset --hard`` to the ``FETCH_HEAD``. The result is the same
  463. as ``git pull`` except that any local moficiations are overwritten.
  464. Use ``GITUpdateCustom`` to specify a different approach.
  465. ``GITInitSubmodules``
  466. If set, CTest will update the repository's submodules before updating.
  467. * `CTest Script`_ variable: :variable:`CTEST_GIT_INIT_SUBMODULES`
  468. * :module:`CTest` module variable: ``CTEST_GIT_INIT_SUBMODULES``
  469. ``GITUpdateCustom``
  470. Specify a custom command line (as a semicolon-separated list) to run
  471. in the source tree (Git work tree) to update it instead of running
  472. the ``GITCommand``.
  473. * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_CUSTOM`
  474. * :module:`CTest` module variable: ``CTEST_GIT_UPDATE_CUSTOM``
  475. ``GITUpdateOptions``
  476. Command-line options to the ``GITCommand`` when updating the source.
  477. * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_OPTIONS`
  478. * :module:`CTest` module variable: ``GIT_UPDATE_OPTIONS``
  479. ``HGCommand``
  480. ``hg`` command-line tool to use if source tree is managed by Mercurial.
  481. * `CTest Script`_ variable: :variable:`CTEST_HG_COMMAND`
  482. * :module:`CTest` module variable: none
  483. ``HGUpdateOptions``
  484. Command-line options to the ``HGCommand`` when updating the source.
  485. * `CTest Script`_ variable: :variable:`CTEST_HG_UPDATE_OPTIONS`
  486. * :module:`CTest` module variable: none
  487. ``P4Client``
  488. Value of the ``-c`` option to the ``P4Command``.
  489. * `CTest Script`_ variable: :variable:`CTEST_P4_CLIENT`
  490. * :module:`CTest` module variable: ``CTEST_P4_CLIENT``
  491. ``P4Command``
  492. ``p4`` command-line tool to use if source tree is managed by Perforce.
  493. * `CTest Script`_ variable: :variable:`CTEST_P4_COMMAND`
  494. * :module:`CTest` module variable: ``P4COMMAND``
  495. ``P4Options``
  496. Command-line options to the ``P4Command`` for all invocations.
  497. * `CTest Script`_ variable: :variable:`CTEST_P4_OPTIONS`
  498. * :module:`CTest` module variable: ``CTEST_P4_OPTIONS``
  499. ``P4UpdateCustom``
  500. Specify a custom command line (as a semicolon-separated list) to run
  501. in the source tree (Perforce tree) to update it instead of running
  502. the ``P4Command``.
  503. * `CTest Script`_ variable: none
  504. * :module:`CTest` module variable: ``CTEST_P4_UPDATE_CUSTOM``
  505. ``P4UpdateOptions``
  506. Command-line options to the ``P4Command`` when updating the source.
  507. * `CTest Script`_ variable: :variable:`CTEST_P4_UPDATE_OPTIONS`
  508. * :module:`CTest` module variable: ``CTEST_P4_UPDATE_OPTIONS``
  509. ``SVNCommand``
  510. ``svn`` command-line tool to use if source tree is managed by Subversion.
  511. * `CTest Script`_ variable: :variable:`CTEST_SVN_COMMAND`
  512. * :module:`CTest` module variable: ``SVNCOMMAND``
  513. ``SVNOptions``
  514. Command-line options to the ``SVNCommand`` for all invocations.
  515. * `CTest Script`_ variable: :variable:`CTEST_SVN_OPTIONS`
  516. * :module:`CTest` module variable: ``CTEST_SVN_OPTIONS``
  517. ``SVNUpdateOptions``
  518. Command-line options to the ``SVNCommand`` when updating the source.
  519. * `CTest Script`_ variable: :variable:`CTEST_SVN_UPDATE_OPTIONS`
  520. * :module:`CTest` module variable: ``SVN_UPDATE_OPTIONS``
  521. ``UpdateCommand``
  522. Specify the version-control command-line tool to use without
  523. detecting the VCS that manages the source tree.
  524. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_COMMAND`
  525. * :module:`CTest` module variable: ``<VCS>COMMAND``
  526. when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_COMMAND``
  527. ``UpdateOptions``
  528. Command-line options to the ``UpdateCommand``.
  529. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_OPTIONS`
  530. * :module:`CTest` module variable: ``<VCS>_UPDATE_OPTIONS``
  531. when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_OPTIONS``
  532. ``UpdateType``
  533. Specify the version-control system that manages the source
  534. tree if it cannot be detected automatically.
  535. The value may be ``bzr``, ``cvs``, ``git``, ``hg``,
  536. ``p4``, or ``svn``.
  537. * `CTest Script`_ variable: none, detected from source tree
  538. * :module:`CTest` module variable: ``UPDATE_TYPE`` if set,
  539. else ``CTEST_UPDATE_TYPE``
  540. ``UpdateVersionOnly``
  541. Specify that you want the version control update command to only
  542. discover the current version that is checked out, and not to update
  543. to a different version.
  544. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_VERSION_ONLY`
  545. Additional configuration settings include:
  546. ``NightlyStartTime``
  547. In the ``Nightly`` dashboard mode, specify the "nightly start time".
  548. With centralized version control systems (``cvs`` and ``svn``),
  549. the ``Update`` step checks out the version of the software as of
  550. this time so that multiple clients choose a common version to test.
  551. This is not well-defined in distributed version-control systems so
  552. the setting is ignored.
  553. * `CTest Script`_ variable: :variable:`CTEST_NIGHTLY_START_TIME`
  554. * :module:`CTest` module variable: ``NIGHTLY_START_TIME`` if set,
  555. else ``CTEST_NIGHTLY_START_TIME``
  556. .. _`CTest Configure Step`:
  557. CTest Configure Step
  558. --------------------
  559. In a `CTest Script`_, the :command:`ctest_configure` command runs this step.
  560. Arguments to the command may specify some of the step settings.
  561. Configuration settings include:
  562. ``ConfigureCommand``
  563. Command-line to launch the software configuration process.
  564. It will be executed in the location specified by the
  565. ``BuildDirectory`` setting.
  566. * `CTest Script`_ variable: :variable:`CTEST_CONFIGURE_COMMAND`
  567. * :module:`CTest` module variable: :variable:`CMAKE_COMMAND`
  568. followed by :variable:`PROJECT_SOURCE_DIR`
  569. ``LabelsForSubprojects``
  570. Specify a semicolon-separated list of labels that will be treated as
  571. subprojects. This mapping will be passed on to CDash when configure, test or
  572. build results are submitted.
  573. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  574. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  575. See `Label and Subproject Summary`_.
  576. .. _`CTest Build Step`:
  577. CTest Build Step
  578. ----------------
  579. In a `CTest Script`_, the :command:`ctest_build` command runs this step.
  580. Arguments to the command may specify some of the step settings.
  581. Configuration settings include:
  582. ``DefaultCTestConfigurationType``
  583. When the build system to be launched allows build-time selection
  584. of the configuration (e.g. ``Debug``, ``Release``), this specifies
  585. the default configuration to be built when no ``-C`` option is
  586. given to the ``ctest`` command. The value will be substituted into
  587. the value of ``MakeCommand`` to replace the literal string
  588. ``${CTEST_CONFIGURATION_TYPE}`` if it appears.
  589. * `CTest Script`_ variable: :variable:`CTEST_CONFIGURATION_TYPE`
  590. * :module:`CTest` module variable: ``DEFAULT_CTEST_CONFIGURATION_TYPE``,
  591. initialized by the ``CMAKE_CONFIG_TYPE`` environment variable
  592. ``LabelsForSubprojects``
  593. Specify a semicolon-separated list of labels that will be treated as
  594. subprojects. This mapping will be passed on to CDash when configure, test or
  595. build results are submitted.
  596. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  597. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  598. See `Label and Subproject Summary`_.
  599. ``MakeCommand``
  600. Command-line to launch the software build process.
  601. It will be executed in the location specified by the
  602. ``BuildDirectory`` setting.
  603. * `CTest Script`_ variable: :variable:`CTEST_BUILD_COMMAND`
  604. * :module:`CTest` module variable: ``MAKECOMMAND``,
  605. initialized by the :command:`build_command` command
  606. ``UseLaunchers``
  607. For build trees generated by CMake using one of the
  608. :ref:`Makefile Generators` or the :generator:`Ninja`
  609. generator, specify whether the
  610. ``CTEST_USE_LAUNCHERS`` feature is enabled by the
  611. :module:`CTestUseLaunchers` module (also included by the
  612. :module:`CTest` module). When enabled, the generated build
  613. system wraps each invocation of the compiler, linker, or
  614. custom command line with a "launcher" that communicates
  615. with CTest via environment variables and files to report
  616. granular build warning and error information. Otherwise,
  617. CTest must "scrape" the build output log for diagnostics.
  618. * `CTest Script`_ variable: :variable:`CTEST_USE_LAUNCHERS`
  619. * :module:`CTest` module variable: ``CTEST_USE_LAUNCHERS``
  620. .. _`CTest Test Step`:
  621. CTest Test Step
  622. ---------------
  623. In a `CTest Script`_, the :command:`ctest_test` command runs this step.
  624. Arguments to the command may specify some of the step settings.
  625. Configuration settings include:
  626. ``LabelsForSubprojects``
  627. Specify a semicolon-separated list of labels that will be treated as
  628. subprojects. This mapping will be passed on to CDash when configure, test or
  629. build results are submitted.
  630. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  631. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  632. See `Label and Subproject Summary`_.
  633. ``TestLoad``
  634. While running tests in parallel (e.g. with ``-j``), try not to start
  635. tests when they may cause the CPU load to pass above a given threshold.
  636. * `CTest Script`_ variable: :variable:`CTEST_TEST_LOAD`
  637. * :module:`CTest` module variable: ``CTEST_TEST_LOAD``
  638. ``TimeOut``
  639. The default timeout for each test if not specified by the
  640. :prop_test:`TIMEOUT` test property.
  641. * `CTest Script`_ variable: :variable:`CTEST_TEST_TIMEOUT`
  642. * :module:`CTest` module variable: ``DART_TESTING_TIMEOUT``
  643. .. _`CTest Coverage Step`:
  644. CTest Coverage Step
  645. -------------------
  646. In a `CTest Script`_, the :command:`ctest_coverage` command runs this step.
  647. Arguments to the command may specify some of the step settings.
  648. Configuration settings include:
  649. ``CoverageCommand``
  650. Command-line tool to perform software coverage analysis.
  651. It will be executed in the location specified by the
  652. ``BuildDirectory`` setting.
  653. * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_COMMAND`
  654. * :module:`CTest` module variable: ``COVERAGE_COMMAND``
  655. ``CoverageExtraFlags``
  656. Specify command-line options to the ``CoverageCommand`` tool.
  657. * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_EXTRA_FLAGS`
  658. * :module:`CTest` module variable: ``COVERAGE_EXTRA_FLAGS``
  659. These options are the first arguments passed to ``CoverageCommand``.
  660. .. _`CTest MemCheck Step`:
  661. CTest MemCheck Step
  662. -------------------
  663. In a `CTest Script`_, the :command:`ctest_memcheck` command runs this step.
  664. Arguments to the command may specify some of the step settings.
  665. Configuration settings include:
  666. ``MemoryCheckCommand``
  667. Command-line tool to perform dynamic analysis. Test command lines
  668. will be launched through this tool.
  669. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND`
  670. * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND``
  671. ``MemoryCheckCommandOptions``
  672. Specify command-line options to the ``MemoryCheckCommand`` tool.
  673. They will be placed prior to the test command line.
  674. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND_OPTIONS`
  675. * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND_OPTIONS``
  676. ``MemoryCheckType``
  677. Specify the type of memory checking to perform.
  678. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_TYPE`
  679. * :module:`CTest` module variable: ``MEMORYCHECK_TYPE``
  680. ``MemoryCheckSanitizerOptions``
  681. Specify options to sanitizers when running with a sanitize-enabled build.
  682. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SANITIZER_OPTIONS`
  683. * :module:`CTest` module variable: ``MEMORYCHECK_SANITIZER_OPTIONS``
  684. ``MemoryCheckSuppressionFile``
  685. Specify a file containing suppression rules for the
  686. ``MemoryCheckCommand`` tool. It will be passed with options
  687. appropriate to the tool.
  688. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SUPPRESSIONS_FILE`
  689. * :module:`CTest` module variable: ``MEMORYCHECK_SUPPRESSIONS_FILE``
  690. Additional configuration settings include:
  691. ``BoundsCheckerCommand``
  692. Specify a ``MemoryCheckCommand`` that is known to be command-line
  693. compatible with Bounds Checker.
  694. * `CTest Script`_ variable: none
  695. * :module:`CTest` module variable: none
  696. ``PurifyCommand``
  697. Specify a ``MemoryCheckCommand`` that is known to be command-line
  698. compatible with Purify.
  699. * `CTest Script`_ variable: none
  700. * :module:`CTest` module variable: ``PURIFYCOMMAND``
  701. ``ValgrindCommand``
  702. Specify a ``MemoryCheckCommand`` that is known to be command-line
  703. compatible with Valgrind.
  704. * `CTest Script`_ variable: none
  705. * :module:`CTest` module variable: ``VALGRIND_COMMAND``
  706. ``ValgrindCommandOptions``
  707. Specify command-line options to the ``ValgrindCommand`` tool.
  708. They will be placed prior to the test command line.
  709. * `CTest Script`_ variable: none
  710. * :module:`CTest` module variable: ``VALGRIND_COMMAND_OPTIONS``
  711. .. _`CTest Submit Step`:
  712. CTest Submit Step
  713. -----------------
  714. In a `CTest Script`_, the :command:`ctest_submit` command runs this step.
  715. Arguments to the command may specify some of the step settings.
  716. Configuration settings include:
  717. ``BuildName``
  718. Describe the dashboard client platform with a short string.
  719. (Operating system, compiler, etc.)
  720. * `CTest Script`_ variable: :variable:`CTEST_BUILD_NAME`
  721. * :module:`CTest` module variable: ``BUILDNAME``
  722. ``CDashVersion``
  723. Specify the version of `CDash`_ on the server.
  724. * `CTest Script`_ variable: none, detected from server
  725. * :module:`CTest` module variable: ``CTEST_CDASH_VERSION``
  726. ``CTestSubmitRetryCount``
  727. Specify a number of attempts to retry submission on network failure.
  728. * `CTest Script`_ variable: none,
  729. use the :command:`ctest_submit` ``RETRY_COUNT`` option.
  730. * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_COUNT``
  731. ``CTestSubmitRetryDelay``
  732. Specify a delay before retrying submission on network failure.
  733. * `CTest Script`_ variable: none,
  734. use the :command:`ctest_submit` ``RETRY_DELAY`` option.
  735. * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_DELAY``
  736. ``CurlOptions``
  737. Specify a semicolon-separated list of options to control the
  738. Curl library that CTest uses internally to connect to the
  739. server. Possible options are ``CURLOPT_SSL_VERIFYPEER_OFF``
  740. and ``CURLOPT_SSL_VERIFYHOST_OFF``.
  741. * `CTest Script`_ variable: :variable:`CTEST_CURL_OPTIONS`
  742. * :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
  743. ``DropLocation``
  744. The path on the dashboard server to send the submission.
  745. * `CTest Script`_ variable: :variable:`CTEST_DROP_LOCATION`
  746. * :module:`CTest` module variable: ``DROP_LOCATION`` if set,
  747. else ``CTEST_DROP_LOCATION``
  748. ``DropMethod``
  749. Specify the method by which results should be submitted to the
  750. dashboard server. The value may be ``cp``, ``ftp``, ``http``,
  751. ``https``, ``scp``, or ``xmlrpc`` (if CMake was built with
  752. support for it).
  753. * `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
  754. * :module:`CTest` module variable: ``DROP_METHOD`` if set,
  755. else ``CTEST_DROP_METHOD``
  756. ``DropSite``
  757. The dashboard server name
  758. (for ``ftp``, ``http``, and ``https``, ``scp``, and ``xmlrpc``).
  759. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
  760. * :module:`CTest` module variable: ``DROP_SITE`` if set,
  761. else ``CTEST_DROP_SITE``
  762. ``DropSitePassword``
  763. The dashboard server login password, if any
  764. (for ``ftp``, ``http``, and ``https``).
  765. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_PASSWORD`
  766. * :module:`CTest` module variable: ``DROP_SITE_PASSWORD`` if set,
  767. else ``CTEST_DROP_SITE_PASWORD``
  768. ``DropSiteUser``
  769. The dashboard server login user name, if any
  770. (for ``ftp``, ``http``, and ``https``).
  771. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_USER`
  772. * :module:`CTest` module variable: ``DROP_SITE_USER`` if set,
  773. else ``CTEST_DROP_SITE_USER``
  774. ``IsCDash``
  775. Specify whether the dashboard server is `CDash`_ or an older
  776. dashboard server implementation requiring ``TriggerSite``.
  777. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH`
  778. * :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
  779. ``ScpCommand``
  780. ``scp`` command-line tool to use when ``DropMethod`` is ``scp``.
  781. * `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
  782. * :module:`CTest` module variable: ``SCPCOMMAND``
  783. ``Site``
  784. Describe the dashboard client host site with a short string.
  785. (Hostname, domain, etc.)
  786. * `CTest Script`_ variable: :variable:`CTEST_SITE`
  787. * :module:`CTest` module variable: ``SITE``,
  788. initialized by the :command:`site_name` command
  789. ``TriggerSite``
  790. Legacy option to support older dashboard server implementations.
  791. Not used when ``IsCDash`` is true.
  792. * `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE`
  793. * :module:`CTest` module variable: ``TRIGGER_SITE`` if set,
  794. else ``CTEST_TRIGGER_SITE``
  795. See Also
  796. ========
  797. .. include:: LINKS.txt
  798. .. _`CDash`: http://cdash.org/