ctest.1.rst 34 KB

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