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

NAME

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

SYNOPSIS

62          ctest [<options>]
63          ctest --build-and-test <path-to-source> <path-to-build>
64                --build-generator <generator> [<options>...]
65                [--build-options <opts>...] [--test-command <command> [<args>...]]
66          ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
67                [-- <dashboard-options>...]
68

DESCRIPTION

70       The ctest executable is the CMake test driver program.  CMake-generated
71       build trees created for projects  that  use  the  enable_testing()  and
72       add_test()  commands  have  testing support.  This program will run the
73       tests and report results.
74

OPTIONS

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

LABEL AND SUBPROJECT SUMMARY

576       CTest prints timing summary information for each LABEL  and  subproject
577       associated  with the tests run. The label time summary will not include
578       labels that are mapped to subprojects.
579
580       When the PROCESSORS test property is set, CTest will display a weighted
581       test  timing  result in label and subproject summaries. The time is re‐
582       ported with sec*proc instead of just sec.
583
584       The weighted time summary reported for each label or  subproject  j  is
585       computed as:
586
587          Weighted Time Summary for Label/Subproject j =
588              sum(raw_test_time[j,i] * num_processors[j,i], i=1...num_tests[j])
589
590          for labels/subprojects j=1...total
591
592       where:
593
594raw_test_time[j,i]: Wall-clock time for the i test for the j label or
595         subproject
596
597num_processors[j,i]: Value of the CTest PROCESSORS property for the i
598         test for the j label or subproject
599
600num_tests[j]:  Number of tests associated with the j label or subpro‐
601         ject
602
603total: Total number of labels or subprojects that have at  least  one
604         test run
605
606       Therefore,  the weighted time summary for each label or subproject rep‐
607       resents the amount of time that CTest gave to run the  tests  for  each
608       label  or  subproject  and gives a good representation of the total ex‐
609       pense of the tests for each label or subproject when compared to  other
610       labels or subprojects.
611
612       For  example, if SubprojectA showed 100 sec*proc and SubprojectB showed
613       10 sec*proc, then CTest allocated approximately 10 times  the  CPU/core
614       time  to run the tests for SubprojectA than for SubprojectB (e.g. so if
615       effort is going to be expended to reduce the cost of the test suite for
616       the whole project, then reducing the cost of the test suite for Subpro‐
617       jectA would likely have a larger impact than effort to reduce the  cost
618       of the test suite for SubprojectB).
619

BUILD AND TEST MODE

621       CTest  provides  a  command-line signature to configure (i.e. run cmake
622       on), build, and/or execute a test:
623
624          ctest --build-and-test <path-to-source> <path-to-build>
625                --build-generator <generator>
626                [<options>...]
627                [--build-options <opts>...]
628                [--test-command <command> [<args>...]]
629
630       The configure and test steps are optional. The arguments to  this  com‐
631       mand line are the source and binary directories.  The --build-generator
632       option must be provided to use --build-and-test.  If --test-command  is
633       specified then that will be run after the build is complete.  Other op‐
634       tions that affect this mode include:
635
636       --build-target
637              Specify a specific target to build.
638
639              If left out the all target is built.
640
641       --build-nocmake
642              Run the build without running cmake first.
643
644              Skip the cmake step.
645
646       --build-run-dir
647              Specify directory to run programs from.
648
649              Directory where programs will be after it has been compiled.
650
651       --build-two-config
652              Run CMake twice.
653
654       --build-exe-dir
655              Specify the directory for the executable.
656
657       --build-generator
658              Specify the generator to use. See the  cmake-generators(7)  man‐
659              ual.
660
661       --build-generator-platform
662              Specify the generator-specific platform.
663
664       --build-generator-toolset
665              Specify the generator-specific toolset.
666
667       --build-project
668              Specify the name of the project to build.
669
670       --build-makeprogram
671              Specify  the explicit make program to be used by CMake when con‐
672              figuring and building the project. Only applicable for Make  and
673              Ninja based generators.
674
675       --build-noclean
676              Skip the make clean step.
677
678       --build-config-sample
679              A  sample  executable to use to determine the configuration that
680              should be used.  e.g.  Debug, Release etc.
681
682       --build-options
683              Additional options for configuring the build  (i.e.  for  CMake,
684              not  for  the  build tool).  Note that if this is specified, the
685              --build-options keyword and its arguments must be the  last  op‐
686              tion  given  on the command line, with the possible exception of
687              --test-command.
688
689       --test-command
690              The command to run as the test step  with  the  --build-and-test
691              option.  All arguments following this keyword will be assumed to
692              be part of the test command line, so it must be the last  option
693              given.
694
695       --test-timeout
696              The time limit in seconds
697

