ctest.1.rst 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845
  1. .. cmake-manual-description: CTest Command-Line Reference
  2. ctest(1)
  3. ********
  4. .. contents::
  5. Synopsis
  6. ========
  7. .. parsed-literal::
  8. `Run Tests`_
  9. ctest [<options>] [--test-dir <path-to-build>]
  10. `Build and Test Mode`_
  11. ctest --build-and-test <path-to-source> <path-to-build>
  12. --build-generator <generator> [<options>...]
  13. [--build-options <opts>...]
  14. [--test-command <command> [<args>...]]
  15. `Dashboard Client`_
  16. ctest -D <dashboard> [-- <dashboard-options>...]
  17. ctest -M <model> -T <action> [-- <dashboard-options>...]
  18. ctest -S <script> [-- <dashboard-options>...]
  19. ctest -SP <script> [-- <dashboard-options>...]
  20. `View Help`_
  21. ctest --help[-<topic>]
  22. Description
  23. ===========
  24. The :program:`ctest` executable is the CMake test driver program.
  25. CMake-generated build trees created for projects that use the
  26. :command:`enable_testing` and :command:`add_test` commands have testing support.
  27. This program will run the tests and report results.
  28. .. _`Run Tests`:
  29. Run Tests
  30. =========
  31. .. program:: ctest
  32. .. option:: --preset <preset>, --preset=<preset>
  33. Use a test preset to specify test options. The project binary directory
  34. is inferred from the ``configurePreset`` key. The current working directory
  35. must contain CMake preset files.
  36. See :manual:`preset <cmake-presets(7)>` for more details.
  37. .. option:: --list-presets
  38. Lists the available test presets. The current working directory must contain
  39. CMake preset files.
  40. .. option:: -C <cfg>, --build-config <cfg>
  41. Choose configuration to test.
  42. Some CMake-generated build trees can have multiple build
  43. configurations in the same tree. This option can be used to specify
  44. which one should be tested. Example configurations are ``Debug`` and
  45. ``Release``.
  46. .. option:: --progress
  47. Enable short progress output from tests.
  48. When the output of :program:`ctest` is being sent directly to a terminal, the
  49. progress through the set of tests is reported by updating the same line
  50. rather than printing start and end messages for each test on new lines.
  51. This can significantly reduce the verbosity of the test output.
  52. Test completion messages are still output on their own line for failed
  53. tests and the final test summary will also still be logged.
  54. This option can also be enabled by setting the environment variable
  55. :envvar:`CTEST_PROGRESS_OUTPUT`.
  56. .. option:: -V, --verbose
  57. Enable verbose output from tests.
  58. Test output is normally suppressed and only summary information is
  59. displayed. This option will show all test output.
  60. .. option:: -VV, --extra-verbose
  61. Enable more verbose output from tests.
  62. Test output is normally suppressed and only summary information is
  63. displayed. This option will show even more test output.
  64. .. option:: --debug
  65. Displaying more verbose internals of CTest.
  66. This feature will result in a large number of output that is mostly
  67. useful for debugging dashboard problems.
  68. .. option:: --output-on-failure
  69. Output anything outputted by the test program if the test should fail.
  70. This option can also be enabled by setting the
  71. :envvar:`CTEST_OUTPUT_ON_FAILURE` environment variable
  72. .. option:: --stop-on-failure
  73. Stop running the tests when the first failure happens.
  74. .. option:: -F
  75. Enable failover.
  76. This option allows CTest to resume a test set execution that was
  77. previously interrupted. If no interruption occurred, the ``-F`` option
  78. will have no effect.
  79. .. option:: -j <jobs>, --parallel <jobs>
  80. Run the tests in parallel using the given number of jobs.
  81. This option tells CTest to run the tests in parallel using given
  82. number of jobs. This option can also be set by setting the
  83. :envvar:`CTEST_PARALLEL_LEVEL` environment variable.
  84. This option can be used with the :prop_test:`PROCESSORS` test property.
  85. See `Label and Subproject Summary`_.
  86. .. option:: --resource-spec-file <file>
  87. Run CTest with :ref:`resource allocation <ctest-resource-allocation>` enabled,
  88. using the
  89. :ref:`resource specification file <ctest-resource-specification-file>`
  90. specified in ``<file>``.
  91. When :program:`ctest` is run as a `Dashboard Client`_ this sets the
  92. ``ResourceSpecFile`` option of the `CTest Test Step`_.
  93. .. option:: --test-load <level>
  94. While running tests in parallel (e.g. with :option:`-j <ctest -j>`), try
  95. not to start tests when they may cause the CPU load to pass above a given
  96. threshold.
  97. When :program:`ctest` is run as a `Dashboard Client`_ this sets the
  98. ``TestLoad`` option of the `CTest Test Step`_.
  99. .. option:: -Q, --quiet
  100. Make CTest quiet.
  101. This option will suppress all the output. The output log file will
  102. still be generated if the :option:`--output-log <ctest --output-log>` is
  103. specified. Options such as :option:`--verbose <ctest --verbose>`,
  104. :option:`--extra-verbose <ctest --extra-verbose>`, and
  105. :option:`--debug <ctest --debug>` are ignored
  106. if ``--quiet`` is specified.
  107. .. option:: -O <file>, --output-log <file>
  108. Output to log file.
  109. This option tells CTest to write all its output to a ``<file>`` log file.
  110. .. option:: --output-junit <file>
  111. .. versionadded:: 3.21
  112. Write test results in JUnit format.
  113. This option tells CTest to write test results to ``<file>`` in JUnit XML
  114. format. If ``<file>`` already exists, it will be overwritten. If using the
  115. :option:`-S <ctest -S>` option to run a dashboard script, use the
  116. ``OUTPUT_JUNIT`` keyword with the :command:`ctest_test` command instead.
  117. .. option:: -N, --show-only[=<format>]
  118. Disable actual execution of tests.
  119. This option tells CTest to list the tests that would be run but not
  120. actually run them. Useful in conjunction with the :option:`-R <ctest -R>`
  121. and :option:`-E <ctest -E>` options.
  122. .. versionadded:: 3.14
  123. The ``--show-only`` option accepts a ``<format>`` value.
  124. ``<format>`` can be one of the following values.
  125. ``human``
  126. Human-friendly output. This is not guaranteed to be stable.
  127. This is the default.
  128. ``json-v1``
  129. Dump the test information in JSON format.
  130. See `Show as JSON Object Model`_.
  131. .. option:: -L <regex>, --label-regex <regex>
  132. Run tests with labels matching regular expression as described under
  133. :ref:`string(REGEX) <Regex Specification>`.
  134. This option tells CTest to run only the tests whose labels match the
  135. given regular expression. When more than one ``-L`` option is given,
  136. a test will only be run if each regular expression matches at least one
  137. of the test's labels (i.e. the multiple ``-L`` labels form an ``AND``
  138. relationship). See `Label Matching`_.
  139. .. option:: -R <regex>, --tests-regex <regex>
  140. Run tests matching regular expression.
  141. This option tells CTest to run only the tests whose names match the
  142. given regular expression.
  143. .. option:: -E <regex>, --exclude-regex <regex>
  144. Exclude tests matching regular expression.
  145. This option tells CTest to NOT run the tests whose names match the
  146. given regular expression.
  147. .. option:: -LE <regex>, --label-exclude <regex>
  148. Exclude tests with labels matching regular expression.
  149. This option tells CTest to NOT run the tests whose labels match the
  150. given regular expression. When more than one ``-LE`` option is given,
  151. a test will only be excluded if each regular expression matches at least one
  152. of the test's labels (i.e. the multiple ``-LE`` labels form an ``AND``
  153. relationship). See `Label Matching`_.
  154. .. option:: -FA <regex>, --fixture-exclude-any <regex>
  155. Exclude fixtures matching ``<regex>`` from automatically adding any tests to
  156. the test set.
  157. If a test in the set of tests to be executed requires a particular fixture,
  158. that fixture's setup and cleanup tests would normally be added to the test set
  159. automatically. This option prevents adding setup or cleanup tests for fixtures
  160. matching the ``<regex>``. Note that all other fixture behavior is retained,
  161. including test dependencies and skipping tests that have fixture setup tests
  162. that fail.
  163. .. option:: -FS <regex>, --fixture-exclude-setup <regex>
  164. Same as :option:`-FA <ctest -FA>` except only matching setup tests are
  165. excluded.
  166. .. option:: -FC <regex>, --fixture-exclude-cleanup <regex>
  167. Same as :option:`-FA <ctest -FA>` except only matching cleanup tests are
  168. excluded.
  169. .. option:: -I [Start,End,Stride,test#,test#|Test file], --tests-information
  170. Run a specific number of tests by number.
  171. This option causes CTest to run tests starting at number ``Start``,
  172. ending at number ``End``, and incrementing by ``Stride``. Any additional
  173. numbers after ``Stride`` are considered individual test numbers. ``Start``,
  174. ``End``, or ``Stride`` can be empty. Optionally a file can be given that
  175. contains the same syntax as the command line.
  176. .. option:: -U, --union
  177. Take the Union of :option:`-I <ctest -I>` and :option:`-R <ctest -R>`.
  178. When both :option:`-R <ctest -R>` and :option:`-I <ctest -I>` are specified
  179. by default the intersection of tests are run. By specifying ``-U`` the union
  180. of tests is run instead.
  181. .. option:: --rerun-failed
  182. Run only the tests that failed previously.
  183. This option tells CTest to perform only the tests that failed during
  184. its previous run. When this option is specified, CTest ignores all
  185. other options intended to modify the list of tests to run (
  186. :option:`-L <ctest -L>`, :option:`-R <ctest -R>`, :option:`-E <ctest -E>`,
  187. :option:`-LE <ctest -LE>`, :option:`-I <ctest -I>`, etc). In the event that
  188. CTest runs and no tests fail, subsequent calls to CTest with the
  189. ``--rerun-failed`` option will run the set of tests that most recently
  190. failed (if any).
  191. .. option:: --repeat <mode>:<n>
  192. Run tests repeatedly based on the given ``<mode>`` up to ``<n>`` times.
  193. The modes are:
  194. ``until-fail``
  195. Require each test to run ``<n>`` times without failing in order to pass.
  196. This is useful in finding sporadic failures in test cases.
  197. ``until-pass``
  198. Allow each test to run up to ``<n>`` times in order to pass.
  199. Repeats tests if they fail for any reason.
  200. This is useful in tolerating sporadic failures in test cases.
  201. ``after-timeout``
  202. Allow each test to run up to ``<n>`` times in order to pass.
  203. Repeats tests only if they timeout.
  204. This is useful in tolerating sporadic timeouts in test cases
  205. on busy machines.
  206. .. option:: --repeat-until-fail <n>
  207. Equivalent to :option:`--repeat until-fail:\<n\> <ctest --repeat>`.
  208. .. option:: --max-width <width>
  209. Set the max width for a test name to output.
  210. Set the maximum width for each test name to show in the output.
  211. This allows the user to widen the output to avoid clipping the test
  212. name which can be very annoying.
  213. .. option:: --interactive-debug-mode [0|1]
  214. Set the interactive mode to ``0`` or ``1``.
  215. This option causes CTest to run tests in either an interactive mode
  216. or a non-interactive mode. In dashboard mode (``Experimental``, ``Nightly``,
  217. ``Continuous``), the default is non-interactive. In non-interactive mode,
  218. the environment variable :envvar:`DASHBOARD_TEST_FROM_CTEST` is set.
  219. Prior to CMake 3.11, interactive mode on Windows allowed system debug
  220. popup windows to appear. Now, due to CTest's use of ``libuv`` to launch
  221. test processes, all system debug popup windows are always blocked.
  222. .. option:: --no-label-summary
  223. Disable timing summary information for labels.
  224. This option tells CTest not to print summary information for each
  225. label associated with the tests run. If there are no labels on the
  226. tests, nothing extra is printed.
  227. See `Label and Subproject Summary`_.
  228. .. option:: --no-subproject-summary
  229. Disable timing summary information for subprojects.
  230. This option tells CTest not to print summary information for each
  231. subproject associated with the tests run. If there are no subprojects on the
  232. tests, nothing extra is printed.
  233. See `Label and Subproject Summary`_.
  234. .. option:: --test-dir <dir>
  235. Specify the directory in which to look for tests, typically a CMake project
  236. build directory. If not specified, the current directory is used.
  237. .. option:: --test-output-size-passed <size>
  238. .. versionadded:: 3.4
  239. Limit the output for passed tests to ``<size>`` bytes.
  240. .. option:: --test-output-size-failed <size>
  241. .. versionadded:: 3.4
  242. Limit the output for failed tests to ``<size>`` bytes.
  243. .. option:: --test-output-truncation <mode>
  244. .. versionadded:: 3.24
  245. Truncate ``tail`` (default), ``middle`` or ``head`` of test output once
  246. maximum output size is reached.
  247. .. option:: --overwrite
  248. Overwrite CTest configuration option.
  249. By default CTest uses configuration options from configuration file.
  250. This option will overwrite the configuration option.
  251. .. option:: --force-new-ctest-process
  252. Run child CTest instances as new processes.
  253. By default CTest will run child CTest instances within the same
  254. process. If this behavior is not desired, this argument will
  255. enforce new processes for child CTest processes.
  256. .. option:: --schedule-random
  257. Use a random order for scheduling tests.
  258. This option will run the tests in a random order. It is commonly
  259. used to detect implicit dependencies in a test suite.
  260. .. option:: --submit-index
  261. Legacy option for old Dart2 dashboard server feature.
  262. Do not use.
  263. .. option:: --timeout <seconds>
  264. Set the default test timeout.
  265. This option effectively sets a timeout on all tests that do not
  266. already have a timeout set on them via the :prop_test:`TIMEOUT`
  267. property.
  268. .. option:: --stop-time <time>
  269. Set a time at which all tests should stop running.
  270. Set a real time of day at which all tests should timeout. Example:
  271. ``7:00:00 -0400``. Any time format understood by the curl date parser
  272. is accepted. Local time is assumed if no timezone is specified.
  273. .. option:: --print-labels
  274. Print all available test labels.
  275. This option will not run any tests, it will simply print the list of
  276. all labels associated with the test set.
  277. .. option:: --no-tests=<action>
  278. Regard no tests found either as error (when ``<action>`` is set to
  279. ``error``) or ignore it (when ``<action>`` is set to ``ignore``).
  280. If no tests were found, the default behavior of CTest is to always log an
  281. error message but to return an error code in script mode only. This option
  282. unifies the behavior of CTest by either returning an error code if no tests
  283. were found or by ignoring it.
  284. .. versionadded:: 3.26
  285. This option can also be set by setting the :envvar:`CTEST_NO_TESTS_ACTION`
  286. environment variable.
  287. View Help
  288. =========
  289. To print version details or selected pages from the CMake documentation,
  290. use one of the following options:
  291. .. include:: OPTIONS_HELP.txt
  292. .. _`Label Matching`:
  293. Label Matching
  294. ==============
  295. Tests may have labels attached to them. Tests may be included
  296. or excluded from a test run by filtering on the labels.
  297. Each individual filter is a regular expression applied to
  298. the labels attached to a test.
  299. When :option:`-L <ctest -L>` is used, in order for a test to be included in a
  300. test run, each regular expression must match at least one
  301. label. Using more than one :option:`-L <ctest -L>` option means "match **all**
  302. of these".
  303. The :option:`-LE <ctest -LE>` option works just like :option:`-L <ctest -L>`,
  304. but excludes tests rather than including them. A test is excluded if each
  305. regular expression matches at least one label.
  306. If a test has no labels attached to it, then :option:`-L <ctest -L>` will never
  307. include that test, and :option:`-LE <ctest -LE>` will never exclude that test.
  308. As an example of tests with labels, consider five tests,
  309. with the following labels:
  310. * *test1* has labels *tuesday* and *production*
  311. * *test2* has labels *tuesday* and *test*
  312. * *test3* has labels *wednesday* and *production*
  313. * *test4* has label *wednesday*
  314. * *test5* has labels *friday* and *test*
  315. Running :program:`ctest` with ``-L tuesday -L test`` will select *test2*, which has
  316. both labels. Running CTest with ``-L test`` will select *test2* and
  317. *test5*, because both of them have a label that matches that regular
  318. expression.
  319. Because the matching works with regular expressions, take note that
  320. running CTest with ``-L es`` will match all five tests.
  321. To select the *tuesday* and *wednesday* tests together, use a single
  322. regular expression that matches either of them, like ``-L "tue|wed"``.
  323. .. _`Label and Subproject Summary`:
  324. Label and Subproject Summary
  325. ============================
  326. CTest prints timing summary information for each ``LABEL`` and subproject
  327. associated with the tests run. The label time summary will not include labels
  328. that are mapped to subprojects.
  329. .. versionadded:: 3.22
  330. Labels added dynamically during test execution are also reported in the
  331. timing summary. See :ref:`Additional Labels`.
  332. When the :prop_test:`PROCESSORS` test property is set, CTest will display a
  333. weighted test timing result in label and subproject summaries. The time is
  334. reported with `sec*proc` instead of just `sec`.
  335. The weighted time summary reported for each label or subproject ``j``
  336. is computed as::
  337. Weighted Time Summary for Label/Subproject j =
  338. sum(raw_test_time[j,i] * num_processors[j,i], i=1...num_tests[j])
  339. for labels/subprojects j=1...total
  340. where:
  341. * ``raw_test_time[j,i]``: Wall-clock time for the ``i`` test
  342. for the ``j`` label or subproject
  343. * ``num_processors[j,i]``: Value of the CTest :prop_test:`PROCESSORS` property
  344. for the ``i`` test for the ``j`` label or subproject
  345. * ``num_tests[j]``: Number of tests associated with the ``j`` label or subproject
  346. * ``total``: Total number of labels or subprojects that have at least one test run
  347. Therefore, the weighted time summary for each label or subproject represents
  348. the amount of time that CTest gave to run the tests for each label or
  349. subproject and gives a good representation of the total expense of the tests
  350. for each label or subproject when compared to other labels or subprojects.
  351. For example, if ``SubprojectA`` showed ``100 sec*proc`` and ``SubprojectB`` showed
  352. ``10 sec*proc``, then CTest allocated approximately 10 times the CPU/core time
  353. to run the tests for ``SubprojectA`` than for ``SubprojectB`` (e.g. so if effort
  354. is going to be expended to reduce the cost of the test suite for the whole
  355. project, then reducing the cost of the test suite for ``SubprojectA`` would
  356. likely have a larger impact than effort to reduce the cost of the test suite
  357. for ``SubprojectB``).
  358. .. _`Build and Test Mode`:
  359. Build and Test Mode
  360. ===================
  361. CTest provides a command-line signature to configure (i.e. run cmake on),
  362. build, and/or execute a test::
  363. ctest --build-and-test <path-to-source> <path-to-build>
  364. --build-generator <generator>
  365. [<options>...]
  366. [--build-options <opts>...]
  367. [--test-command <command> [<args>...]]
  368. The configure and test steps are optional. The arguments to this command line
  369. are the source and binary directories. The ``--build-generator`` option *must*
  370. be provided to use ``--build-and-test``. If ``--test-command`` is specified
  371. then that will be run after the build is complete. Other options that affect
  372. this mode include:
  373. .. option:: --build-and-test
  374. Switch into the build and test mode.
  375. .. option:: --build-target
  376. Specify a specific target to build. The option can be given multiple times
  377. with different targets, in which case each target is built in turn.
  378. A clean will be done before building each target unless the
  379. :option:`--build-noclean` option is given.
  380. If no ``--build-target`` is specified, the ``all`` target is built.
  381. .. option:: --build-nocmake
  382. Run the build without running cmake first.
  383. Skip the cmake step.
  384. .. option:: --build-run-dir
  385. Specify directory to run programs from.
  386. Directory where programs will be after it has been compiled.
  387. .. option:: --build-two-config
  388. Run CMake twice.
  389. .. option:: --build-exe-dir
  390. Specify the directory for the executable.
  391. .. option:: --build-generator
  392. Specify the generator to use. See the :manual:`cmake-generators(7)` manual.
  393. .. option:: --build-generator-platform
  394. Specify the generator-specific platform.
  395. .. option:: --build-generator-toolset
  396. Specify the generator-specific toolset.
  397. .. option:: --build-project
  398. Specify the name of the project to build.
  399. .. option:: --build-makeprogram
  400. Specify the explicit make program to be used by CMake when configuring and
  401. building the project. Only applicable for Make and Ninja based generators.
  402. .. option:: --build-noclean
  403. Skip the make clean step.
  404. .. option:: --build-config-sample
  405. A sample executable to use to determine the configuration that
  406. should be used. e.g. ``Debug``, ``Release`` etc.
  407. .. option:: --build-options
  408. Additional options for configuring the build (i.e. for CMake, not for
  409. the build tool). Note that if this is specified, the ``--build-options``
  410. keyword and its arguments must be the last option given on the command
  411. line, with the possible exception of ``--test-command``.
  412. .. option:: --test-command
  413. The command to run as the test step with the
  414. :option:`--build-and-test <ctest --build-and-test>` option.
  415. All arguments following this keyword will be assumed to be part of the
  416. test command line, so it must be the last option given.
  417. .. option:: --test-timeout
  418. The time limit in seconds
  419. .. _`Dashboard Client`:
  420. Dashboard Client
  421. ================
  422. CTest can operate as a client for the `CDash`_ software quality dashboard
  423. application. As a dashboard client, CTest performs a sequence of steps
  424. to configure, build, and test software, and then submits the results to
  425. a `CDash`_ server. The command-line signature used to submit to `CDash`_ is::
  426. ctest -D <dashboard> [-- <dashboard-options>...]
  427. ctest -M <model> -T <action> [-- <dashboard-options>...]
  428. ctest -S <script> [-- <dashboard-options>...]
  429. ctest -SP <script> [-- <dashboard-options>...]
  430. .. _`CDash`: https://www.cdash.org
  431. Options for Dashboard Client include:
  432. .. option:: -D <dashboard>, --dashboard <dashboard>
  433. Execute dashboard test.
  434. This option tells CTest to act as a CDash client and perform a
  435. dashboard test. All tests are ``<Mode><Test>``, where ``<Mode>`` can be
  436. ``Experimental``, ``Nightly``, and ``Continuous``, and ``<Test>`` can be
  437. ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  438. ``Coverage``, and ``Submit``.
  439. If ``<dashboard>`` is not one of the recognized ``<Mode><Test>`` values,
  440. this will be treated as a variable definition instead (see the
  441. :ref:`dashboard-options <Dashboard Options>` further below).
  442. .. option:: -M <model>, --test-model <model>
  443. Sets the model for a dashboard.
  444. This option tells CTest to act as a CDash client where the ``<model>``
  445. can be ``Experimental``, ``Nightly``, and ``Continuous``.
  446. Combining ``-M`` and :option:`-T <ctest -T>` is similar to
  447. :option:`-D <ctest -D>`.
  448. .. option:: -T <action>, --test-action <action>
  449. Sets the dashboard action to perform.
  450. This option tells CTest to act as a CDash client and perform some
  451. action such as ``start``, ``build``, ``test`` etc. See
  452. `Dashboard Client Steps`_ for the full list of actions.
  453. Combining :option:`-M <ctest -M>` and ``-T`` is similar to
  454. :option:`-D <ctest -D>`.
  455. .. option:: -S <script>, --script <script>
  456. Execute a dashboard for a configuration.
  457. This option tells CTest to load in a configuration script which sets
  458. a number of parameters such as the binary and source directories.
  459. Then CTest will do what is required to create and run a dashboard.
  460. This option basically sets up a dashboard and then runs :option:`ctest -D`
  461. with the appropriate options.
  462. .. option:: -SP <script>, --script-new-process <script>
  463. Execute a dashboard for a configuration.
  464. This option does the same operations as :option:`-S <ctest -S>` but it
  465. will do them in a separate process. This is primarily useful in cases
  466. where the script may modify the environment and you do not want the modified
  467. environment to impact other :option:`-S <ctest -S>` scripts.
  468. .. _`Dashboard Options`:
  469. The available ``<dashboard-options>`` are the following:
  470. .. option:: -D <var>:<type>=<value>
  471. Define a variable for script mode.
  472. Pass in variable values on the command line. Use in conjunction
  473. with :option:`-S <ctest -S>` to pass variable values to a dashboard script.
  474. Parsing ``-D`` arguments as variable values is only attempted if the value
  475. following ``-D`` does not match any of the known dashboard types.
  476. .. option:: --group <group>
  477. Specify what group you'd like to submit results to
  478. Submit dashboard to specified group instead of default one. By
  479. default, the dashboard is submitted to Nightly, Experimental, or
  480. Continuous group, but by specifying this option, the group can be
  481. arbitrary.
  482. This replaces the deprecated option ``--track``.
  483. Despite the name change its behavior is unchanged.
  484. .. option:: -A <file>, --add-notes <file>
  485. Add a notes file with submission.
  486. This option tells CTest to include a notes file when submitting
  487. dashboard.
  488. .. option:: --tomorrow-tag
  489. ``Nightly`` or ``Experimental`` starts with next day tag.
  490. This is useful if the build will not finish in one day.
  491. .. option:: --extra-submit <file>[;<file>]
  492. Submit extra files to the dashboard.
  493. This option will submit extra files to the dashboard.
  494. .. option:: --http1.0
  495. Submit using `HTTP 1.0`.
  496. This option will force CTest to use `HTTP 1.0` to submit files to the
  497. dashboard, instead of `HTTP 1.1`.
  498. .. option:: --no-compress-output
  499. Do not compress test output when submitting.
  500. This flag will turn off automatic compression of test output. Use
  501. this to maintain compatibility with an older version of CDash which
  502. doesn't support compressed test output.
  503. Dashboard Client Steps
  504. ----------------------
  505. CTest defines an ordered list of testing steps of which some or all may
  506. be run as a dashboard client:
  507. ``Start``
  508. Start a new dashboard submission to be composed of results recorded
  509. by the following steps.
  510. See the `CTest Start Step`_ section below.
  511. ``Update``
  512. Update the source tree from its version control repository.
  513. Record the old and new versions and the list of updated source files.
  514. See the `CTest Update Step`_ section below.
  515. ``Configure``
  516. Configure the software by running a command in the build tree.
  517. Record the configuration output log.
  518. See the `CTest Configure Step`_ section below.
  519. ``Build``
  520. Build the software by running a command in the build tree.
  521. Record the build output log and detect warnings and errors.
  522. See the `CTest Build Step`_ section below.
  523. ``Test``
  524. Test the software by loading a ``CTestTestfile.cmake``
  525. from the build tree and executing the defined tests.
  526. Record the output and result of each test.
  527. See the `CTest Test Step`_ section below.
  528. ``Coverage``
  529. Compute coverage of the source code by running a coverage
  530. analysis tool and recording its output.
  531. See the `CTest Coverage Step`_ section below.
  532. ``MemCheck``
  533. Run the software test suite through a memory check tool.
  534. Record the test output, results, and issues reported by the tool.
  535. See the `CTest MemCheck Step`_ section below.
  536. ``Submit``
  537. Submit results recorded from other testing steps to the
  538. software quality dashboard server.
  539. See the `CTest Submit Step`_ section below.
  540. Dashboard Client Modes
  541. ----------------------
  542. CTest defines three modes of operation as a dashboard client:
  543. ``Nightly``
  544. This mode is intended to be invoked once per day, typically at night.
  545. It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  546. ``Coverage``, and ``Submit`` steps by default. Selected steps run even
  547. if the ``Update`` step reports no changes to the source tree.
  548. ``Continuous``
  549. This mode is intended to be invoked repeatedly throughout the day.
  550. It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
  551. ``Coverage``, and ``Submit`` steps by default, but exits after the
  552. ``Update`` step if it reports no changes to the source tree.
  553. ``Experimental``
  554. This mode is intended to be invoked by a developer to test local changes.
  555. It enables the ``Start``, ``Configure``, ``Build``, ``Test``, ``Coverage``,
  556. and ``Submit`` steps by default.
  557. Dashboard Client via CTest Command-Line
  558. ---------------------------------------
  559. CTest can perform testing on an already-generated build tree.
  560. Run the :program:`ctest` command with the current working directory set
  561. to the build tree and use one of these signatures::
  562. ctest -D <mode>[<step>]
  563. ctest -M <mode> [-T <step>]...
  564. The ``<mode>`` must be one of the above `Dashboard Client Modes`_,
  565. and each ``<step>`` must be one of the above `Dashboard Client Steps`_.
  566. CTest reads the `Dashboard Client Configuration`_ settings from
  567. a file in the build tree called either ``CTestConfiguration.ini``
  568. or ``DartConfiguration.tcl`` (the names are historical). The format
  569. of the file is::
  570. # Lines starting in '#' are comments.
  571. # Other non-blank lines are key-value pairs.
  572. <setting>: <value>
  573. where ``<setting>`` is the setting name and ``<value>`` is the
  574. setting value.
  575. In build trees generated by CMake, this configuration file is
  576. generated by the :module:`CTest` module if included by the project.
  577. The module uses variables to obtain a value for each setting
  578. as documented with the settings below.
  579. .. _`CTest Script`:
  580. Dashboard Client via CTest Script
  581. ---------------------------------
  582. CTest can perform testing driven by a :manual:`cmake-language(7)`
  583. script that creates and maintains the source and build tree as
  584. well as performing the testing steps. Run the :program:`ctest` command
  585. with the current working directory set outside of any build tree
  586. and use one of these signatures::
  587. ctest -S <script>
  588. ctest -SP <script>
  589. The ``<script>`` file must call :ref:`CTest Commands` commands
  590. to run testing steps explicitly as documented below. The commands
  591. obtain `Dashboard Client Configuration`_ settings from their
  592. arguments or from variables set in the script.
  593. Dashboard Client Configuration
  594. ==============================
  595. The `Dashboard Client Steps`_ may be configured by named
  596. settings as documented in the following sections.
  597. .. _`CTest Start Step`:
  598. CTest Start Step
  599. ----------------
  600. Start a new dashboard submission to be composed of results recorded
  601. by the following steps.
  602. In a `CTest Script`_, the :command:`ctest_start` command runs this step.
  603. Arguments to the command may specify some of the step settings.
  604. The command first runs the command-line specified by the
  605. ``CTEST_CHECKOUT_COMMAND`` variable, if set, to initialize the source
  606. directory.
  607. Configuration settings include:
  608. ``BuildDirectory``
  609. The full path to the project build tree.
  610. * `CTest Script`_ variable: :variable:`CTEST_BINARY_DIRECTORY`
  611. * :module:`CTest` module variable: :variable:`PROJECT_BINARY_DIR`
  612. ``SourceDirectory``
  613. The full path to the project source tree.
  614. * `CTest Script`_ variable: :variable:`CTEST_SOURCE_DIRECTORY`
  615. * :module:`CTest` module variable: :variable:`PROJECT_SOURCE_DIR`
  616. .. _`CTest Update Step`:
  617. CTest Update Step
  618. -----------------
  619. In a `CTest Script`_, the :command:`ctest_update` command runs this step.
  620. Arguments to the command may specify some of the step settings.
  621. Configuration settings to specify the version control tool include:
  622. ``BZRCommand``
  623. ``bzr`` command-line tool to use if source tree is managed by Bazaar.
  624. * `CTest Script`_ variable: :variable:`CTEST_BZR_COMMAND`
  625. * :module:`CTest` module variable: none
  626. ``BZRUpdateOptions``
  627. Command-line options to the ``BZRCommand`` when updating the source.
  628. * `CTest Script`_ variable: :variable:`CTEST_BZR_UPDATE_OPTIONS`
  629. * :module:`CTest` module variable: none
  630. ``CVSCommand``
  631. ``cvs`` command-line tool to use if source tree is managed by CVS.
  632. * `CTest Script`_ variable: :variable:`CTEST_CVS_COMMAND`
  633. * :module:`CTest` module variable: ``CVSCOMMAND``
  634. ``CVSUpdateOptions``
  635. Command-line options to the ``CVSCommand`` when updating the source.
  636. * `CTest Script`_ variable: :variable:`CTEST_CVS_UPDATE_OPTIONS`
  637. * :module:`CTest` module variable: ``CVS_UPDATE_OPTIONS``
  638. ``GITCommand``
  639. ``git`` command-line tool to use if source tree is managed by Git.
  640. * `CTest Script`_ variable: :variable:`CTEST_GIT_COMMAND`
  641. * :module:`CTest` module variable: ``GITCOMMAND``
  642. The source tree is updated by ``git fetch`` followed by
  643. ``git reset --hard`` to the ``FETCH_HEAD``. The result is the same
  644. as ``git pull`` except that any local modifications are overwritten.
  645. Use ``GITUpdateCustom`` to specify a different approach.
  646. ``GITInitSubmodules``
  647. If set, CTest will update the repository's submodules before updating.
  648. * `CTest Script`_ variable: :variable:`CTEST_GIT_INIT_SUBMODULES`
  649. * :module:`CTest` module variable: ``CTEST_GIT_INIT_SUBMODULES``
  650. ``GITUpdateCustom``
  651. Specify a custom command line (as a semicolon-separated list) to run
  652. in the source tree (Git work tree) to update it instead of running
  653. the ``GITCommand``.
  654. * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_CUSTOM`
  655. * :module:`CTest` module variable: ``CTEST_GIT_UPDATE_CUSTOM``
  656. ``GITUpdateOptions``
  657. Command-line options to the ``GITCommand`` when updating the source.
  658. * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_OPTIONS`
  659. * :module:`CTest` module variable: ``GIT_UPDATE_OPTIONS``
  660. ``HGCommand``
  661. ``hg`` command-line tool to use if source tree is managed by Mercurial.
  662. * `CTest Script`_ variable: :variable:`CTEST_HG_COMMAND`
  663. * :module:`CTest` module variable: none
  664. ``HGUpdateOptions``
  665. Command-line options to the ``HGCommand`` when updating the source.
  666. * `CTest Script`_ variable: :variable:`CTEST_HG_UPDATE_OPTIONS`
  667. * :module:`CTest` module variable: none
  668. ``P4Client``
  669. Value of the ``-c`` option to the ``P4Command``.
  670. * `CTest Script`_ variable: :variable:`CTEST_P4_CLIENT`
  671. * :module:`CTest` module variable: ``CTEST_P4_CLIENT``
  672. ``P4Command``
  673. ``p4`` command-line tool to use if source tree is managed by Perforce.
  674. * `CTest Script`_ variable: :variable:`CTEST_P4_COMMAND`
  675. * :module:`CTest` module variable: ``P4COMMAND``
  676. ``P4Options``
  677. Command-line options to the ``P4Command`` for all invocations.
  678. * `CTest Script`_ variable: :variable:`CTEST_P4_OPTIONS`
  679. * :module:`CTest` module variable: ``CTEST_P4_OPTIONS``
  680. ``P4UpdateCustom``
  681. Specify a custom command line (as a semicolon-separated list) to run
  682. in the source tree (Perforce tree) to update it instead of running
  683. the ``P4Command``.
  684. * `CTest Script`_ variable: none
  685. * :module:`CTest` module variable: ``CTEST_P4_UPDATE_CUSTOM``
  686. ``P4UpdateOptions``
  687. Command-line options to the ``P4Command`` when updating the source.
  688. * `CTest Script`_ variable: :variable:`CTEST_P4_UPDATE_OPTIONS`
  689. * :module:`CTest` module variable: ``CTEST_P4_UPDATE_OPTIONS``
  690. ``SVNCommand``
  691. ``svn`` command-line tool to use if source tree is managed by Subversion.
  692. * `CTest Script`_ variable: :variable:`CTEST_SVN_COMMAND`
  693. * :module:`CTest` module variable: ``SVNCOMMAND``
  694. ``SVNOptions``
  695. Command-line options to the ``SVNCommand`` for all invocations.
  696. * `CTest Script`_ variable: :variable:`CTEST_SVN_OPTIONS`
  697. * :module:`CTest` module variable: ``CTEST_SVN_OPTIONS``
  698. ``SVNUpdateOptions``
  699. Command-line options to the ``SVNCommand`` when updating the source.
  700. * `CTest Script`_ variable: :variable:`CTEST_SVN_UPDATE_OPTIONS`
  701. * :module:`CTest` module variable: ``SVN_UPDATE_OPTIONS``
  702. ``UpdateCommand``
  703. Specify the version-control command-line tool to use without
  704. detecting the VCS that manages the source tree.
  705. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_COMMAND`
  706. * :module:`CTest` module variable: ``<VCS>COMMAND``
  707. when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_COMMAND``
  708. ``UpdateOptions``
  709. Command-line options to the ``UpdateCommand``.
  710. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_OPTIONS`
  711. * :module:`CTest` module variable: ``<VCS>_UPDATE_OPTIONS``
  712. when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_OPTIONS``
  713. ``UpdateType``
  714. Specify the version-control system that manages the source
  715. tree if it cannot be detected automatically.
  716. The value may be ``bzr``, ``cvs``, ``git``, ``hg``,
  717. ``p4``, or ``svn``.
  718. * `CTest Script`_ variable: none, detected from source tree
  719. * :module:`CTest` module variable: ``UPDATE_TYPE`` if set,
  720. else ``CTEST_UPDATE_TYPE``
  721. .. _`UpdateVersionOnly`:
  722. ``UpdateVersionOnly``
  723. Specify that you want the version control update command to only
  724. discover the current version that is checked out, and not to update
  725. to a different version.
  726. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_VERSION_ONLY`
  727. .. _`UpdateVersionOverride`:
  728. ``UpdateVersionOverride``
  729. Specify the current version of your source tree.
  730. When this variable is set to a non-empty string, CTest will report the value
  731. you specified rather than using the update command to discover the current
  732. version that is checked out. Use of this variable supersedes
  733. ``UpdateVersionOnly``. Like ``UpdateVersionOnly``, using this variable tells
  734. CTest not to update the source tree to a different version.
  735. * `CTest Script`_ variable: :variable:`CTEST_UPDATE_VERSION_OVERRIDE`
  736. Additional configuration settings include:
  737. ``NightlyStartTime``
  738. In the ``Nightly`` dashboard mode, specify the "nightly start time".
  739. With centralized version control systems (``cvs`` and ``svn``),
  740. the ``Update`` step checks out the version of the software as of
  741. this time so that multiple clients choose a common version to test.
  742. This is not well-defined in distributed version-control systems so
  743. the setting is ignored.
  744. * `CTest Script`_ variable: :variable:`CTEST_NIGHTLY_START_TIME`
  745. * :module:`CTest` module variable: ``NIGHTLY_START_TIME`` if set,
  746. else ``CTEST_NIGHTLY_START_TIME``
  747. .. _`CTest Configure Step`:
  748. CTest Configure Step
  749. --------------------
  750. In a `CTest Script`_, the :command:`ctest_configure` command runs this step.
  751. Arguments to the command may specify some of the step settings.
  752. Configuration settings include:
  753. ``ConfigureCommand``
  754. Command-line to launch the software configuration process.
  755. It will be executed in the location specified by the
  756. ``BuildDirectory`` setting.
  757. * `CTest Script`_ variable: :variable:`CTEST_CONFIGURE_COMMAND`
  758. * :module:`CTest` module variable: :variable:`CMAKE_COMMAND`
  759. followed by :variable:`PROJECT_SOURCE_DIR`
  760. ``LabelsForSubprojects``
  761. Specify a semicolon-separated list of labels that will be treated as
  762. subprojects. This mapping will be passed on to CDash when configure, test or
  763. build results are submitted.
  764. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  765. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  766. See `Label and Subproject Summary`_.
  767. .. _`CTest Build Step`:
  768. CTest Build Step
  769. ----------------
  770. In a `CTest Script`_, the :command:`ctest_build` command runs this step.
  771. Arguments to the command may specify some of the step settings.
  772. Configuration settings include:
  773. ``DefaultCTestConfigurationType``
  774. When the build system to be launched allows build-time selection
  775. of the configuration (e.g. ``Debug``, ``Release``), this specifies
  776. the default configuration to be built when no :option:`-C <ctest -C>`
  777. option is given to the :program:`ctest` command. The value will be substituted
  778. into the value of ``MakeCommand`` to replace the literal string
  779. ``${CTEST_CONFIGURATION_TYPE}`` if it appears.
  780. * `CTest Script`_ variable: :variable:`CTEST_CONFIGURATION_TYPE`
  781. * :module:`CTest` module variable: ``DEFAULT_CTEST_CONFIGURATION_TYPE``,
  782. initialized by the :envvar:`CMAKE_CONFIG_TYPE` environment variable
  783. ``LabelsForSubprojects``
  784. Specify a semicolon-separated list of labels that will be treated as
  785. subprojects. This mapping will be passed on to CDash when configure, test or
  786. build results are submitted.
  787. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  788. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  789. See `Label and Subproject Summary`_.
  790. ``MakeCommand``
  791. Command-line to launch the software build process.
  792. It will be executed in the location specified by the
  793. ``BuildDirectory`` setting.
  794. * `CTest Script`_ variable: :variable:`CTEST_BUILD_COMMAND`
  795. * :module:`CTest` module variable: ``MAKECOMMAND``,
  796. initialized by the :command:`build_command` command
  797. ``UseLaunchers``
  798. For build trees generated by CMake using one of the
  799. :ref:`Makefile Generators` or the :generator:`Ninja`
  800. generator, specify whether the
  801. ``CTEST_USE_LAUNCHERS`` feature is enabled by the
  802. :module:`CTestUseLaunchers` module (also included by the
  803. :module:`CTest` module). When enabled, the generated build
  804. system wraps each invocation of the compiler, linker, or
  805. custom command line with a "launcher" that communicates
  806. with CTest via environment variables and files to report
  807. granular build warning and error information. Otherwise,
  808. CTest must "scrape" the build output log for diagnostics.
  809. * `CTest Script`_ variable: :variable:`CTEST_USE_LAUNCHERS`
  810. * :module:`CTest` module variable: ``CTEST_USE_LAUNCHERS``
  811. .. _`CTest Test Step`:
  812. CTest Test Step
  813. ---------------
  814. In a `CTest Script`_, the :command:`ctest_test` command runs this step.
  815. Arguments to the command may specify some of the step settings.
  816. Configuration settings include:
  817. ``ResourceSpecFile``
  818. Specify a
  819. :ref:`resource specification file <ctest-resource-specification-file>`.
  820. * `CTest Script`_ variable: :variable:`CTEST_RESOURCE_SPEC_FILE`
  821. * :module:`CTest` module variable: ``CTEST_RESOURCE_SPEC_FILE``
  822. See :ref:`ctest-resource-allocation` for more information.
  823. ``LabelsForSubprojects``
  824. Specify a semicolon-separated list of labels that will be treated as
  825. subprojects. This mapping will be passed on to CDash when configure, test or
  826. build results are submitted.
  827. * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
  828. * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
  829. See `Label and Subproject Summary`_.
  830. ``TestLoad``
  831. While running tests in parallel (e.g. with :option:`-j <ctest -j>`),
  832. try not to start tests when they may cause the CPU load to pass above
  833. a given threshold.
  834. * `CTest Script`_ variable: :variable:`CTEST_TEST_LOAD`
  835. * :module:`CTest` module variable: ``CTEST_TEST_LOAD``
  836. ``TimeOut``
  837. The default timeout for each test if not specified by the
  838. :prop_test:`TIMEOUT` test property or the
  839. :option:`--timeout <ctest --timeout>` flag.
  840. * `CTest Script`_ variable: :variable:`CTEST_TEST_TIMEOUT`
  841. * :module:`CTest` module variable: ``DART_TESTING_TIMEOUT``
  842. To report extra test values to CDash, see :ref:`Additional Test Measurements`.
  843. .. _`CTest Coverage Step`:
  844. CTest Coverage Step
  845. -------------------
  846. In a `CTest Script`_, the :command:`ctest_coverage` command runs this step.
  847. Arguments to the command may specify some of the step settings.
  848. Configuration settings include:
  849. ``CoverageCommand``
  850. Command-line tool to perform software coverage analysis.
  851. It will be executed in the location specified by the
  852. ``BuildDirectory`` setting.
  853. * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_COMMAND`
  854. * :module:`CTest` module variable: ``COVERAGE_COMMAND``
  855. ``CoverageExtraFlags``
  856. Specify command-line options to the ``CoverageCommand`` tool.
  857. * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_EXTRA_FLAGS`
  858. * :module:`CTest` module variable: ``COVERAGE_EXTRA_FLAGS``
  859. These options are the first arguments passed to ``CoverageCommand``.
  860. .. _`CTest MemCheck Step`:
  861. CTest MemCheck Step
  862. -------------------
  863. In a `CTest Script`_, the :command:`ctest_memcheck` command runs this step.
  864. Arguments to the command may specify some of the step settings.
  865. Configuration settings include:
  866. ``MemoryCheckCommand``
  867. Command-line tool to perform dynamic analysis. Test command lines
  868. will be launched through this tool.
  869. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND`
  870. * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND``
  871. ``MemoryCheckCommandOptions``
  872. Specify command-line options to the ``MemoryCheckCommand`` tool.
  873. They will be placed prior to the test command line.
  874. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND_OPTIONS`
  875. * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND_OPTIONS``
  876. ``MemoryCheckType``
  877. Specify the type of memory checking to perform.
  878. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_TYPE`
  879. * :module:`CTest` module variable: ``MEMORYCHECK_TYPE``
  880. ``MemoryCheckSanitizerOptions``
  881. Specify options to sanitizers when running with a sanitize-enabled build.
  882. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SANITIZER_OPTIONS`
  883. * :module:`CTest` module variable: ``MEMORYCHECK_SANITIZER_OPTIONS``
  884. ``MemoryCheckSuppressionFile``
  885. Specify a file containing suppression rules for the
  886. ``MemoryCheckCommand`` tool. It will be passed with options
  887. appropriate to the tool.
  888. * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SUPPRESSIONS_FILE`
  889. * :module:`CTest` module variable: ``MEMORYCHECK_SUPPRESSIONS_FILE``
  890. Additional configuration settings include:
  891. ``BoundsCheckerCommand``
  892. Specify a ``MemoryCheckCommand`` that is known to be command-line
  893. compatible with Bounds Checker.
  894. * `CTest Script`_ variable: none
  895. * :module:`CTest` module variable: none
  896. ``PurifyCommand``
  897. Specify a ``MemoryCheckCommand`` that is known to be command-line
  898. compatible with Purify.
  899. * `CTest Script`_ variable: none
  900. * :module:`CTest` module variable: ``PURIFYCOMMAND``
  901. ``ValgrindCommand``
  902. Specify a ``MemoryCheckCommand`` that is known to be command-line
  903. compatible with Valgrind.
  904. * `CTest Script`_ variable: none
  905. * :module:`CTest` module variable: ``VALGRIND_COMMAND``
  906. ``ValgrindCommandOptions``
  907. Specify command-line options to the ``ValgrindCommand`` tool.
  908. They will be placed prior to the test command line.
  909. * `CTest Script`_ variable: none
  910. * :module:`CTest` module variable: ``VALGRIND_COMMAND_OPTIONS``
  911. ``DrMemoryCommand``
  912. Specify a ``MemoryCheckCommand`` that is known to be a command-line
  913. compatible with DrMemory.
  914. * `CTest Script`_ variable: none
  915. * :module:`CTest` module variable: ``DRMEMORY_COMMAND``
  916. ``DrMemoryCommandOptions``
  917. Specify command-line options to the ``DrMemoryCommand`` tool.
  918. They will be placed prior to the test command line.
  919. * `CTest Script`_ variable: none
  920. * :module:`CTest` module variable: ``DRMEMORY_COMMAND_OPTIONS``
  921. ``CudaSanitizerCommand``
  922. Specify a ``MemoryCheckCommand`` that is known to be a command-line
  923. compatible with cuda-memcheck or compute-sanitizer.
  924. * `CTest Script`_ variable: none
  925. * :module:`CTest` module variable: ``CUDA_SANITIZER_COMMAND``
  926. ``CudaSanitizerCommandOptions``
  927. Specify command-line options to the ``CudaSanitizerCommand`` tool.
  928. They will be placed prior to the test command line.
  929. * `CTest Script`_ variable: none
  930. * :module:`CTest` module variable: ``CUDA_SANITIZER_COMMAND_OPTIONS``
  931. .. _`CTest Submit Step`:
  932. CTest Submit Step
  933. -----------------
  934. In a `CTest Script`_, the :command:`ctest_submit` command runs this step.
  935. Arguments to the command may specify some of the step settings.
  936. Configuration settings include:
  937. ``BuildName``
  938. Describe the dashboard client platform with a short string.
  939. (Operating system, compiler, etc.)
  940. * `CTest Script`_ variable: :variable:`CTEST_BUILD_NAME`
  941. * :module:`CTest` module variable: ``BUILDNAME``
  942. ``CDashVersion``
  943. Legacy option. Not used.
  944. * `CTest Script`_ variable: none, detected from server
  945. * :module:`CTest` module variable: ``CTEST_CDASH_VERSION``
  946. ``CTestSubmitRetryCount``
  947. Specify a number of attempts to retry submission on network failure.
  948. * `CTest Script`_ variable: none,
  949. use the :command:`ctest_submit` ``RETRY_COUNT`` option.
  950. * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_COUNT``
  951. ``CTestSubmitRetryDelay``
  952. Specify a delay before retrying submission on network failure.
  953. * `CTest Script`_ variable: none,
  954. use the :command:`ctest_submit` ``RETRY_DELAY`` option.
  955. * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_DELAY``
  956. ``CurlOptions``
  957. Specify a semicolon-separated list of options to control the
  958. Curl library that CTest uses internally to connect to the
  959. server. Possible options are ``CURLOPT_SSL_VERIFYPEER_OFF``
  960. and ``CURLOPT_SSL_VERIFYHOST_OFF``.
  961. * `CTest Script`_ variable: :variable:`CTEST_CURL_OPTIONS`
  962. * :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
  963. ``DropLocation``
  964. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  965. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  966. ``DropLocation``.
  967. * `CTest Script`_ variable: :variable:`CTEST_DROP_LOCATION`
  968. * :module:`CTest` module variable: ``DROP_LOCATION`` if set,
  969. else ``CTEST_DROP_LOCATION``
  970. ``DropMethod``
  971. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  972. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  973. ``DropLocation``.
  974. * `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
  975. * :module:`CTest` module variable: ``DROP_METHOD`` if set,
  976. else ``CTEST_DROP_METHOD``
  977. ``DropSite``
  978. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  979. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  980. ``DropLocation``.
  981. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
  982. * :module:`CTest` module variable: ``DROP_SITE`` if set,
  983. else ``CTEST_DROP_SITE``
  984. ``DropSitePassword``
  985. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  986. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  987. ``DropLocation``.
  988. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_PASSWORD`
  989. * :module:`CTest` module variable: ``DROP_SITE_PASSWORD`` if set,
  990. else ``CTEST_DROP_SITE_PASWORD``
  991. ``DropSiteUser``
  992. Legacy option. When ``SubmitURL`` is not set, it is constructed from
  993. ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
  994. ``DropLocation``.
  995. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_USER`
  996. * :module:`CTest` module variable: ``DROP_SITE_USER`` if set,
  997. else ``CTEST_DROP_SITE_USER``
  998. ``IsCDash``
  999. Legacy option. Not used.
  1000. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH`
  1001. * :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
  1002. ``ScpCommand``
  1003. Legacy option. Not used.
  1004. * `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
  1005. * :module:`CTest` module variable: ``SCPCOMMAND``
  1006. ``Site``
  1007. Describe the dashboard client host site with a short string.
  1008. (Hostname, domain, etc.)
  1009. * `CTest Script`_ variable: :variable:`CTEST_SITE`
  1010. * :module:`CTest` module variable: ``SITE``,
  1011. initialized by the :command:`site_name` command
  1012. ``SubmitURL``
  1013. The ``http`` or ``https`` URL of the dashboard server to send the submission
  1014. to.
  1015. * `CTest Script`_ variable: :variable:`CTEST_SUBMIT_URL`
  1016. * :module:`CTest` module variable: ``SUBMIT_URL`` if set,
  1017. else ``CTEST_SUBMIT_URL``
  1018. ``SubmitInactivityTimeout``
  1019. The time to wait for the submission after which it is canceled
  1020. if not completed. Specify a zero value to disable timeout.
  1021. * `CTest Script`_ variable: :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
  1022. * :module:`CTest` module variable: ``CTEST_SUBMIT_INACTIVITY_TIMEOUT``
  1023. ``TriggerSite``
  1024. Legacy option. Not used.
  1025. * `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE`
  1026. * :module:`CTest` module variable: ``TRIGGER_SITE`` if set,
  1027. else ``CTEST_TRIGGER_SITE``
  1028. .. _`Show as JSON Object Model`:
  1029. Show as JSON Object Model
  1030. =========================
  1031. .. versionadded:: 3.14
  1032. When the ``--show-only=json-v1`` command line option is given, the test
  1033. information is output in JSON format. Version 1.0 of the JSON object
  1034. model is defined as follows:
  1035. ``kind``
  1036. The string "ctestInfo".
  1037. ``version``
  1038. A JSON object specifying the version components. Its members are
  1039. ``major``
  1040. A non-negative integer specifying the major version component.
  1041. ``minor``
  1042. A non-negative integer specifying the minor version component.
  1043. ``backtraceGraph``
  1044. JSON object representing backtrace information with the
  1045. following members:
  1046. ``commands``
  1047. List of command names.
  1048. ``files``
  1049. List of file names.
  1050. ``nodes``
  1051. List of node JSON objects with members:
  1052. ``command``
  1053. Index into the ``commands`` member of the ``backtraceGraph``.
  1054. ``file``
  1055. Index into the ``files`` member of the ``backtraceGraph``.
  1056. ``line``
  1057. Line number in the file where the backtrace was added.
  1058. ``parent``
  1059. Index into the ``nodes`` member of the ``backtraceGraph``
  1060. representing the parent in the graph.
  1061. ``tests``
  1062. A JSON array listing information about each test. Each entry
  1063. is a JSON object with members:
  1064. ``name``
  1065. Test name.
  1066. ``config``
  1067. Configuration that the test can run on.
  1068. Empty string means any config.
  1069. ``command``
  1070. List where the first element is the test command and the
  1071. remaining elements are the command arguments.
  1072. ``backtrace``
  1073. Index into the ``nodes`` member of the ``backtraceGraph``.
  1074. ``properties``
  1075. Test properties.
  1076. Can contain keys for each of the supported test properties.
  1077. .. _`ctest-resource-allocation`:
  1078. Resource Allocation
  1079. ===================
  1080. CTest provides a mechanism for tests to specify the resources that they need
  1081. in a fine-grained way, and for users to specify the resources available on
  1082. the running machine. This allows CTest to internally keep track of which
  1083. resources are in use and which are free, scheduling tests in a way that
  1084. prevents them from trying to claim resources that are not available.
  1085. When the resource allocation feature is used, CTest will not oversubscribe
  1086. resources. For example, if a resource has 8 slots, CTest will not run tests
  1087. that collectively use more than 8 slots at a time. This has the effect of
  1088. limiting how many tests can run at any given time, even if a high ``-j``
  1089. argument is used, if those tests all use some slots from the same resource.
  1090. In addition, it means that a single test that uses more of a resource than is
  1091. available on a machine will not run at all (and will be reported as
  1092. ``Not Run``).
  1093. A common use case for this feature is for tests that require the use of a GPU.
  1094. Multiple tests can simultaneously allocate memory from a GPU, but if too many
  1095. tests try to do this at once, some of them will fail to allocate, resulting in
  1096. a failed test, even though the test would have succeeded if it had the memory
  1097. it needed. By using the resource allocation feature, each test can specify how
  1098. much memory it requires from a GPU, allowing CTest to schedule tests in a way
  1099. that running several of these tests at once does not exhaust the GPU's memory
  1100. pool.
  1101. Please note that CTest has no concept of what a GPU is or how much memory it
  1102. has, nor does it have any way of communicating with a GPU to retrieve this
  1103. information or perform any memory management. CTest simply keeps track of a
  1104. list of abstract resource types, each of which has a certain number of slots
  1105. available for tests to use. Each test specifies the number of slots that it
  1106. requires from a certain resource, and CTest then schedules them in a way that
  1107. prevents the total number of slots in use from exceeding the listed capacity.
  1108. When a test is executed, and slots from a resource are allocated to that test,
  1109. tests may assume that they have exclusive use of those slots for the duration
  1110. of the test's process.
  1111. The CTest resource allocation feature consists of two inputs:
  1112. * The :ref:`resource specification file <ctest-resource-specification-file>`,
  1113. described below, which describes the resources available on the system.
  1114. * The :prop_test:`RESOURCE_GROUPS` property of tests, which describes the
  1115. resources required by the test.
  1116. When CTest runs a test, the resources allocated to that test are passed in the
  1117. form of a set of
  1118. :ref:`environment variables <ctest-resource-environment-variables>` as
  1119. described below. Using this information to decide which resource to connect to
  1120. is left to the test writer.
  1121. The ``RESOURCE_GROUPS`` property tells CTest what resources a test expects
  1122. to use grouped in a way meaningful to the test. The test itself must read
  1123. the :ref:`environment variables <ctest-resource-environment-variables>` to
  1124. determine which resources have been allocated to each group. For example,
  1125. each group may correspond to a process the test will spawn when executed.
  1126. Note that even if a test specifies a ``RESOURCE_GROUPS`` property, it is still
  1127. possible for that to test to run without any resource allocation (and without
  1128. the corresponding
  1129. :ref:`environment variables <ctest-resource-environment-variables>`)
  1130. if the user does not pass a resource specification file. Passing this file,
  1131. either through the ``--resource-spec-file`` command-line argument or the
  1132. ``RESOURCE_SPEC_FILE`` argument to :command:`ctest_test`, is what activates the
  1133. resource allocation feature. Tests should check the
  1134. ``CTEST_RESOURCE_GROUP_COUNT`` environment variable to find out whether or not
  1135. resource allocation is activated. This variable will always (and only) be
  1136. defined if resource allocation is activated. If resource allocation is not
  1137. activated, then the ``CTEST_RESOURCE_GROUP_COUNT`` variable will not exist,
  1138. even if it exists for the parent :program:`ctest` process. If a test absolutely must
  1139. have resource allocation, then it can return a failing exit code or use the
  1140. :prop_test:`SKIP_RETURN_CODE` or :prop_test:`SKIP_REGULAR_EXPRESSION`
  1141. properties to indicate a skipped test.
  1142. .. _`ctest-resource-specification-file`:
  1143. Resource Specification File
  1144. ---------------------------
  1145. The resource specification file is a JSON file which is passed to CTest, either
  1146. on the command line as :option:`ctest --resource-spec-file`, or as the
  1147. ``RESOURCE_SPEC_FILE`` argument of :command:`ctest_test`. If a dashboard script
  1148. is used and ``RESOURCE_SPEC_FILE`` is not specified, the value of
  1149. :variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script is used instead.
  1150. If :option:`--resource-spec-file <ctest --resource-spec-file>`, ``RESOURCE_SPEC_FILE``,
  1151. and :variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script are not specified,
  1152. the value of :variable:`CTEST_RESOURCE_SPEC_FILE` in the CMake build is used
  1153. instead. If none of these are specified, no resource spec file is used.
  1154. The resource specification file must be a JSON object. All examples in this
  1155. document assume the following resource specification file:
  1156. .. code-block:: json
  1157. {
  1158. "version": {
  1159. "major": 1,
  1160. "minor": 0
  1161. },
  1162. "local": [
  1163. {
  1164. "gpus": [
  1165. {
  1166. "id": "0",
  1167. "slots": 2
  1168. },
  1169. {
  1170. "id": "1",
  1171. "slots": 4
  1172. },
  1173. {
  1174. "id": "2",
  1175. "slots": 2
  1176. },
  1177. {
  1178. "id": "3"
  1179. }
  1180. ],
  1181. "crypto_chips": [
  1182. {
  1183. "id": "card0",
  1184. "slots": 4
  1185. }
  1186. ]
  1187. }
  1188. ]
  1189. }
  1190. The members are:
  1191. ``version``
  1192. An object containing a ``major`` integer field and a ``minor`` integer field.
  1193. Currently, the only supported version is major ``1``, minor ``0``. Any other
  1194. value is an error.
  1195. ``local``
  1196. A JSON array of resource sets present on the system. Currently, this array
  1197. is restricted to being of size 1.
  1198. Each array element is a JSON object with members whose names are equal to the
  1199. desired resource types, such as ``gpus``. These names must start with a
  1200. lowercase letter or an underscore, and subsequent characters can be a
  1201. lowercase letter, a digit, or an underscore. Uppercase letters are not
  1202. allowed, because certain platforms have case-insensitive environment
  1203. variables. See the `Environment Variables`_ section below for
  1204. more information. It is recommended that the resource type name be the plural
  1205. of a noun, such as ``gpus`` or ``crypto_chips`` (and not ``gpu`` or
  1206. ``crypto_chip``.)
  1207. Please note that the names ``gpus`` and ``crypto_chips`` are just examples,
  1208. and CTest does not interpret them in any way. You are free to make up any
  1209. resource type you want to meet your own requirements.
  1210. The value for each resource type is a JSON array consisting of JSON objects,
  1211. each of which describe a specific instance of the specified resource. These
  1212. objects have the following members:
  1213. ``id``
  1214. A string consisting of an identifier for the resource. Each character in
  1215. the identifier can be a lowercase letter, a digit, or an underscore.
  1216. Uppercase letters are not allowed.
  1217. Identifiers must be unique within a resource type. However, they do not
  1218. have to be unique across resource types. For example, it is valid to have a
  1219. ``gpus`` resource named ``0`` and a ``crypto_chips`` resource named ``0``,
  1220. but not two ``gpus`` resources both named ``0``.
  1221. Please note that the IDs ``0``, ``1``, ``2``, ``3``, and ``card0`` are just
  1222. examples, and CTest does not interpret them in any way. You are free to
  1223. make up any IDs you want to meet your own requirements.
  1224. ``slots``
  1225. An optional unsigned number specifying the number of slots available on the
  1226. resource. For example, this could be megabytes of RAM on a GPU, or
  1227. cryptography units available on a cryptography chip. If ``slots`` is not
  1228. specified, a default value of ``1`` is assumed.
  1229. In the example file above, there are four GPUs with ID's 0 through 3. GPU 0 has
  1230. 2 slots, GPU 1 has 4, GPU 2 has 2, and GPU 3 has a default of 1 slot. There is
  1231. also one cryptography chip with 4 slots.
  1232. ``RESOURCE_GROUPS`` Property
  1233. ----------------------------
  1234. See :prop_test:`RESOURCE_GROUPS` for a description of this property.
  1235. .. _`ctest-resource-environment-variables`:
  1236. Environment Variables
  1237. ---------------------
  1238. Once CTest has decided which resources to allocate to a test, it passes this
  1239. information to the test executable as a series of environment variables. For
  1240. each example below, we will assume that the test in question has a
  1241. :prop_test:`RESOURCE_GROUPS` property of
  1242. ``2,gpus:2;gpus:4,gpus:1,crypto_chips:2``.
  1243. The following variables are passed to the test process:
  1244. .. envvar:: CTEST_RESOURCE_GROUP_COUNT
  1245. The total number of groups specified by the :prop_test:`RESOURCE_GROUPS`
  1246. property. For example:
  1247. * ``CTEST_RESOURCE_GROUP_COUNT=3``
  1248. This variable will only be defined if :manual:`ctest(1)` has been given a
  1249. ``--resource-spec-file``, or if :command:`ctest_test` has been given a
  1250. ``RESOURCE_SPEC_FILE``. If no resource specification file has been given,
  1251. this variable will not be defined.
  1252. .. envvar:: CTEST_RESOURCE_GROUP_<num>
  1253. The list of resource types allocated to each group, with each item
  1254. separated by a comma. ``<num>`` is a number from zero to
  1255. ``CTEST_RESOURCE_GROUP_COUNT`` minus one. ``CTEST_RESOURCE_GROUP_<num>``
  1256. is defined for each ``<num>`` in this range. For example:
  1257. * ``CTEST_RESOURCE_GROUP_0=gpus``
  1258. * ``CTEST_RESOURCE_GROUP_1=gpus``
  1259. * ``CTEST_RESOURCE_GROUP_2=crypto_chips,gpus``
  1260. .. envvar:: CTEST_RESOURCE_GROUP_<num>_<resource-type>
  1261. The list of resource IDs and number of slots from each ID allocated to each
  1262. group for a given resource type. This variable consists of a series of
  1263. pairs, each pair separated by a semicolon, and with the two items in the pair
  1264. separated by a comma. The first item in each pair is ``id:`` followed by the
  1265. ID of a resource of type ``<resource-type>``, and the second item is
  1266. ``slots:`` followed by the number of slots from that resource allocated to
  1267. the given group. For example:
  1268. * ``CTEST_RESOURCE_GROUP_0_GPUS=id:0,slots:2``
  1269. * ``CTEST_RESOURCE_GROUP_1_GPUS=id:2,slots:2``
  1270. * ``CTEST_RESOURCE_GROUP_2_GPUS=id:1,slots:4;id:3,slots:1``
  1271. * ``CTEST_RESOURCE_GROUP_2_CRYPTO_CHIPS=id:card0,slots:2``
  1272. In this example, group 0 gets 2 slots from GPU ``0``, group 1 gets 2 slots
  1273. from GPU ``2``, and group 2 gets 4 slots from GPU ``1``, 1 slot from GPU
  1274. ``3``, and 2 slots from cryptography chip ``card0``.
  1275. ``<num>`` is a number from zero to ``CTEST_RESOURCE_GROUP_COUNT`` minus one.
  1276. ``<resource-type>`` is the name of a resource type, converted to uppercase.
  1277. ``CTEST_RESOURCE_GROUP_<num>_<resource-type>`` is defined for the product
  1278. of each ``<num>`` in the range listed above and each resource type listed in
  1279. ``CTEST_RESOURCE_GROUP_<num>``.
  1280. Because some platforms have case-insensitive names for environment variables,
  1281. the names of resource types may not clash in a case-insensitive environment.
  1282. Because of this, for the sake of simplicity, all resource types must be
  1283. listed in all lowercase in the
  1284. :ref:`resource specification file <ctest-resource-specification-file>` and
  1285. in the :prop_test:`RESOURCE_GROUPS` property, and they are converted to all
  1286. uppercase in the ``CTEST_RESOURCE_GROUP_<num>_<resource-type>`` environment
  1287. variable.
  1288. .. _`ctest-resource-dynamically-generated-spec-file`:
  1289. Dynamically-Generated Resource Specification File
  1290. -------------------------------------------------
  1291. .. versionadded:: 3.28
  1292. A project may optionally specify a single test which will be used to
  1293. dynamically generate the resource specification file that CTest will use for
  1294. scheduling tests that use resources. The test that generates the file must
  1295. have the :prop_test:`GENERATED_RESOURCE_SPEC_FILE` property set, and must have
  1296. exactly one fixture in its :prop_test:`FIXTURES_SETUP` property. This fixture
  1297. is considered by CTest to have special meaning: it's the fixture that generates
  1298. the resource spec file. The fixture may have any name. If such a fixture
  1299. exists, all tests that have :prop_test:`RESOURCE_GROUPS` set must have the
  1300. fixture in their :prop_test:`FIXTURES_REQUIRED`, and a resource spec file may
  1301. not be specified with the ``--resource-spec-file`` argument or the
  1302. :variable:`CTEST_RESOURCE_SPEC_FILE` variable.
  1303. See Also
  1304. ========
  1305. .. include:: LINKS.txt