ctest.1.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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>``: Choose configuration to test.
  17. Some CMake-generated build trees can have multiple build
  18. configurations in the same tree. This option can be used to specify
  19. which one should be tested. Example configurations are "Debug" and
  20. "Release".
  21. * ``-V,--verbose``: Enable verbose output from tests.
  22. Test output is normally suppressed and only summary information is
  23. displayed. This option will show all test output.
  24. * ``-VV,--extra-verbose``: Enable more verbose output from tests.
  25. Test output is normally suppressed and only summary information is
  26. displayed. This option will show even more test output.
  27. * ``--debug``: Displaying more verbose internals of CTest.
  28. This feature will result in a large number of output that is mostly
  29. useful for debugging dashboard problems.
  30. * ``--output-on-failure``: Output anything outputted by the test program if the test should fail. This option can also be enabled by setting the environment variable CTEST_OUTPUT_ON_FAILURE
  31. * ``-F``: Enable failover.
  32. This option allows ctest to resume a test set execution that was
  33. previously interrupted. If no interruption occurred, the -F option
  34. will have no effect.
  35. * ``-j <jobs>, --parallel <jobs>``: Run the tests in parallel using thegiven number of jobs.
  36. This option tells ctest to run the tests in parallel using given
  37. number of jobs. This option can also be set by setting the
  38. environment variable CTEST_PARALLEL_LEVEL.
  39. * ``-Q,--quiet``: Make ctest quiet.
  40. This option will suppress all the output. The output log file will
  41. still be generated if the --output-log is specified. Options such
  42. as --verbose, --extra-verbose, and --debug are ignored if --quiet is
  43. specified.
  44. * ``-O <file>, --output-log <file>``: Output to log file
  45. This option tells ctest to write all its output to a log file.
  46. * ``-N,--show-only``: Disable actual execution of tests.
  47. This option tells ctest to list the tests that would be run but not
  48. actually run them. Useful in conjunction with the -R and -E
  49. options.
  50. * ``-L <regex>, --label-regex <regex>``: Run tests with labels matching regular expression.
  51. This option tells ctest to run only the tests whose labels match the
  52. given regular expression.
  53. * ``-R <regex>, --tests-regex <regex>``: Run tests matching regular expression.
  54. This option tells ctest to run only the tests whose names match the
  55. given regular expression.
  56. * ``-E <regex>, --exclude-regex <regex>``: Exclude tests matching regular expression.
  57. This option tells ctest to NOT run the tests whose names match the
  58. given regular expression.
  59. * ``-LE <regex>, --label-exclude <regex>``: Exclude tests with labels matching regular expression.
  60. This option tells ctest to NOT run the tests whose labels match the
  61. given regular expression.
  62. * ``-D <dashboard>, --dashboard <dashboard>``: Execute dashboard test
  63. This option tells ctest to act as a Dart client and perform a
  64. dashboard test. All tests are <Mode><Test>, where Mode can be
  65. Experimental, Nightly, and Continuous, and Test can be Start,
  66. Update, Configure, Build, Test, Coverage, and Submit.
  67. * ``-D <var>:<type>=<value>``: Define a variable for script mode
  68. Pass in variable values on the command line. Use in conjunction
  69. with -S to pass variable values to a dashboard script. Parsing -D
  70. arguments as variable values is only attempted if the value
  71. following -D does not match any of the known dashboard types.
  72. * ``-M <model>, --test-model <model>``: Sets the model for a dashboard
  73. This option tells ctest to act as a Dart client where the TestModel
  74. can be Experimental, Nightly, and Continuous. Combining -M and -T
  75. is similar to -D
  76. * ``-T <action>, --test-action <action>``: Sets the dashboard action to perform
  77. This option tells ctest to act as a Dart client and perform some
  78. action such as start, build, test etc. Combining -M and -T is
  79. similar to -D
  80. * ``--track <track>``: Specify the track to submit dashboard to
  81. Submit dashboard to specified track instead of default one. By
  82. default, the dashboard is submitted to Nightly, Experimental, or
  83. Continuous track, but by specifying this option, the track can be
  84. arbitrary.
  85. * ``-S <script>, --script <script>``: Execute a dashboard for a configuration
  86. This option tells ctest to load in a configuration script which sets
  87. a number of parameters such as the binary and source directories.
  88. Then ctest will do what is required to create and run a dashboard.
  89. This option basically sets up a dashboard and then runs ctest -D
  90. with the appropriate options.
  91. * ``-SP <script>, --script-new-process <script>``: Execute a dashboard for a configuration
  92. This option does the same operations as -S but it will do them in a
  93. separate process. This is primarily useful in cases where the
  94. script may modify the environment and you do not want the modified
  95. environment to impact other -S scripts.
  96. * ``-A <file>, --add-notes <file>``: Add a notes file with submission
  97. This option tells ctest to include a notes file when submitting
  98. dashboard.
  99. * ``-I [Start,End,Stride,test#,test#|Test file], --tests-information``: Run a specific number of tests by number.
  100. This option causes ctest to run tests starting at number Start,
  101. ending at number End, and incrementing by Stride. Any additional
  102. numbers after Stride are considered individual test numbers. Start,
  103. End,or stride can be empty. Optionally a file can be given that
  104. contains the same syntax as the command line.
  105. * ``-U, --union``: Take the Union of -I and -R
  106. When both -R and -I are specified by default the intersection of
  107. tests are run. By specifying -U the union of tests is run instead.
  108. * ``--rerun-failed``: Run only the tests that failed previously
  109. This option tells ctest to perform only the tests that failed during
  110. its previous run. When this option is specified, ctest ignores all
  111. other options intended to modify the list of tests to run (-L, -R,
  112. -E, -LE, -I, etc). In the event that CTest runs and no tests fail,
  113. subsequent calls to ctest with the --rerun-failed option will run
  114. the set of tests that most recently failed (if any).
  115. * ``--max-width <width>``: Set the max width for a test name to output
  116. Set the maximum width for each test name to show in the output.
  117. This allows the user to widen the output to avoid clipping the test
  118. name which can be very annoying.
  119. * ``--interactive-debug-mode [0|1]``: Set the interactive mode to 0 or 1.
  120. This option causes ctest to run tests in either an interactive mode
  121. or a non-interactive mode. On Windows this means that in
  122. non-interactive mode, all system debug pop up windows are blocked.
  123. In dashboard mode (Experimental, Nightly, Continuous), the default
  124. is non-interactive. When just running tests not for a dashboard the
  125. default is to allow popups and interactive debugging.
  126. * ``--no-label-summary``: Disable timing summary information for labels.
  127. This option tells ctest not to print summary information for each
  128. label associated with the tests run. If there are no labels on the
  129. tests, nothing extra is printed.
  130. * ``--build-and-test``: Configure, build and run a test.
  131. This option tells ctest to configure (i.e. run cmake on), build,
  132. and or execute a test. The configure and test steps are optional.
  133. The arguments to this command line are the source and binary
  134. directories. By default this will run CMake on the Source/Bin
  135. directories specified unless --build-nocmake is specified. Both
  136. --build-makeprogram and --build-generator MUST be provided to use
  137. --build-and-test. If --test-command is specified then that will be
  138. run after the build is complete. Other options that affect this
  139. mode are --build-target --build-nocmake, --build-run-dir,
  140. --build-two-config, --build-exe-dir,
  141. --build-project,--build-noclean, --build-options
  142. * ``--build-target``: Specify a specific target to build.
  143. This option goes with the --build-and-test option, if left out the
  144. all target is built.
  145. * ``--build-nocmake``: Run the build without running cmake first.
  146. Skip the cmake step.
  147. * ``--build-run-dir``: Specify directory to run programs from.
  148. Directory where programs will be after it has been compiled.
  149. * ``--build-two-config``: Run CMake twice
  150. * ``--build-exe-dir``: Specify the directory for the executable.
  151. * ``--build-generator``: Specify the generator to use.
  152. * ``--build-generator-toolset``: Specify the generator-specific toolset.
  153. * ``--build-project``: Specify the name of the project to build.
  154. * ``--build-makeprogram``: Specify the make program to use.
  155. * ``--build-noclean``: Skip the make clean step.
  156. * ``--build-config-sample``: A sample executable to use to determine the configuration
  157. A sample executable to use to determine the configuration that
  158. should be used. e.g. Debug/Release/etc
  159. * ``--build-options``: Add extra options to the build step.
  160. This option must be the last option with the exception of
  161. --test-command
  162. * ``--test-command``: The test to run with the --build-and-test option.
  163. * ``--test-timeout``: The time limit in seconds, internal use only.
  164. * ``--tomorrow-tag``: Nightly or experimental starts with next day tag.
  165. This is useful if the build will not finish in one day.
  166. * ``--ctest-config``: The configuration file used to initialize CTest state when submitting dashboards.
  167. This option tells CTest to use different initialization file instead
  168. of CTestConfiguration.tcl. This way multiple initialization files
  169. can be used for example to submit to multiple dashboards.
  170. * ``--overwrite``: Overwrite CTest configuration option.
  171. By default ctest uses configuration options from configuration file.
  172. This option will overwrite the configuration option.
  173. * ``--extra-submit <file>[;<file>]``: Submit extra files to the dashboard.
  174. This option will submit extra files to the dashboard.
  175. * ``--force-new-ctest-process``: Run child CTest instances as new processes
  176. By default CTest will run child CTest instances within the same
  177. process. If this behavior is not desired, this argument will
  178. enforce new processes for child CTest processes.
  179. * ``--schedule-random``: Use a random order for scheduling tests
  180. This option will run the tests in a random order. It is commonly
  181. used to detect implicit dependencies in a test suite.
  182. * ``--submit-index``: Submit individual dashboard tests with specific index
  183. This option allows performing the same CTest action (such as test)
  184. multiple times and submit all stages to the same dashboard (Dart2
  185. required). Each execution requires different index.
  186. * ``--timeout <seconds>``: Set a global timeout on all tests.
  187. This option will set a global timeout on all tests that do not
  188. already have a timeout set on them.
  189. * ``--stop-time <time>``: Set a time at which all tests should stop running.
  190. Set a real time of day at which all tests should timeout. Example:
  191. 7:00:00 -0400. Any time format understood by the curl date parser
  192. is accepted. Local time is assumed if no timezone is specified.
  193. * ``--http1.0``: Submit using HTTP 1.0.
  194. This option will force CTest to use HTTP 1.0 to submit files to the
  195. dashboard, instead of HTTP 1.1.
  196. * ``--no-compress-output``: Do not compress test output when submitting.
  197. This flag will turn off automatic compression of test output. Use
  198. this to maintain compatibility with an older version of CDash which
  199. doesn't support compressed test output.
  200. * ``--print-labels``: Print all available test labels.
  201. This option will not run any tests, it will simply print the list of
  202. all labels associated with the test set.
  203. .. include:: OPTIONS_HELP.txt
  204. See Also
  205. ========
  206. .. include:: LINKS.txt