DASHBOARD CLIENT

699       CTest  can operate as a client for the CDash software quality dashboard
700       application.  As a dashboard client, CTest performs a sequence of steps
701       to configure, build, and test software, and then submits the results to
702       a CDash server. The command-line signature used to submit to CDash is:
703
704          ctest (-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>)
705                [-- <dashboard-options>...]
706
707       Options for Dashboard Client include:
708
709       --group <group>
710              Specify what group you'd like to submit results to
711
712              Submit dashboard to specified group instead of default one.   By
713              default, the dashboard is submitted to Nightly, Experimental, or
714              Continuous group, but by specifying this option, the  group  can
715              be arbitrary.
716
717              This  replaces  the deprecated option --track.  Despite the name
718              change its behavior is unchanged.
719
720       -A <file>, --add-notes <file>
721              Add a notes file with submission.
722
723              This option tells CTest to include a notes file when  submitting
724              dashboard.
725
726       --tomorrow-tag
727              Nightly or Experimental starts with next day tag.
728
729              This is useful if the build will not finish in one day.
730
731       --extra-submit <file>[;<file>]
732              Submit extra files to the dashboard.
733
734              This option will submit extra files to the dashboard.
735
736       --http1.0
737              Submit using HTTP 1.0.
738
739              This  option will force CTest to use HTTP 1.0 to submit files to
740              the dashboard, instead of HTTP 1.1.
741
742       --no-compress-output
743              Do not compress test output when submitting.
744
745              This flag will turn off automatic compression  of  test  output.
746              Use  this  to  maintain  compatibility  with an older version of
747              CDash which doesn't support compressed test output.
748
749   Dashboard Client Steps
750       CTest defines an ordered list of testing steps of which some or all may
751       be run as a dashboard client:
752
753       Start  Start  a  new  dashboard  submission  to  be composed of results
754              recorded by the following steps.  See the CTest Start Step  sec‐
755              tion below.
756
757       Update Update  the  source  tree  from  its version control repository.
758              Record the old and new versions and the list of  updated  source
759              files.  See the CTest Update Step section below.
760
761       Configure
762              Configure  the  software by running a command in the build tree.
763              Record the configuration output log.  See  the  CTest  Configure
764              Step section below.
765
766       Build  Build  the  software  by  running  a  command in the build tree.
767              Record the build output log and detect warnings and errors.  See
768              the CTest Build Step section below.
769
770       Test   Test  the  software  by  loading  a CTestTestfile.cmake from the
771              build tree and executing the defined tests.  Record  the  output
772              and result of each test.  See the CTest Test Step section below.
773
774       Coverage
775              Compute coverage of the source code by running a coverage analy‐
776              sis tool and recording its output.  See the CTest Coverage  Step
777              section below.
778
779       MemCheck
780              Run the software test suite through a memory check tool.  Record
781              the test output, results, and issues reported by the tool.   See
782              the CTest MemCheck Step section below.
783
784       Submit Submit results recorded from other testing steps to the software
785              quality dashboard server.  See the CTest Submit Step section be‐
786              low.
787
788   Dashboard Client Modes
789       CTest defines three modes of operation as a dashboard client:
790
791       Nightly
792              This  mode  is intended to be invoked once per day, typically at
793              night.  It enables the Start, Update,  Configure,  Build,  Test,
794              Coverage,  and Submit steps by default.  Selected steps run even
795              if the Update step reports no changes to the source tree.
796
797       Continuous
798              This mode is intended to be invoked  repeatedly  throughout  the
799              day.  It enables the Start, Update, Configure, Build, Test, Cov‐
800              erage, and Submit steps by default, but exits after  the  Update
801              step if it reports no changes to the source tree.
802
803       Experimental
804              This mode is intended to be invoked by a developer to test local
805              changes.  It enables the Start, Configure, Build,  Test,  Cover‐
806              age, and Submit steps by default.
807
808   Dashboard Client via CTest Command-Line
809       CTest  can perform testing on an already-generated build tree.  Run the
810       ctest command with the current working directory set to the build  tree
811       and use one of these signatures:
812
813          ctest -D <mode>[<step>]
814          ctest -M <mode> [ -T <step> ]...
815
816       The  <mode>  must  be one of the above Dashboard Client Modes, and each
817       <step> must be one of the above Dashboard Client Steps.
818
819       CTest reads the Dashboard Client Configuration settings from a file  in
820       the  build  tree called either CTestConfiguration.ini or DartConfigura‐
821       tion.tcl (the names are historical).  The format of the file is:
822
823          # Lines starting in '#' are comments.
824          # Other non-blank lines are key-value pairs.
825          <setting>: <value>
826
827       where <setting> is the setting name and <value> is the setting value.
828
829       In build trees generated by CMake, this configuration file is generated
830       by  the CTest module if included by the project.  The module uses vari‐
831       ables to obtain a value for each setting as documented  with  the  set‐
832       tings below.
833
834   Dashboard Client via CTest Script
835       CTest  can  perform  testing  driven by a cmake-language(7) script that
836       creates and maintains the source and build tree as well  as  performing
837       the  testing steps.  Run the ctest command with the current working di‐
838       rectory set outside of any build tree and use one of these signatures:
839
840          ctest -S <script>
841          ctest -SP <script>
842
843       The <script> file must call CTest  Commands  commands  to  run  testing
844       steps  explicitly  as  documented below.  The commands obtain Dashboard
845       Client Configuration settings from their arguments  or  from  variables
846       set in the script.
847

