1CTEST(1)                             CMake                            CTEST(1)
2
3
4

NAME

6       ctest - CTest Command-Line Reference
7
8   Contents
9       · ctest(1)
10
11         · Synopsis
12
13         · Description
14
15         · Options
16
17         · Label and Subproject Summary
18
19         · Build and Test Mode
20
21         · Dashboard Client
22
23           · Dashboard Client Steps
24
25           · Dashboard Client Modes
26
27           · Dashboard Client via CTest Command-Line
28
29           · Dashboard Client via CTest Script
30
31         · Dashboard Client Configuration
32
33           · CTest Start Step
34
35           · CTest Update Step
36
37           · CTest Configure Step
38
39           · CTest Build Step
40
41           · CTest Test Step
42
43           · CTest Coverage Step
44
45           · CTest MemCheck Step
46
47           · CTest Submit Step
48
49         · Show as JSON Object Model
50
51         · See Also
52

SYNOPSIS

54          ctest [<options>]
55          ctest --build-and-test <path-to-source> <path-to-build>
56                --build-generator <generator> [<options>...]
57                [--build-options <opts>...] [--test-command <command> [<args>...]]
58          ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
59                [-- <dashboard-options>...]
60

DESCRIPTION

62       The ctest executable is the CMake test driver program.  CMake-generated
63       build trees created  for  projects  that  use  the  ENABLE_TESTING  and
64       ADD_TEST  commands  have  testing  support.   This program will run the
65       tests and report results.
66

OPTIONS

