summaryrefslogtreecommitdiffstats
path: root/Source/ctest.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'ctest-windows-std-handles' into release-3.29Brad King2024-06-241-1/+0
|\ | | | | | | | | | | | | e4d0169107 ctest: Fix spurious build failures with CTEST_USE_LAUNCHERS on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9598
| * ctest: Fix spurious build failures with CTEST_USE_LAUNCHERS on WindowsBrad King2024-06-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the stdio handle inheritance suppression originally added by commit f262298bb0 (... do not inherit pipes in child procs for ctest so it can kill them, 2007-09-11, v2.6.0~1136). It's not clear what problem it was trying to solve, was only done in `ctest` and not `cmake`, and since commit 9c3ffe2474 (BUG: fix problem with stdout and stderr not showing up in ms dos shells, 2007-09-25, v2.6.0~1066) has not been done in `ctest` launched under interactive consoles. Furthermore, the code has been spuriously breaking stdio when `ctest` is started with both stdout and stderr connected to the same pipe, such as when `ctest --launch` is used under `ninja`. This is because it used `DuplicateHandle` with `DUPLICATE_CLOSE_SOURCE` on the stdout handle and then the stderr handle. If the handles are the same, then the stderr handle becomes invalid in between these operations, leading to likely-undefined behavior. Since commit 96b3dd329e (cmCTestLaunchReporter: Replace cmsysProcess with cmUVProcessChain, 2023-07-26, v3.28.0-rc1~138^2~2) this became more noticeable because `uv_spawn` performs additional verification on stdio handles. This could be fixed by instead suppressing inheritance via SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0); However, the functionality no longer seems necessary, so remove it.
* | ctest: Allow passing -j without value to choose a contextual defaultBrad King2024-03-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Under job server integration, added by commit 80fe56c481 (ctest: Add support for running under a make job server on POSIX systems, 2023-11-15, v3.29.0-rc1~324^2), use a very high default so that parallelism is effectively limited only by available job server tokens. Otherwise, choose a default limit based on the number of processors. Also allow passing `0` to specify unbounded parallelism. Fixes: #25739
* | ctest: add command line option to exclude tests listed in a given fileAlex Neundorf2024-01-251-0/+2
| | | | | | | | | | | | | | Add `--exclude-from-file <filename>` to exclude the tests listed in the given file. Issue: #25455
* | ctest: add command line option to run the tests listed in a given fileAlex Neundorf2024-01-251-0/+1
| | | | | | | | | | | | | | | | Add `--tests-from-file <filename>` to run only the tests listed in the given file. The test names must match exactly, no regexps or something. The listed tests can still be filtered with a regexp using -R. Issue: #25455
* | ctest: allow HTTP headers via command lineMatthew Woehlke2024-01-081-1/+2
|/ | | | Add ability to specify HTTP headers via `ctest -T Submit`.
* cmDocumentationEntry: Drop all user provided ctors for C++ >= 14Alex Turbov2022-11-171-3/+3
| | | | | | | | | | | There is no need for them cuz: - the last field has a default value - all static instances use 2 arguments convertible to `std::string` - "dynamic" instances used for _Generator_ doc entries access fields diectly using default constructed instance Moreover, compiler may generate move ctor/assign when needed.
* cmDocumentation: `char*[][2]` → `cmDocumentationEntry[N]`Alex Turbov2022-11-171-8/+7
| | | | | | | | | | Use fixed size arrays of `cmDocumentationEntry` items instead of open arrays of two `char` pointers when describe program options help screens. Also, drop `const char*[][2]` overloads of methods of `cmDocumentation` and `cmDocumentationSection` classes in the sake of generic (template) appenders introduced earlier.
* ctest.cxx: Eliminate redundand trenary operatorAlex Turbov2022-11-171-1/+1
|
* ctest.cxx: Optimize `std::ostream::operator<<` callsAlex Turbov2022-11-171-6/+4
|
* ctest.cxx: Use anonymous namespace instead of `static` arraysAlex Turbov2022-11-171-5/+6
|
* ctest: add option for output truncationFrank Winklmeier2022-03-081-0/+3
| | | | | | | | | | Add `--test-output-truncation` to `ctest`. This option can be used to customize which part of the test output is being truncated. Currently supported values are `tail`, `middle` and `head`. Also add equivalent `CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable. Fixes: #23206
* ctest: Add support for writing test results in JUnit XML formatZack Galbreath2021-04-261-0/+1
| | | | Addresses #18654
* ctest: Support multiple -L and -LE options to mean "AND"Adriaan de Groot2021-03-281-4/+6
| | | | Fixes: #21087
* ctest: Add support for '--prefix=<prefix>' form of the argumentBrad King2021-02-231-1/+2
| | | | | | | The main `cmake --preset` argument for configure presets supports both forms, so support it for `ctest --preset` too. Fixes: #21855
* cmake-presets: Add build and test presetsSam Freed2021-02-011-0/+2
| | | | Fixes: #21391
* Ctest: Support build tree on command lineAsit Dhal2020-12-171-0/+1
| | | | Fixes: #21268
* cmConsoleBuf: Factor out cout/cerr console buffer managementBrad King2020-10-141-9/+5
|
* clang-format: Fix include block order in ctest.cxx and cpack.cxxBrad King2020-10-141-4/+5
|
* ctest: add option --stop-on-failureJohnny Jazeix2020-04-201-0/+1
| | | | | | To stop the tests once one has failed Fixes: #16628
* Add --no-tests=<[error|ignore]> option to CTestStefan Dinkelacker2020-01-311-0/+2
| | | | | | | | | If no tests were found, the default behavior of CTest is to always log an error message but to return an error code in script mode only. This option unifies the behavior of CTest by either returning an error code if no tests were found or by ignoring it. Signed-off-by: Stefan Dinkelacker <s.dinkelacker@dkfz-heidelberg.de>
* Merge topic 'ctest-repeat'Craig Scott2019-11-191-3/+3
|\ | | | | | | | | | | | | 32c165d263 CTest: Consolidate '--repeat-* n' options as `--repeat *:n` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4053
| * CTest: Consolidate '--repeat-* n' options as `--repeat *:n`Brad King2019-11-151-3/+3
| | | | | | | | | | | | | | Combine `--repeat-until-fail`, `--repeat-until-pass`, and `--repeat-after-timeout` to create a single `--repeat <mode>:<n>` option. Retain `--repeat-until-fail` too because that has been available in previous releases.
* | Windows: Restore suppression of error report popups in CI buildsBrad King2019-11-151-1/+0
|/ | | | | | | | | | | | | On Windows, libuv uses `_CrtSetReportHook` to install a handler it uses to suppress assertions on invalid file descriptors in `_get_osfhandle`. This removes the handler we install in CI environments to suppress interactive popups. Move installation of our handler to after libuv is initialized so that our handler is actually used. Unfortunately this also removes libuv's handler and so may cause Debug builds under CI to abort on invalid file descriptors instead of simply converting them to `INVALID_HANDLE_VALUE`. If this becomes a problem we may need to modify libuv to make its hook more configurable.
* Merge branch 'backport-ctest-resource-groups'Brad King2019-11-051-1/+1
|\
| * CTest: Rename hardware -> resources for CMake variables, command optionsCraig Scott2019-11-051-1/+1
| | | | | | | | | | | | Only changes the user-visible effects of renaming hardware allocation to resource allocation. Code changes are the minimum needed to achieve that.
* | ctest: Add --repeat-after-timeout optionBrad King2019-10-291-0/+2
| | | | | | | | | | Add an option to re-run tests if they timeout. This will help tolerate sporadic timeouts on busy machines.
* | ctest: Add --repeat-until-pass optionBrad King2019-10-291-2/+3
|/ | | | | | | | | Add an option to re-run tests if they fail. This will help tolerate sporadic failures. Issue: #17010 Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Co-Author: Chuck Atkins <chuck.atkins@kitware.com>
* CTest: Allocate hardware to testsKyle Edwards2019-10-021-0/+1
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-3/+4
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* ctest: rename TRACK to GROUPZack Galbreath2019-08-221-1/+3
| | | | | | | | | | Update command-line options, script variables, and documentation to use the term "group" instead of "track". The old terms are still available for now, but they are now undocumented. This makes our terminology more consistent with CDash. The goal of this change is to make it more clear to our users how CTest and CDash interact with each other.
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-2/+2
|
* Ensure stdin, stdout, and stderr pipes are always openBrad King2019-05-021-0/+1
| | | | | | | | | | | | | On non-Windows platforms libuv assumes that file descriptors 0-2 are always used for standard pipes and never for anything else. Otherwise, libuv may re-use one of these descriptors and then fail an assertion when closing it. Similarly, On Windows platforms our ConsoleBuf implementation assumes that the standard handles are always open. If CMake is run with any standard pipes closed, open them with `/dev/null` or `NUL` to satisfy these assumptions. Fixes: #19219
* cmCTest: Use concrete accessor functions for TestingHandlersRegina Pfeifer2019-03-201-2/+1
|
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-1/+1
|
* CTest: Add --show-only[=format] option to print test infoJustin Goshi2019-01-101-1/+4
| | | | | | format can be 'human' to print the current text format or 'json-v1' to print the test object model in json format and is useful for IDEs who want to gather information about the tests. Defaults to 'human' format.
* Help: clarify documentation of ctest --timeoutRegina Pfeifer2018-12-091-1/+1
|
* ctest: Add option for live progress summary in terminalMichael Wegner2018-09-261-0/+1
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-40/+57
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Extend libuv file translate mode workaround to all executablesBrad King2018-01-231-0/+1
| | | | | | | | | | | | | | | Since libuv commit v1.14.1~7 (win: add uv__once_init() calls, 2017-08-30) the libuv initialization of the file translate mode may take place even if we do not use a uv loop. This change was included in our libuv update commit f4a26c748b (libuv 2018-01-19). Therefore use of libuv even through `cmSystemTools::GetRealPath` in any executable may trigger its file translate mode setting. Factor out the logic added to `cmake.exe` by commit v3.9.0-rc4~10^2 (cmake: Fix default file translate mode when using libuv, 2017-06-13) and re-use to initialize all executables. Issue: #16962
* cmCTest: Remove dead codeBetsy McPhail2017-11-071-2/+0
| | | | The option 'ctest-config' is ignored.
* Improve several occurrences of vector::push_back in loopsMatthias Maennich2017-09-281-0/+1
| | | | | | | Fix issues diagnosed by clang-tidy by pre-allocating the vector capacity before the loop [performance-inefficient-vector-operation]. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-5/+5
|
* Display subproject timing summaryBetsy McPhail2017-07-101-0/+2
| | | | Use the '--no-subproject-summary' option to disable timing summary.
* ctest: remove unused cmake instanceDaniel Pfeifer2017-05-081-6/+0
|
* Add ctest options for limiting which tests fixtures addCraig Scott2017-05-011-0/+12
| | | | | The new options allow the user to restrict the setup and cleanup tests automatically added for fixtures.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-3/+3
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Windows: Use UTF-8 for pipes in CMake, CTest and CPackDāvis Mosāns2016-11-291-0/+2
| | | | | Applications which process CMake output will need to decode it as UTF-8 instead of console's codepage.