DASHBOARD CLIENT CONFIGURATION

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

SHOW AS JSON OBJECT MODEL

1482       When the --show-only=json-v1 command line option is given, the test in‐
1483       formation  is  output  in  JSON format.  Version 1.0 of the JSON object
1484       model is defined as follows:
1485
1486       kind   The string "ctestInfo".
1487
1488       version
1489              A JSON object specifying the version  components.   Its  members
1490              are
1491
1492              major  A  non-negative integer specifying the major version com‐
1493                     ponent.
1494
1495              minor  A non-negative integer specifying the minor version  com‐
1496                     ponent.
1497
1498       backtraceGraph
1499              JSON  object representing backtrace information with the follow‐
1500              ing members:
1501
1502              commands
1503                     List of command names.
1504
1505              files  List of file names.
1506
1507              nodes  List of node JSON objects with members:
1508
1509                     command
1510                            Index into the commands member of  the  backtrace‐
1511                            Graph.
1512
1513                     file   Index into the files member of the backtraceGraph.
1514
1515                     line   Line  number  in  the file where the backtrace was
1516                            added.
1517
1518                     parent Index into the nodes member of the  backtraceGraph
1519                            representing the parent in the graph.
1520
1521       tests  A JSON array listing information about each test.  Each entry is
1522              a JSON object with members:
1523
1524              name   Test name.
1525
1526              config Configuration that the test can  run  on.   Empty  string
1527                     means any config.
1528
1529              command
1530                     List  where the first element is the test command and the
1531                     remaining elements are the command arguments.
1532
1533              backtrace
1534                     Index into the nodes member of the backtraceGraph.
1535
1536              properties
1537                     Test properties.  Can contain keys for each of  the  sup‐
1538                     ported test properties.
1539

RESOURCE ALLOCATION