68       -C <cfg>, --build-config <cfg>
69              Choose configuration to test.
70
71              Some CMake-generated build trees can have multiple build config‐
72              urations  in  the same tree.  This option can be used to specify
73              which one should be tested.  Example configurations are  “Debug”
74              and “Release”.
75
76       --progress
77              Enable short progress output from tests.
78
79              When  the  output of ctest is being sent directly to a terminal,
80              the progress through the set of tests is  reported  by  updating
81              the  same  line  rather than printing start and end messages for
82              each test on new lines.  This can significantly reduce the  ver‐
83              bosity  of  the test output.  Test completion messages are still
84              output on their own line for failed tests  and  the  final  test
85              summary will also still be logged.
86
87              This option can also be enabled by setting the environment vari‐
88              able CTEST_PROGRESS_OUTPUT.
89
90       -V,--verbose
91              Enable verbose output from tests.
92
93              Test output is normally suppressed and only summary  information
94              is displayed.  This option will show all test output.
95
96       -VV,--extra-verbose
97              Enable more verbose output from tests.
98
99              Test  output is normally suppressed and only summary information
100              is displayed.  This option will show even more test output.
101
102       --debug
103              Displaying more verbose internals of CTest.
104
105              This feature will result in a large number  of  output  that  is
106              mostly useful for debugging dashboard problems.
107
108       --output-on-failure
109              Output anything outputted by the test program if the test should
110              fail.  This option can also be enabled by setting the CTEST_OUT‐
111              PUT_ON_FAILURE environment variable
112
113       -F     Enable failover.
114
115              This option allows CTest to resume a test set execution that was
116              previously interrupted.  If no  interruption  occurred,  the  -F
117              option will have no effect.
118
119       -j <jobs>, --parallel <jobs>
120              Run the tests in parallel using the given number of jobs.
121
122              This option tells CTest to run the tests in parallel using given
123              number of jobs. This option can  also  be  set  by  setting  the
124              CTEST_PARALLEL_LEVEL environment variable.
125
126              This option can be used with the PROCESSORS test property.
127
128              See Label and Subproject Summary.
129
130       --test-load <level>
131              While running tests in parallel (e.g. with -j), try not to start
132              tests when they may cause the CPU load to  pass  above  a  given
133              threshold.
134
135              When  ctest  is run as a Dashboard Client this sets the TestLoad
136              option of the CTest Test Step.
137
138       -Q,--quiet
139              Make CTest quiet.
140
141              This option will suppress all the output.  The output  log  file
142              will  still  be  generated  if  the  --output-log  is specified.
143              Options such as  --verbose,  --extra-verbose,  and  --debug  are
144              ignored if --quiet is specified.
145
146       -O <file>, --output-log <file>
147              Output to log file.
148
149              This option tells CTest to write all its output to a log file.
150
151       -N,--show-only[=<format>]
152              Disable actual execution of tests.
153
154              This  option tells CTest to list the tests that would be run but
155              not actually run them.  Useful in conjunction with the -R and -E
156              options.
157
158              <format> can be one of the following values.
159
160                 human  Human-friendly  output.   This is not guaranteed to be
161                        stable.  This is the default.
162
163                 json-v1
164                        Dump the test information in JSON format.  See Show as
165                        JSON Object Model.
166
167       -L <regex>, --label-regex <regex>
168              Run tests with labels matching regular expression.
169
170              This option tells CTest to run only the tests whose labels match
171              the given regular expression.
172
173       -R <regex>, --tests-regex <regex>
174              Run tests matching regular expression.
175
176              This option tells CTest to run only the tests whose names  match
177              the given regular expression.
178
179       -E <regex>, --exclude-regex <regex>
180              Exclude tests matching regular expression.
181
182              This  option  tells CTest to NOT run the tests whose names match
183              the given regular expression.
184
185       -LE <regex>, --label-exclude <regex>
186              Exclude tests with labels matching regular expression.
187
188              This option tells CTest to NOT run the tests whose labels  match
189              the given regular expression.
190
191       -FA <regex>, --fixture-exclude-any <regex>
192              Exclude  fixtures matching <regex> from automatically adding any
193              tests to the test set.
194
195              If a test in the set of tests to be executed requires a particu‐
196              lar  fixture,  that fixture’s setup and cleanup tests would nor‐
197              mally be added to the test set automatically. This  option  pre‐
198              vents  adding  setup  or cleanup tests for fixtures matching the
199              <regex>. Note that  all  other  fixture  behavior  is  retained,
200              including test dependencies and skipping tests that have fixture
201              setup tests that fail.
202
203       -FS <regex>, --fixture-exclude-setup <regex>
204              Same as -FA except only matching setup tests are excluded.
205
206       -FC <regex>, --fixture-exclude-cleanup <regex>
207              Same as -FA except only matching cleanup tests are excluded.
208
209       -D <dashboard>, --dashboard <dashboard>
210              Execute dashboard test.
211
212              This option tells CTest to act as a CDash client and  perform  a
213              dashboard  test.   All tests are <Mode><Test>, where Mode can be
214              Experimental, Nightly, and Continuous, and Test  can  be  Start,
215              Update, Configure, Build, Test, Coverage, and Submit.
216
217              See Dashboard Client.
218
219       -D <var>:<type>=<value>
220              Define a variable for script mode.
221
222              Pass in variable values on the command line.  Use in conjunction
223              with -S to pass variable values to a dashboard script.   Parsing
224              -D  arguments  as variable values is only attempted if the value
225              following -D does not match any of the known dashboard types.
226
227       -M <model>, --test-model <model>
228              Sets the model for a dashboard.
229
230              This option tells CTest to act  as  a  CDash  client  where  the
231              <model> can be Experimental, Nightly, and Continuous.  Combining
232              -M and -T is similar to -D.
233
234              See Dashboard Client.
235
236       -T <action>, --test-action <action>
237              Sets the dashboard action to perform.
238
239              This option tells CTest to act as a  CDash  client  and  perform
240              some action such as start, build, test etc. See Dashboard Client
241              Steps for the full list of actions.  Combining -M and -T is sim‐
242              ilar to -D.
243
244              See Dashboard Client.
245
246       -S <script>, --script <script>
247              Execute a dashboard for a configuration.
248
249              This  option tells CTest to load in a configuration script which
250              sets a number of parameters such as the binary and source direc‐
251              tories.  Then CTest will do what is required to create and run a
252              dashboard.  This option basically sets up a dashboard  and  then
253              runs ctest -D with the appropriate options.
254
255              See Dashboard Client.
256
257       -SP <script>, --script-new-process <script>
258              Execute a dashboard for a configuration.
259
260              This  option  does the same operations as -S but it will do them
261              in a separate process.  This is primarily useful in cases  where
262              the  script  may  modify the environment and you do not want the
263              modified environment to impact other -S scripts.
264
265              See Dashboard Client.
266
267       -I [Start,End,Stride,test#,test#|Test file], --tests-information
268              Run a specific number of tests by number.
269
270              This option causes CTest to run tests starting at number  Start,
271              ending  at  number  End,  and incrementing by Stride.  Any addi‐
272              tional numbers after Stride are considered individual test  num‐
273              bers.  Start, End,or stride can be empty.  Optionally a file can
274              be given that contains the same syntax as the command line.
275
276       -U, --union
277              Take the Union of -I and -R.
278
279              When both -R and -I are specified by default the intersection of
280              tests  are  run.   By  specifying  -U  the union of tests is run
281              instead.
282
283       --rerun-failed
284              Run only the tests that failed previously.
285
286              This option tells CTest to perform only the  tests  that  failed
287              during  its  previous run.  When this option is specified, CTest
288              ignores all other options intended to modify the list  of  tests
289              to run (-L, -R, -E, -LE, -I, etc).  In the event that CTest runs
290              and  no  tests  fail,  subsequent  calls  to  CTest   with   the
291              --rerun-failed  option  will  run  the  set  of  tests that most
292              recently failed (if any).
293
294       --repeat-until-fail <n>
295              Require each test to run <n> times without failing in  order  to
296              pass.
297
298              This is useful in finding sporadic failures in test cases.
299
300       --max-width <width>
301              Set the max width for a test name to output.
302
303              Set  the maximum width for each test name to show in the output.
304              This allows the user to widen the output to avoid  clipping  the
305              test name which can be very annoying.
306
307       --interactive-debug-mode [0|1]
308              Set the interactive mode to 0 or 1.
309
310              This  option  causes CTest to run tests in either an interactive
311              mode or a non-interactive mode.  On Windows this means  that  in
312              non-interactive  mode,  all  system  debug  pop  up  windows are
313              blocked.  In dashboard mode (Experimental, Nightly, Continuous),
314              the default is non-interactive.  When just running tests not for
315              a dashboard the default  is  to  allow  popups  and  interactive
316              debugging.
317
318       --no-label-summary
319              Disable timing summary information for labels.
320
321              This  option  tells  CTest  not to print summary information for
322              each label associated with the  tests  run.   If  there  are  no
323              labels on the tests, nothing extra is printed.
324
325              See Label and Subproject Summary.
326
327       --no-subproject-summary
328              Disable timing summary information for subprojects.
329
330              This  option  tells  CTest  not to print summary information for
331              each subproject associated with the tests run.  If there are  no
332              subprojects on the tests, nothing extra is printed.
333
334              See Label and Subproject Summary.
335
336       --build-and-test See Build and Test Mode.
337
338       --test-output-size-passed <size>
339              Limit the output for passed tests to <size> bytes.
340
341       --test-output-size-failed <size>
342              Limit the output for failed tests to <size> bytes.
343
344       --overwrite
345              Overwrite CTest configuration option.
346
347              By  default  CTest uses configuration options from configuration
348              file.  This option will overwrite the configuration option.
349
350       --force-new-ctest-process
351              Run child CTest instances as new processes.
352
353              By default CTest will run child CTest instances within the  same
354              process.   If  this  behavior is not desired, this argument will
355              enforce new processes for child CTest processes.
356
357       --schedule-random
358              Use a random order for scheduling tests.
359
360              This option will run the tests in a random order.   It  is  com‐
361              monly used to detect implicit dependencies in a test suite.
362
363       --submit-index
364              Legacy  option  for  old Dart2 dashboard server feature.  Do not
365              use.
366
367       --timeout <seconds>
368              Set the default test timeout.
369
370              This option effectively sets a timeout on all tests that do  not
371              already have a timeout set on them via the TIMEOUT property.
372
373       --stop-time <time>
374              Set a time at which all tests should stop running.
375
376              Set a real time of day at which all tests should timeout.  Exam‐
377              ple: 7:00:00 -0400.  Any time format understood by the curl date
378              parser  is  accepted.   Local  time is assumed if no timezone is
379              specified.
380
381       --print-labels
382              Print all available test labels.
383
384              This option will not run any tests, it  will  simply  print  the
385              list of all labels associated with the test set.
386
387       --help,-help,-usage,-h,-H,/?
388              Print usage information and exit.
389
390              Usage  describes  the  basic  command  line  interface  and  its
391              options.
392
393       --version,-version,/V [<f>]
394              Show program name/version banner and exit.
395
396              If a file is specified, the version is  written  into  it.   The
397              help is printed to a named <f>ile if given.
398
399       --help-full [<f>]
400              Print all help manuals and exit.
401
402              All  manuals  are  printed in a human-readable text format.  The
403              help is printed to a named <f>ile if given.
404
405       --help-manual <man> [<f>]
406              Print one help manual and exit.
407
408              The specified manual is printed in a human-readable text format.
409              The help is printed to a named <f>ile if given.
410
411       --help-manual-list [<f>]
412              List help manuals available and exit.
413
414              The  list contains all manuals for which help may be obtained by
415              using the --help-manual option followed by a manual  name.   The
416              help is printed to a named <f>ile if given.
417
418       --help-command <cmd> [<f>]
419              Print help for one command and exit.
420
421              The  cmake-commands(7)  manual  entry  for <cmd> is printed in a
422              human-readable text format.  The help  is  printed  to  a  named
423              <f>ile if given.
424
425       --help-command-list [<f>]
426              List commands with help available and exit.
427
428              The list contains all commands for which help may be obtained by
429              using the --help-command option followed by a command name.  The
430              help is printed to a named <f>ile if given.
431
432       --help-commands [<f>]
433              Print cmake-commands manual and exit.
434
435              The cmake-commands(7) manual is printed in a human-readable text
436              format.  The help is printed to a named <f>ile if given.
437
438       --help-module <mod> [<f>]
439              Print help for one module and exit.
440
441              The cmake-modules(7) manual entry for  <mod>  is  printed  in  a
442              human-readable  text  format.   The  help  is printed to a named
443              <f>ile if given.
444
445       --help-module-list [<f>]
446              List modules with help available and exit.
447
448              The list contains all modules for which help may be obtained  by
449              using  the  --help-module option followed by a module name.  The
450              help is printed to a named <f>ile if given.
451
452       --help-modules [<f>]
453              Print cmake-modules manual and exit.
454
455              The cmake-modules(7) manual is printed in a human-readable  text
456              format.  The help is printed to a named <f>ile if given.
457
458       --help-policy <cmp> [<f>]
459              Print help for one policy and exit.
460
461              The  cmake-policies(7)  manual  entry  for <cmp> is printed in a
462              human-readable text format.  The help  is  printed  to  a  named
463              <f>ile if given.
464
465       --help-policy-list [<f>]
466              List policies with help available and exit.
467
468              The list contains all policies for which help may be obtained by
469              using the --help-policy option followed by a policy  name.   The
470              help is printed to a named <f>ile if given.
471
472       --help-policies [<f>]
473              Print cmake-policies manual and exit.
474
475              The cmake-policies(7) manual is printed in a human-readable text
476              format.  The help is printed to a named <f>ile if given.
477
478       --help-property <prop> [<f>]
479              Print help for one property and exit.
480
481              The cmake-properties(7) manual entries for <prop> are printed in
482              a  human-readable  text  format.  The help is printed to a named
483              <f>ile if given.
484
485       --help-property-list [<f>]
486              List properties with help available and exit.
487
488              The list contains all properties for which help may be  obtained
489              by using the --help-property option followed by a property name.
490              The help is printed to a named <f>ile if given.
491
492       --help-properties [<f>]
493              Print cmake-properties manual and exit.
494
495              The cmake-properties(7) manual is printed  in  a  human-readable
496              text format.  The help is printed to a named <f>ile if given.
497
498       --help-variable <var> [<f>]
499              Print help for one variable and exit.
500
501              The  cmake-variables(7)  manual  entry for <var> is printed in a
502              human-readable text format.  The help  is  printed  to  a  named
503              <f>ile if given.
504
505       --help-variable-list [<f>]
506              List variables with help available and exit.
507
508              The  list  contains all variables for which help may be obtained
509              by using the --help-variable option followed by a variable name.
510              The help is printed to a named <f>ile if given.
511
512       --help-variables [<f>]
513              Print cmake-variables manual and exit.
514
515              The  cmake-variables(7)  manual  is  printed in a human-readable
516              text format.  The help is printed to a named <f>ile if given.
517

LABEL AND SUBPROJECT SUMMARY

519       CTest prints timing summary information for each label  and  subproject
520       associated  with the tests run. The label time summary will not include
521       labels that are mapped to subprojects.
522
523       When the PROCESSORS test property is set, CTest will display a weighted
524       test  timing  result  in  label  and  subproject summaries. The time is
525       reported with sec*proc instead of just sec.
526
527       The weighted time summary reported for each label or  subproject  j  is
528       computed as:
529
530          Weighted Time Summary for Label/Subproject j =
531              sum(raw_test_time[j,i] * num_processors[j,i], i=1...num_tests[j])
532
533          for labels/subprojects j=1...total
534
535       where:
536
537       · raw_test_time[j,i]:  Wall-clock  time  for  the  ith test for the jth
538         label or subproject
539
540       · num_processors[j,i]: Value of the CTest PROCESSORS property  for  the
541         ith test for the jth label or subproject
542
543       · num_tests[j]:  Number  of tests associated with the jth label or sub‐
544         project
545
546       · total: Total number of labels or subprojects that have at  least  one
547         test run
548
549       Therefore,  the weighted time summary for each label or subproject rep‐
550       resents the amount of time that CTest gave to run the  tests  for  each
551       label  or  subproject  and  gives  a  good  representation of the total
552       expense of the tests for each label  or  subproject  when  compared  to
553       other labels or subprojects.
554
555       For  example,  if “SubprojectA” showed “100 sec*proc” and “SubprojectB”
556       showed “10 sec*proc”, then CTest allocated approximately  10 times  the
557       CPU/core time to run the tests for “SubprojectA” than for “SubprojectB”
558       (e.g. so if effort is going to be expended to reduce the  cost  of  the
559       test  suite  for  the whole project, then reducing the cost of the test
560       suite for “SubprojectA” would likely have a larger impact  than  effort
561       to reduce the cost of the test suite for “SubprojectB”).
562

BUILD AND TEST MODE

564       CTest  provides  a  command-line signature to configure (i.e. run cmake
565       on), build, and/or execute a test:
566
567          ctest --build-and-test <path-to-source> <path-to-build>
568                --build-generator <generator>
569                [<options>...]
570                [--build-options <opts>...]
571                [--test-command <command> [<args>...]]
572
573       The configure and test steps are optional. The arguments to  this  com‐
574       mand line are the source and binary directories.  The --build-generator
575       option must be provided to use --build-and-test.  If --test-command  is
576       specified  then  that  will  be run after the build is complete.  Other
577       options that affect this mode include:
578
579       --build-target
580              Specify a specific target to build.
581
582              If left out the all target is built.
583
584       --build-nocmake
585              Run the build without running cmake first.
586
587              Skip the cmake step.
588
589       --build-run-dir
590              Specify directory to run programs from.
591
592              Directory where programs will be after it has been compiled.
593
594       --build-two-config
595              Run CMake twice.
596
597       --build-exe-dir
598              Specify the directory for the executable.
599
600       --build-generator
601              Specify the generator to use. See the  cmake-generators(7)  man‐
602              ual.
603
604       --build-generator-platform
605              Specify the generator-specific platform.
606
607       --build-generator-toolset
608              Specify the generator-specific toolset.
609
610       --build-project
611              Specify the name of the project to build.
612
613       --build-makeprogram
614              Override the make program chosen by CTest with a given one.
615
616       --build-noclean
617              Skip the make clean step.
618
619       --build-config-sample
620              A  sample  executable to use to determine the configuration that
621              should be used.  e.g.  Debug/Release/etc.
622
623       --build-options
624              Additional options for configuring the build  (i.e.  for  CMake,
625              not  for  the  build tool).  Note that if this is specified, the
626              --build-options keyword and  its  arguments  must  be  the  last
627              option given on the command line, with the possible exception of
628              --test-command.
629
630       --test-command
631              The command to run as the test step  with  the  --build-and-test
632              option.  All arguments following this keyword will be assumed to
633              be part of the test command line, so it must be the last  option
634              given.
635
636       --test-timeout
637              The time limit in seconds
638

DASHBOARD CLIENT

640       CTest  can operate as a client for the CDash software quality dashboard
641       application.  As a dashboard client, CTest performs a sequence of steps
642       to configure, build, and test software, and then submits the results to
643       a CDash server. The command-line signature used to submit to CDash is:
644
645          ctest (-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>)
646                [-- <dashboard-options>...]
647
648       Options for Dashboard Client include:
649
650       --track <track>
651              Specify the track to submit dashboard to
652
653              Submit dashboard to specified track instead of default one.   By
654              default, the dashboard is submitted to Nightly, Experimental, or
655              Continuous track, but by specifying this option, the  track  can
656              be arbitrary.
657
658       -A <file>, --add-notes <file>
659              Add a notes file with submission.
660
661              This  option tells CTest to include a notes file when submitting
662              dashboard.
663
664       --tomorrow-tag
665              Nightly or experimental starts with next day tag.
666
667              This is useful if the build will not finish in one day.
668
669       --extra-submit <file>[;<file>]
670              Submit extra files to the dashboard.
671
672              This option will submit extra files to the dashboard.
673
674       --http1.0
675              Submit using HTTP 1.0.
676
677              This option will force CTest to use HTTP 1.0 to submit files  to
678              the dashboard, instead of HTTP 1.1.
679
680       --no-compress-output
681              Do not compress test output when submitting.
682
683              This  flag  will  turn off automatic compression of test output.
684              Use this to maintain compatibility  with  an  older  version  of
685              CDash which doesn’t support compressed test output.
686
687   Dashboard Client Steps
688       CTest defines an ordered list of testing steps of which some or all may
689       be run as a dashboard client:
690
691       Start  Start a new dashboard  submission  to  be  composed  of  results
692              recorded  by the following steps.  See the CTest Start Step sec‐
693              tion below.
694
695       Update Update the source tree  from  its  version  control  repository.
696              Record  the  old and new versions and the list of updated source
697              files.  See the CTest Update Step section below.
698
699       Configure
700              Configure the software by running a command in the  build  tree.
701              Record  the  configuration  output log.  See the CTest Configure
702              Step section below.
703
704       Build  Build the software by running  a  command  in  the  build  tree.
705              Record the build output log and detect warnings and errors.  See
706              the CTest Build Step section below.
707
708       Test   Test the software by  loading  a  CTestTestfile.cmake  from  the
709              build  tree  and executing the defined tests.  Record the output
710              and result of each test.  See the CTest Test Step section below.
711
712       Coverage
713              Compute coverage of the source code by running a coverage analy‐
714              sis  tool and recording its output.  See the CTest Coverage Step
715              section below.
716
717       MemCheck
718              Run the software test suite through a memory check tool.  Record
719              the  test output, results, and issues reported by the tool.  See
720              the CTest MemCheck Step section below.
721
722       Submit Submit results recorded from other testing steps to the software
723              quality  dashboard  server.   See  the CTest Submit Step section
724              below.
725
726   Dashboard Client Modes
727       CTest defines three modes of operation as a dashboard client:
728
729       Nightly
730              This mode is intended to be invoked once per day,  typically  at
731              night.   It  enables  the Start, Update, Configure, Build, Test,
732              Coverage, and Submit steps by default.  Selected steps run  even
733              if the Update step reports no changes to the source tree.
734
735       Continuous
736              This  mode  is  intended to be invoked repeatedly throughout the
737              day.  It enables the Start, Update, Configure, Build, Test, Cov‐
738              erage,  and  Submit steps by default, but exits after the Update
739              step if it reports no changes to the source tree.
740
741       Experimental
742              This mode is intended to be invoked by a developer to test local
743              changes.   It  enables the Start, Configure, Build, Test, Cover‐
744              age, and Submit steps by default.
745
746   Dashboard Client via CTest Command-Line
747       CTest can perform testing on an already-generated build tree.  Run  the
748       ctest  command with the current working directory set to the build tree
749       and use one of these signatures:
750
751          ctest -D <mode>[<step>]
752          ctest -M <mode> [ -T <step> ]...
753
754       The <mode> must be one of the above Dashboard Client  Modes,  and  each
755       <step> must be one of the above Dashboard Client Steps.
756
757       CTest  reads the Dashboard Client Configuration settings from a file in
758       the build tree called either CTestConfiguration.ini  or  DartConfigura‐
759       tion.tcl (the names are historical).  The format of the file is:
760
761          # Lines starting in '#' are comments.
762          # Other non-blank lines are key-value pairs.
763          <setting>: <value>
764
765       where <setting> is the setting name and <value> is the setting value.
766
767       In build trees generated by CMake, this configuration file is generated
768       by the CTest module if included by the project.  The module uses  vari‐
769       ables  to  obtain  a value for each setting as documented with the set‐
770       tings below.
771
772   Dashboard Client via CTest Script
773       CTest can perform testing driven by  a  cmake-language(7)  script  that
774       creates  and  maintains the source and build tree as well as performing
775       the testing steps.  Run the ctest  command  with  the  current  working
776       directory  set  outside  of  any build tree and use one of these signa‐
777       tures:
778
779          ctest -S <script>
780          ctest -SP <script>
781
782       The <script> file must call CTest  Commands  commands  to  run  testing
783       steps  explicitly  as  documented below.  The commands obtain Dashboard
784       Client Configuration settings from their arguments  or  from  variables
785       set in the script.
786

DASHBOARD CLIENT CONFIGURATION

788       The Dashboard Client Steps may be configured by named settings as docu‐
789       mented in the following sections.
790
791   CTest Start Step
792       Start a new dashboard submission to be composed of results recorded  by
793       the following steps.
794
795       In a CTest Script, the ctest_start() command runs this step.  Arguments
796       to the command may specify some of  the  step  settings.   The  command
797       first  runs  the  command-line  specified by the CTEST_CHECKOUT_COMMAND
798       variable, if set, to initialize the source directory.
799
800       Configuration settings include:
801
802       BuildDirectory
803              The full path to the project build tree.
804
805              · CTest Script variable: CTEST_BINARY_DIRECTORY
806
807              · CTest module variable: PROJECT_BINARY_DIR
808
809       SourceDirectory
810              The full path to the project source tree.
811
812              · CTest Script variable: CTEST_SOURCE_DIRECTORY
813
814              · CTest module variable: PROJECT_SOURCE_DIR
815
816   CTest Update Step
817       In a CTest Script, the ctest_update() command runs  this  step.   Argu‐
818       ments to the command may specify some of the step settings.
819
820       Configuration settings to specify the version control tool include:
821
822       BZRCommand
823              bzr  command-line  tool  to  use  if  source  tree is managed by
824              Bazaar.
825
826              · CTest Script variable: CTEST_BZR_COMMAND
827
828              · CTest module variable: none
829
830       BZRUpdateOptions
831              Command-line options to the BZRCommand when updating the source.
832
833              · CTest Script variable: CTEST_BZR_UPDATE_OPTIONS
834
835              · CTest module variable: none
836
837       CVSCommand
838              cvs command-line tool to use if source tree is managed by CVS.
839
840              · CTest Script variable: CTEST_CVS_COMMAND
841
842              · CTest module variable: CVSCOMMAND
843
844       CVSUpdateOptions
845              Command-line options to the CVSCommand when updating the source.
846
847              · CTest Script variable: CTEST_CVS_UPDATE_OPTIONS
848
849              · CTest module variable: CVS_UPDATE_OPTIONS
850
851       GITCommand
852              git command-line tool to use if source tree is managed by Git.
853
854              · CTest Script variable: CTEST_GIT_COMMAND
855
856              · CTest module variable: GITCOMMAND
857
858              The source tree is updated by git fetch followed  by  git  reset
859              --hard  to  the  FETCH_HEAD.  The result is the same as git pull
860              except that any local moficiations are overwritten.  Use  GITUp‐
861              dateCustom to specify a different approach.
862
863       GITInitSubmodules
864              If  set,  CTest  will  update the repository’s submodules before
865              updating.
866
867              · CTest Script variable: CTEST_GIT_INIT_SUBMODULES
868
869              · CTest module variable: CTEST_GIT_INIT_SUBMODULES
870
871       GITUpdateCustom
872              Specify a custom command line (as a semicolon-separated list) to
873              run  in  the source tree (Git work tree) to update it instead of
874              running the GITCommand.
875
876              · CTest Script variable: CTEST_GIT_UPDATE_CUSTOM
877
878              · CTest module variable: CTEST_GIT_UPDATE_CUSTOM
879
880       GITUpdateOptions
881              Command-line options to the GITCommand when updating the source.
882
883              · CTest Script variable: CTEST_GIT_UPDATE_OPTIONS
884
885              · CTest module variable: GIT_UPDATE_OPTIONS
886
887       HGCommand
888              hg command-line tool to use if source tree is managed by  Mercu‐
889              rial.
890
891              · CTest Script variable: CTEST_HG_COMMAND
892
893              · CTest module variable: none
894
895       HGUpdateOptions
896              Command-line options to the HGCommand when updating the source.
897
898              · CTest Script variable: CTEST_HG_UPDATE_OPTIONS
899
900              · CTest module variable: none
901
902       P4Client
903              Value of the -c option to the P4Command.
904
905              · CTest Script variable: CTEST_P4_CLIENT
906
907              · CTest module variable: CTEST_P4_CLIENT
908
909       P4Command
910              p4  command-line  tool  to use if source tree is managed by Per‐
911              force.
912
913              · CTest Script variable: CTEST_P4_COMMAND
914
915              · CTest module variable: P4COMMAND
916
917       P4Options
918              Command-line options to the P4Command for all invocations.
919
920              · CTest Script variable: CTEST_P4_OPTIONS
921
922              · CTest module variable: CTEST_P4_OPTIONS
923
924       P4UpdateCustom
925              Specify a custom command line (as a semicolon-separated list) to
926              run  in  the source tree (Perforce tree) to update it instead of
927              running the P4Command.
928
929              · CTest Script variable: none
930
931              · CTest module variable: CTEST_P4_UPDATE_CUSTOM
932
933       P4UpdateOptions
934              Command-line options to the P4Command when updating the source.
935
936              · CTest Script variable: CTEST_P4_UPDATE_OPTIONS
937
938              · CTest module variable: CTEST_P4_UPDATE_OPTIONS
939
940       SVNCommand
941              svn command-line tool to use if source tree is managed  by  Sub‐
942              version.
943
944              · CTest Script variable: CTEST_SVN_COMMAND
945
946              · CTest module variable: SVNCOMMAND
947
948       SVNOptions
949              Command-line options to the SVNCommand for all invocations.
950
951              · CTest Script variable: CTEST_SVN_OPTIONS
952
953              · CTest module variable: CTEST_SVN_OPTIONS
954
955       SVNUpdateOptions
956              Command-line options to the SVNCommand when updating the source.
957
958              · CTest Script variable: CTEST_SVN_UPDATE_OPTIONS
959
960              · CTest module variable: SVN_UPDATE_OPTIONS
961
962       UpdateCommand
963              Specify  the  version-control  command-line  tool to use without
964              detecting the VCS that manages the source tree.
965
966              · CTest Script variable: CTEST_UPDATE_COMMAND
967
968              · CTest module variable: <VCS>COMMAND when UPDATE_TYPE is <vcs>,
969                else UPDATE_COMMAND
970
971       UpdateOptions
972              Command-line options to the UpdateCommand.
973
974              · CTest Script variable: CTEST_UPDATE_OPTIONS
975
976              · CTest  module  variable: <VCS>_UPDATE_OPTIONS when UPDATE_TYPE
977                is <vcs>, else UPDATE_OPTIONS
978
979       UpdateType
980              Specify the version-control system that manages the source  tree
981              if  it  cannot be detected automatically.  The value may be bzr,
982              cvs, git, hg, p4, or svn.
983
984              · CTest Script variable: none, detected from source tree
985
986              · CTest   module   variable:   UPDATE_TYPE    if    set,    else
987                CTEST_UPDATE_TYPE
988
989       UpdateVersionOnly
990              Specify that you want the version control update command to only
991              discover the current version that is checked  out,  and  not  to
992              update to a different version.
993
994              · CTest Script variable: CTEST_UPDATE_VERSION_ONLY
995
996       Additional configuration settings include:
997
998       NightlyStartTime
999              In the Nightly dashboard mode, specify the “nightly start time”.
1000              With centralized version control  systems  (cvs  and  svn),  the
1001              Update  step  checks  out the version of the software as of this
1002              time so that multiple clients choose a common version  to  test.
1003              This  is not well-defined in distributed version-control systems
1004              so the setting is ignored.
1005
1006              · CTest Script variable: CTEST_NIGHTLY_START_TIME
1007
1008              · CTest  module  variable:  NIGHTLY_START_TIME  if   set,   else
1009                CTEST_NIGHTLY_START_TIME
1010
1011   CTest Configure Step
1012       In a CTest Script, the ctest_configure() command runs this step.  Argu‐
1013       ments to the command may specify some of the step settings.
1014
1015       Configuration settings include:
1016
1017       ConfigureCommand
1018              Command-line to launch the software configuration  process.   It
1019              will be executed in the location specified by the BuildDirectory
1020              setting.
1021
1022              · CTest Script variable: CTEST_CONFIGURE_COMMAND
1023
1024              · CTest   module    variable:    CMAKE_COMMAND    followed    by
1025                PROJECT_SOURCE_DIR
1026
1027       LabelsForSubprojects
1028              Specify  a  semicolon-separated  list  of  labels  that  will be
1029              treated as subprojects. This mapping will be passed on to  CDash
1030              when configure, test or build results are submitted.
1031
1032              · CTest Script variable: CTEST_LABELS_FOR_SUBPROJECTS
1033
1034              · CTest module variable: CTEST_LABELS_FOR_SUBPROJECTS
1035
1036              See Label and Subproject Summary.
1037
1038   CTest Build Step
1039       In a CTest Script, the ctest_build() command runs this step.  Arguments
1040       to the command may specify some of the step settings.
1041
1042       Configuration settings include:
1043
1044       DefaultCTestConfigurationType
1045              When the build system to be launched allows build-time selection
1046              of  the  configuration (e.g. Debug, Release), this specifies the
1047              default configuration to be built when no -C option is given  to
1048              the ctest command.  The value will be substituted into the value
1049              of MakeCommand to replace the literal string  ${CTEST_CONFIGURA‐
1050              TION_TYPE} if it appears.
1051
1052              · CTest Script variable: CTEST_CONFIGURATION_TYPE
1053
1054              · CTest  module variable: DEFAULT_CTEST_CONFIGURATION_TYPE, ini‐
1055                tialized by the CMAKE_CONFIG_TYPE environment variable
1056
1057       LabelsForSubprojects
1058              Specify a  semicolon-separated  list  of  labels  that  will  be
1059              treated  as subprojects. This mapping will be passed on to CDash
1060              when configure, test or build results are submitted.
1061
1062              · CTest Script variable: CTEST_LABELS_FOR_SUBPROJECTS
1063
1064              · CTest module variable: CTEST_LABELS_FOR_SUBPROJECTS
1065
1066              See Label and Subproject Summary.
1067
1068       MakeCommand
1069              Command-line to launch the software build process.  It  will  be
1070              executed  in  the  location specified by the BuildDirectory set‐
1071              ting.
1072
1073              · CTest Script variable: CTEST_BUILD_COMMAND
1074
1075              · CTest  module  variable:  MAKECOMMAND,  initialized   by   the
1076                build_command() command
1077
1078       UseLaunchers
1079              For  build  trees  generated  by CMake using one of the Makefile
1080              Generators  or  the  Ninja  generator,   specify   whether   the
1081              CTEST_USE_LAUNCHERS  feature is enabled by the CTestUseLaunchers
1082              module (also included by the CTest module).  When  enabled,  the
1083              generated  build  system  wraps each invocation of the compiler,
1084              linker, or custom command line with a “launcher”  that  communi‐
1085              cates  with  CTest via environment variables and files to report
1086              granular build warning and error information.  Otherwise,  CTest
1087              must “scrape” the build output log for diagnostics.
1088
1089              · CTest Script variable: CTEST_USE_LAUNCHERS
1090
1091              · CTest module variable: CTEST_USE_LAUNCHERS
1092
1093   CTest Test Step
1094       In  a CTest Script, the ctest_test() command runs this step.  Arguments
1095       to the command may specify some of the step settings.
1096
1097       Configuration settings include:
1098
1099       LabelsForSubprojects
1100              Specify a  semicolon-separated  list  of  labels  that  will  be
1101              treated  as subprojects. This mapping will be passed on to CDash
1102              when configure, test or build results are submitted.
1103
1104              · CTest Script variable: CTEST_LABELS_FOR_SUBPROJECTS
1105
1106              · CTest module variable: CTEST_LABELS_FOR_SUBPROJECTS
1107
1108              See Label and Subproject Summary.
1109
1110       TestLoad
1111              While running tests in parallel (e.g. with -j), try not to start
1112              tests  when  they  may  cause the CPU load to pass above a given
1113              threshold.
1114
1115              · CTest Script variable: CTEST_TEST_LOAD
1116
1117              · CTest module variable: CTEST_TEST_LOAD
1118
1119       TimeOut
1120              The default timeout for each test if not specified by the  TIME‐
1121              OUT test property.
1122
1123              · CTest Script variable: CTEST_TEST_TIMEOUT
1124
1125              · CTest module variable: DART_TESTING_TIMEOUT
1126
1127   CTest Coverage Step
1128       In  a CTest Script, the ctest_coverage() command runs this step.  Argu‐
1129       ments to the command may specify some of the step settings.
1130
1131       Configuration settings include:
1132
1133       CoverageCommand
1134              Command-line tool to perform  software  coverage  analysis.   It
1135              will be executed in the location specified by the BuildDirectory
1136              setting.
1137
1138              · CTest Script variable: CTEST_COVERAGE_COMMAND
1139
1140              · CTest module variable: COVERAGE_COMMAND
1141
1142       CoverageExtraFlags
1143              Specify command-line options to the CoverageCommand tool.
1144
1145              · CTest Script variable: CTEST_COVERAGE_EXTRA_FLAGS
1146
1147              · CTest module variable: COVERAGE_EXTRA_FLAGS
1148
1149              These options are the first arguments passed to CoverageCommand.
1150
1151   CTest MemCheck Step
1152       In a CTest Script, the ctest_memcheck() command runs this step.   Argu‐
1153       ments to the command may specify some of the step settings.
1154
1155       Configuration settings include:
1156
1157       MemoryCheckCommand
1158              Command-line  tool  to  perform  dynamic analysis.  Test command
1159              lines will be launched through this tool.
1160
1161              · CTest Script variable: CTEST_MEMORYCHECK_COMMAND
1162
1163              · CTest module variable: MEMORYCHECK_COMMAND
1164
1165       MemoryCheckCommandOptions
1166              Specify command-line options  to  the  MemoryCheckCommand  tool.
1167              They will be placed prior to the test command line.
1168
1169              · CTest Script variable: CTEST_MEMORYCHECK_COMMAND_OPTIONS
1170
1171              · CTest module variable: MEMORYCHECK_COMMAND_OPTIONS
1172
1173       MemoryCheckType
1174              Specify the type of memory checking to perform.
1175
1176              · CTest Script variable: CTEST_MEMORYCHECK_TYPE
1177
1178              · CTest module variable: MEMORYCHECK_TYPE
1179
1180       MemoryCheckSanitizerOptions
1181              Specify   options  to  sanitizers  when  running  with  a  sani‐
1182              tize-enabled build.
1183
1184              · CTest Script variable: CTEST_MEMORYCHECK_SANITIZER_OPTIONS
1185
1186              · CTest module variable: MEMORYCHECK_SANITIZER_OPTIONS
1187
1188       MemoryCheckSuppressionFile
1189              Specify a file containing suppression rules for the MemoryCheck‐
1190              Command tool.  It will be passed with options appropriate to the
1191              tool.
1192
1193              · CTest Script variable: CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
1194
1195              · CTest module variable: MEMORYCHECK_SUPPRESSIONS_FILE
1196
1197       Additional configuration settings include:
1198
1199       BoundsCheckerCommand
1200              Specify a MemoryCheckCommand that is known  to  be  command-line
1201              compatible with Bounds Checker.
1202
1203              · CTest Script variable: none
1204
1205              · CTest module variable: none
1206
1207       PurifyCommand
1208              Specify  a  MemoryCheckCommand  that is known to be command-line
1209              compatible with Purify.
1210
1211              · CTest Script variable: none
1212
1213              · CTest module variable: PURIFYCOMMAND
1214
1215       ValgrindCommand
1216              Specify a MemoryCheckCommand that is known  to  be  command-line
1217              compatible with Valgrind.
1218
1219              · CTest Script variable: none
1220
1221              · CTest module variable: VALGRIND_COMMAND
1222
1223       ValgrindCommandOptions
1224              Specify  command-line options to the ValgrindCommand tool.  They
1225              will be placed prior to the test command line.
1226
1227              · CTest Script variable: none
1228
1229              · CTest module variable: VALGRIND_COMMAND_OPTIONS
1230
1231   CTest Submit Step
1232       In a CTest Script, the ctest_submit() command runs  this  step.   Argu‐
1233       ments to the command may specify some of the step settings.
1234
1235       Configuration settings include:
1236
1237       BuildName
1238              Describe  the  dashboard  client  platform  with a short string.
1239              (Operating system, compiler, etc.)
1240
1241              · CTest Script variable: CTEST_BUILD_NAME
1242
1243              · CTest module variable: BUILDNAME
1244
1245       CDashVersion
1246              Legacy option.  Not used.
1247
1248              · CTest Script variable: none, detected from server
1249
1250              · CTest module variable: CTEST_CDASH_VERSION
1251
1252       CTestSubmitRetryCount
1253              Specify a number of attempts  to  retry  submission  on  network
1254              failure.
1255
1256              · CTest   Script   variable:   none,   use   the  ctest_submit()
1257                RETRY_COUNT option.
1258
1259              · CTest module variable: CTEST_SUBMIT_RETRY_COUNT
1260
1261       CTestSubmitRetryDelay
1262              Specify a delay before retrying submission on network failure.
1263
1264              · CTest  Script   variable:   none,   use   the   ctest_submit()
1265                RETRY_DELAY option.
1266
1267              · CTest module variable: CTEST_SUBMIT_RETRY_DELAY
1268
1269       CurlOptions
1270              Specify  a  semicolon-separated  list  of options to control the
1271              Curl library that  CTest  uses  internally  to  connect  to  the
1272              server.   Possible  options  are  CURLOPT_SSL_VERIFYPEER_OFF and
1273              CURLOPT_SSL_VERIFYHOST_OFF.
1274
1275              · CTest Script variable: CTEST_CURL_OPTIONS
1276
1277              · CTest module variable: CTEST_CURL_OPTIONS
1278
1279       DropLocation
1280              Legacy option.  When SubmitURL is not  set,  it  is  constructed
1281              from  DropMethod,  DropSiteUser, DropSitePassword, DropSite, and
1282              DropLocation.
1283
1284              · CTest Script variable: CTEST_DROP_LOCATION
1285
1286              · CTest   module   variable:   DROP_LOCATION   if   set,    else
1287                CTEST_DROP_LOCATION
1288
1289       DropMethod
1290              Legacy  option.   When  SubmitURL  is not set, it is constructed
1291              from DropMethod, DropSiteUser, DropSitePassword,  DropSite,  and
1292              DropLocation.
1293
1294              · CTest Script variable: CTEST_DROP_METHOD
1295
1296              · CTest    module    variable:    DROP_METHOD   if   set,   else
1297                CTEST_DROP_METHOD
1298
1299       DropSite
1300              Legacy option.  When SubmitURL is not  set,  it  is  constructed
1301              from  DropMethod,  DropSiteUser, DropSitePassword, DropSite, and
1302              DropLocation.
1303
1304              · CTest Script variable: CTEST_DROP_SITE
1305
1306              · CTest module variable: DROP_SITE if set, else CTEST_DROP_SITE
1307
1308       DropSitePassword
1309              Legacy option.  When SubmitURL is not  set,  it  is  constructed
1310              from  DropMethod,  DropSiteUser, DropSitePassword, DropSite, and
1311              DropLocation.
1312
1313              · CTest Script variable: CTEST_DROP_SITE_PASSWORD
1314
1315              · CTest  module  variable:  DROP_SITE_PASSWORD  if   set,   else
1316                CTEST_DROP_SITE_PASWORD
1317
1318       DropSiteUser
1319              Legacy  option.   When  SubmitURL  is not set, it is constructed
1320              from DropMethod, DropSiteUser, DropSitePassword,  DropSite,  and
1321              DropLocation.
1322
1323              · CTest Script variable: CTEST_DROP_SITE_USER
1324
1325              · CTest   module   variable:   DROP_SITE_USER   if   set,   else
1326                CTEST_DROP_SITE_USER
1327
1328       IsCDash
1329              Legacy option.  Not used.
1330
1331              · CTest Script variable: CTEST_DROP_SITE_CDASH
1332
1333              · CTest module variable: CTEST_DROP_SITE_CDASH
1334
1335       ScpCommand
1336              Legacy option.  Not used.
1337
1338              · CTest Script variable: CTEST_SCP_COMMAND
1339
1340              · CTest module variable: SCPCOMMAND
1341
1342       Site   Describe the dashboard client host site  with  a  short  string.
1343              (Hostname, domain, etc.)
1344
1345              · CTest Script variable: CTEST_SITE
1346
1347              · CTest  module  variable:  SITE, initialized by the site_name()
1348                command
1349
1350       SubmitURL
1351              The http or https URL of the dashboard server to send  the  sub‐
1352              mission to.
1353
1354              · CTest Script variable: CTEST_SUBMIT_URL
1355
1356              · CTest  module  variable:  SUBMIT_URL  if  set, else CTEST_SUB‐
1357                MIT_URL
1358
1359       TriggerSite
1360              Legacy option.  Not used.
1361
1362              · CTest Script variable: CTEST_TRIGGER_SITE
1363
1364              · CTest module variable: TRIGGER_SITE if set,  else  CTEST_TRIG‐
1365                GER_SITE
1366

SHOW AS JSON OBJECT MODEL

1368       When  the  --show-only=json-v1  command  line option is given, the test
1369       information is output in JSON format.  Version 1.0 of the  JSON  object
1370       model is defined as follows:
1371
1372       kind   The string “ctestInfo”.
1373
1374       version
1375              A  JSON  object  specifying the version components.  Its members
1376              are
1377
1378              major  A non-negative integer specifying the major version  com‐
1379                     ponent.
1380
1381              minor  A  non-negative integer specifying the minor version com‐
1382                     ponent.
1383
1384       backtraceGraph
1385              JSON object representing backtrace information with the  follow‐
1386              ing members:
1387
1388              commands
1389                     List of command names.
1390
1391              files  List of file names.
1392
1393              nodes  List of node JSON objects with members:
1394
1395                     command
1396                            Index  into  the commands member of the backtrace‐
1397                            Graph.
1398
1399                     file   Index into the files member of the backtraceGraph.
1400
1401                     line   Line number in the file where  the  backtrace  was
1402                            added.
1403
1404                     parent Index  into the nodes member of the backtraceGraph
1405                            representing the parent in the graph.
1406
1407       tests  A JSON array listing information about each test.  Each entry is
1408              a JSON object with members:
1409
1410              name   Test name.
1411
1412              config Configuration  that  the  test  can run on.  Empty string
1413                     means any config.
1414
1415              command
1416                     List where the first element is the test command and  the
1417                     remaining elements are the command arguments.
1418
1419              backtrace
1420                     Index into the nodes member of the backtraceGraph.
1421
1422              properties
1423                     Test  properties.   Can contain keys for each of the sup‐
1424                     ported test properties.
1425

SEE ALSO

1427       The following resources are available to get help using CMake:
1428
1429       Home Page
1430              https://cmake.org
1431
1432              The primary starting point for learning about CMake.
1433
1434       Online Documentation and Community Resources
1435              https://cmake.org/documentation
1436
1437              Links to available documentation and community resources may  be
1438              found on this web page.
1439
1440       Mailing List
1441              https://cmake.org/mailing-lists
1442
1443              For  help  and  discussion  about using cmake, a mailing list is
1444              provided at cmake@cmake.org.  The list is  member-post-only  but
1445              one  may  sign  up on the CMake web page.  Please first read the
1446              full documentation at https://cmake.org before posting questions
1447              to the list.
1448
1450       2000-2019 Kitware, Inc. and Contributors
1451
1452
1453
1454
14553.14.5                           Jun 01, 2019                         CTEST(1)
Impressum