/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include #include #include #include #include "cmsys/Encoding.hxx" #include "cmCTest.h" #include "cmConsoleBuf.h" #include "cmDocumentation.h" #include "cmDocumentationEntry.h" #include "cmSystemTools.h" #include "CTest/cmCTestLaunch.h" #include "CTest/cmCTestScriptHandler.h" namespace { const cmDocumentationEntry cmDocumentationName = { {}, " ctest - Testing driver provided by CMake." }; const cmDocumentationEntry cmDocumentationUsage = { {}, " ctest [options]" }; const cmDocumentationEntry cmDocumentationOptions[] = { { "--preset , --preset=", "Read arguments from a test preset." }, { "--list-presets", "List available test presets." }, { "-C , --build-config ", "Choose configuration to test." }, { "--progress", "Enable short progress output from tests." }, { "-V,--verbose", "Enable verbose output from tests." }, { "-VV,--extra-verbose", "Enable more verbose output from tests." }, { "--debug", "Displaying more verbose internals of CTest." }, { "--output-on-failure", "Output anything outputted by the test program " "if the test should fail." }, { "--stop-on-failure", "Stop running the tests after one has failed." }, { "--test-output-size-passed ", "Limit the output for passed tests " "to bytes" }, { "--test-output-size-failed ", "Limit the output for failed tests " "to bytes" }, { "--test-output-truncation ", "Truncate 'tail' (default), 'middle' or 'head' of test output once " "maximum output size is reached" }, { "-F", "Enable failover." }, { "-j , --parallel ", "Run the tests in parallel using the " "given number of jobs." }, { "-Q,--quiet", "Make ctest quiet." }, { "-O , --output-log ", "Output to log file" }, { "--output-junit ", "Output test results to JUnit XML file." }, { "-N,--show-only[=format]", "Disable actual execution of tests. The optional 'format' defines the " "format of the test information and can be 'human' for the current text " "format or 'json-v1' for json format. Defaults to 'human'." }, { "-L , --label-regex ", "Run tests with labels matching regular expression. " "With multiple -L, run tests where each " "regular expression matches at least one label." }, { "-R , --tests-regex ", "Run tests matching regular " "expression." }, { "-E , --exclude-regex ", "Exclude tests matching regular " "expression." }, { "-LE , --label-exclude ", "Exclude tests with labels matching regular expression. " "With multiple -LE, exclude tests where each " "regular expression matches at least one label." }, { "-FA , --fixture-exclude-any ", "Do not automatically " "add any tests for " "fixtures matching " "regular expression." }, { "-FS , --fixture-exclude-setup ", "Do not automatically " "add setup tests for " "fixtures matching " "regular expression." }, { "-FC , --fixture-exclude-cleanup ", "Do not automatically " "add cleanup tests for " "fixtures matching " "regular expression." }, { "-D , --dashboard ", "Execute dashboard test" }, { "-D :=", "Define a variable for script mode" }, { "-M , --test-model ", "Sets the model for a dashboard" }, { "-T , --test-action ", "Sets the dashboard action to " "perform" }, { "--group ", "Specify what build group on the dashboard you'd like to " "submit results to." }, { "-S