1541       CTest provides a mechanism for tests to specify the resources that they
1542       need in a fine-grained way, and for  users  to  specify  the  resources
1543       available  on the running machine. This allows CTest to internally keep
1544       track of which resources are in use  and  which  are  free,  scheduling
1545       tests  in  a way that prevents them from trying to claim resources that
1546       are not available.
1547
1548       When the resource allocation feature is used, CTest will  not  oversub‐
1549       scribe  resources.  For  example, if a resource has 8 slots, CTest will
1550       not run tests that collectively use more than 8 slots at a  time.  This
1551       has  the  effect  of limiting how many tests can run at any given time,
1552       even if a high -j argument is used, if those tests all use  some  slots
1553       from  the same resource.  In addition, it means that a single test that
1554       uses more of a resource than is available on a machine will not run  at
1555       all (and will be reported as Not Run).
1556
1557       A common use case for this feature is for tests that require the use of
1558       a GPU.  Multiple tests can simultaneously allocate memory from  a  GPU,
1559       but if too many tests try to do this at once, some of them will fail to
1560       allocate, resulting in a failed test, even though the test  would  have
1561       succeeded if it had the memory it needed. By using the resource alloca‐
1562       tion feature, each test can specify how much memory it requires from  a
1563       GPU,  allowing CTest to schedule tests in a way that running several of
1564       these tests at once does not exhaust the GPU's memory pool.
1565
1566       Please note that CTest has no concept of what a GPU is or how much mem‐
1567       ory it has, nor does it have any way of communicating with a GPU to re‐
1568       trieve this information or perform any memory management. CTest  simply
1569       keeps  track  of a list of abstract resource types, each of which has a
1570       certain number of slots available for tests to use. Each test specifies
1571       the number of slots that it requires from a certain resource, and CTest
1572       then schedules them in a way that prevents the total number of slots in
1573       use  from  exceeding the listed capacity.  When a test is executed, and
1574       slots from a resource are allocated to that test, tests may assume that
1575       they  have  exclusive use of those slots for the duration of the test's
1576       process.
1577
1578       The CTest resource allocation feature consists of two inputs:
1579
1580       • The resource specification file, described below, which describes the
1581         resources available on the system.
1582
1583       • The  RESOURCE_GROUPS property of tests, which describes the resources
1584         required by the test.
1585
1586       When CTest runs a test, the resources allocated to that test are passed
1587       in the form of a set of environment variables as described below. Using
1588       this information to decide which resource to connect to is left to  the
1589       test writer.
1590
1591       The  RESOURCE_GROUPS property tells CTest what resources a test expects
1592       to use grouped in a way meaningful to the test.  The test  itself  must
1593       read  the  environment variables to determine which resources have been
1594       allocated to each group.  For example, each group may correspond  to  a
1595       process the test will spawn when executed.
1596
1597       Note  that  even  if a test specifies a RESOURCE_GROUPS property, it is
1598       still possible for that to test to run without any resource  allocation
1599       (and  without the corresponding environment variables) if the user does
1600       not pass a resource  specification  file.  Passing  this  file,  either
1601       through  the  --resource-spec-file  command-line  argument  or  the RE‐
1602       SOURCE_SPEC_FILE argument to ctest_test(), is what  activates  the  re‐
1603       source   allocation   feature.   Tests   should   check  the  CTEST_RE‐
1604       SOURCE_GROUP_COUNT environment variable to find out whether or not  re‐
1605       source allocation is activated. This variable will always (and only) be
1606       defined if resource allocation is activated. If resource allocation  is
1607       not  activated,  then  the CTEST_RESOURCE_GROUP_COUNT variable will not
1608       exist, even if it exists for the parent ctest process. If a test  abso‐
1609       lutely must have resource allocation, then it can return a failing exit
1610       code or use the SKIP_RETURN_CODE or SKIP_REGULAR_EXPRESSION  properties
1611       to indicate a skipped test.
1612
1613   Resource Specification File
1614       The  resource  specification  file  is  a  JSON file which is passed to
1615       CTest, either on the ctest(1) command line as --resource-spec-file,  or
1616       as  the  RESOURCE_SPEC_FILE  argument  of  ctest_test(). If a dashboard
1617       script is used and RESOURCE_SPEC_FILE is not specified,  the  value  of
1618       CTEST_RESOURCE_SPEC_FILE  in  the dashboard script is used instead.  If
1619       --resource-spec-file, RESOURCE_SPEC_FILE, and  CTEST_RESOURCE_SPEC_FILE
1620       in  the  dashboard  script  are  not  specified, the value of CTEST_RE‐
1621       SOURCE_SPEC_FILE in the CMake build is used instead. If none  of  these
1622       are specified, no resource spec file is used.
1623
1624       The  resource specification file must be a JSON object. All examples in
1625       this document assume the following resource specification file:
1626
1627          {
1628            "version": {
1629              "major": 1,
1630              "minor": 0
1631            },
1632            "local": [
1633              {
1634                "gpus": [
1635                  {
1636                    "id": "0",
1637                    "slots": 2
1638                  },
1639                  {
1640                    "id": "1",
1641                    "slots": 4
1642                  },
1643                  {
1644                    "id": "2",
1645                    "slots": 2
1646                  },
1647                  {
1648                    "id": "3"
1649                  }
1650                ],
1651                "crypto_chips": [
1652                  {
1653                    "id": "card0",
1654                    "slots": 4
1655                  }
1656                ]
1657              }
1658            ]
1659          }
1660
1661       The members are:
1662
1663       version
1664              An object containing a major integer field and a  minor  integer
1665              field.   Currently, the only supported version is major 1, minor
1666              0. Any other value is an error.
1667
1668       local  A JSON array of resource sets present on the system.  Currently,
1669              this array is restricted to being of size 1.
1670
1671              Each array element is a JSON object with members whose names are
1672              equal to the desired resource types, such as gpus.  These  names
1673              must  start with a lowercase letter or an underscore, and subse‐
1674              quent characters can be a lowercase letter, a digit, or  an  un‐
1675              derscore.  Uppercase  letters  are  not allowed, because certain
1676              platforms have case-insensitive environment variables.  See  the
1677              Environment  Variables section below for more information. It is
1678              recommended that the resource type name be the plural of a noun,
1679              such as gpus or crypto_chips (and not gpu or crypto_chip.)
1680
1681              Please  note that the names gpus and crypto_chips are just exam‐
1682              ples, and CTest does not interpret them in any way. You are free
1683              to  make up any resource type you want to meet your own require‐
1684              ments.
1685
1686              The value for each resource type is a JSON array  consisting  of
1687              JSON  objects, each of which describe a specific instance of the
1688              specified resource. These objects have the following members:
1689
1690              id     A string consisting of an identifier  for  the  resource.
1691                     Each  character in the identifier can be a lowercase let‐
1692                     ter, a digit, or an underscore.   Uppercase  letters  are
1693                     not allowed.
1694
1695                     Identifiers  must  be unique within a resource type. How‐
1696                     ever, they do not  have  to  be  unique  across  resource
1697                     types.  For  example, it is valid to have a gpus resource
1698                     named 0 and a crypto_chips resource named 0, but not  two
1699                     gpus resources both named 0.
1700
1701                     Please  note  that the IDs 0, 1, 2, 3, and card0 are just
1702                     examples, and CTest does not interpret them in  any  way.
1703                     You are free to make up any IDs you want to meet your own
1704                     requirements.
1705
1706              slots  An optional unsigned  number  specifying  the  number  of
1707                     slots  available on the resource. For example, this could
1708                     be megabytes of RAM  on  a  GPU,  or  cryptography  units
1709                     available  on a cryptography chip. If slots is not speci‐
1710                     fied, a default value of 1 is assumed.
1711
1712       In the example file above, there are four GPUs with ID's 0  through  3.
1713       GPU 0 has 2 slots, GPU 1 has 4, GPU 2 has 2, and GPU 3 has a default of
1714       1 slot. There is also one cryptography chip with 4 slots.
1715
1716   RESOURCE_GROUPS Property
1717       See RESOURCE_GROUPS for a description of this property.
1718
1719   Environment Variables
1720       Once CTest has decided which resources to allocate to a test, it passes
1721       this  information  to  the  test  executable as a series of environment
1722       variables. For each example below, we will  assume  that  the  test  in
1723       question       has       a       RESOURCE_GROUPS       property      of
1724       2,gpus:2;gpus:4,gpus:1,crypto_chips:2.
1725
1726       The following variables are passed to the test process:
1727
1728       CTEST_RESOURCE_GROUP_COUNT
1729              The total number of  groups  specified  by  the  RESOURCE_GROUPS
1730              property. For example:
1731
1732CTEST_RESOURCE_GROUP_COUNT=3
1733
1734              This  variable will only be defined if ctest(1) has been given a
1735              --resource-spec-file, or if ctest_test() has been  given  a  RE‐
1736              SOURCE_SPEC_FILE.  If  no  resource  specification file has been
1737              given, this variable will not be defined.
1738
1739       CTEST_RESOURCE_GROUP_<num>
1740              The list of resource types allocated to each  group,  with  each
1741              item  separated  by  a  comma.  <num>  is  a number from zero to
1742              CTEST_RESOURCE_GROUP_COUNT minus one. CTEST_RESOURCE_GROUP_<num>
1743              is defined for each <num> in this range. For example:
1744
1745CTEST_RESOURCE_GROUP_0=gpus
1746
1747CTEST_RESOURCE_GROUP_1=gpus
1748
1749CTEST_RESOURCE_GROUP_2=crypto_chips,gpus
1750
1751       CTEST_RESOURCE_GROUP_<num>_<resource-type>
1752              The  list of resource IDs and number of slots from each ID allo‐
1753              cated to each group for a given  resource  type.  This  variable
1754              consists  of  a  series of pairs, each pair separated by a semi‐
1755              colon, and with the two items in the pair separated by a  comma.
1756              The  first  item in each pair is id: followed by the ID of a re‐
1757              source of type <resource-type>, and the second  item  is  slots:
1758              followed  by the number of slots from that resource allocated to
1759              the given group. For example:
1760
1761CTEST_RESOURCE_GROUP_0_GPUS=id:0,slots:2
1762
1763CTEST_RESOURCE_GROUP_1_GPUS=id:2,slots:2
1764
1765CTEST_RESOURCE_GROUP_2_GPUS=id:1,slots:4;id:3,slots:1
1766
1767CTEST_RESOURCE_GROUP_2_CRYPTO_CHIPS=id:card0,slots:2
1768
1769              In this example, group 0 gets 2 slots from GPU 0, group 1 gets 2
1770              slots  from  GPU  2, and group 2 gets 4 slots from GPU 1, 1 slot
1771              from GPU 3, and 2 slots from cryptography chip card0.
1772
1773              <num> is a number from zero to CTEST_RESOURCE_GROUP_COUNT  minus
1774              one.   <resource-type> is the name of a resource type, converted
1775              to uppercase.  CTEST_RESOURCE_GROUP_<num>_<resource-type> is de‐
1776              fined  for  the  product of each <num> in the range listed above
1777              and each resource type listed in CTEST_RESOURCE_GROUP_<num>.
1778
1779              Because some platforms have case-insensitive names for  environ‐
1780              ment  variables,  the names of resource types may not clash in a
1781              case-insensitive environment.  Because of this, for the sake  of
1782              simplicity,  all  resource types must be listed in all lowercase
1783              in the resource specification file and  in  the  RESOURCE_GROUPS
1784              property,  and  they  are  converted  to  all  uppercase  in the
1785              CTEST_RESOURCE_GROUP_<num>_<resource-type> environment variable.
1786

SEE ALSO

1788       The following resources are available to get help using CMake:
1789
1790       Home Page
1791              https://cmake.org
1792
1793              The primary starting point for learning about CMake.
1794
1795       Online Documentation and Community Resources
1796              https://cmake.org/documentation
1797
1798              Links to available documentation and community resources may  be
1799              found on this web page.
1800
1801       Discourse Forum
1802              https://discourse.cmake.org
1803
1804              The Discourse Forum hosts discussion and questions about CMake.
1805
1807       2000-2021 Kitware, Inc. and Contributors
1808
1809
1810
1811
18123.20.3                           May 30, 2021                         CTEST(1)
Impressum