summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestMultiProcessHandler.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'tidy-use-equals-default'Brad King2019-01-291-4/+1
|\ | | | | | | | | | | | | | | | | 094f01d0f0 cleanup: Prefer compiler provided special member functions 55671b41d2 clang-tidy: Use `= default` Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Merge-request: !2841
| * cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-1/+0
| |
| * clang-tidy: Use `= default`Regina Pfeifer2019-01-251-4/+2
| | | | | | | | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* | cmSystemTools::RenameFile: Accepts std::string argsVitaly Stakhovsky2019-01-221-1/+1
|/
* CTest: Teach --show-only=json-v1 to filter out not-available testsBrad King2019-01-171-0/+5
| | | | | | Avoid exposing the internal special value that we use to track tests not available in the tested configuration. This also prevents clients from having to do the filtering themselves.
* CTest: Add --show-only[=format] option to print test infoJustin Goshi2019-01-101-0/+331
| | | | | | 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.
* cmCTestRunTest: Thread number of completed tests through start APIsMichael Wegner2018-09-251-2/+2
|
* CTest: Improve stop-time implementationBrad King2018-09-121-17/+32
| | | | | | | | | | The CTestTestStopTime test has been failing sporadically because the stop time causes the first internal test to have a timeout short enough that we might hit it and start the second test just before the stop time is reached. Instead we should track when a timeout is shortened in order to stay within the stop time. If a test times out for this reason then we should consider the stop time reached and not start any more tests.
* Merge topic 'ctest-fix-test-load'Brad King2018-09-111-20/+39
|\ | | | | | | | | | | | | 292ec157b6 CTest: Fix --test-load regression Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2362
| * CTest: Fix --test-load regressionBrad King2018-09-101-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `ctest --test-load` option is implemented in `StartNextTests` by not starting any tests when the load is too high and instead sleeping and then returning. Prior to commit v3.11.0-rc1~117^2 (CTest: Re-implement test process handling using libuv, 2017-12-10) our outer loop in `RunTests` would immediately call `StartNextTests` again. However, now the `uv_run` loop may simply terminate if there are no tests running because no events are left pending. Fix this by converting the sleep in `StartNextTests` into a libuv timer that it starts instead. This avoids leaving `uv_run` with no pending events. In the case that there are other running tests this also allows CTest to detect when they finish even if it during the wait period where we previously slept. This regression was not caught by the test suite because it only verified that we do not start new tests when the load was too high and not that we proceed to start tests when the load drops. Revise the test suite to cover both. Fixes: #18338
* | Update use of KWSys SystemTools::SplitString for new signatureBrad King2018-06-221-3/+2
|/
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-9/+11
| | | | | | | | | | | | 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.
* Merge topic 'cmWorkingDirectory_success_checking'Brad King2018-03-091-5/+14
|\ | | | | | | | | | | | | | | | | | | 5901699672 cmDepends: Remove attempt to change directory that always fails e60e4dfc88 cmWorkingDirectory: Check success of current dir changes e654622aee Tests: Add --build-and-test test case a865f0beb2 Tests: Confirm test working dir set successfully Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1817
| * cmWorkingDirectory: Check success of current dir changesCraig Scott2018-03-081-5/+14
| |
* | CTest: Add options to control test process affinity to CPUsBrad King2018-03-051-0/+28
|/ | | | | | | | | | In commit v2.8.0~170 (ENH: Added ctest test options PROCESSORS and RUN_SERIAL, 2009-09-07) CTest learned to track the number of processors allocated to running tests in order to balance it against the desired level of parallelism. Extend this idea by introducing a new `PROCESSOR_AFFINITY` test property to ask that CTest run a test with the CPU affinity mask set. This will allow a set of tests that are running concurrently to use disjoint CPU resources.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-4/+4
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Merge topic 'reduce-temporaries'Brad King2018-01-291-2/+2
|\ | | | | | | | | | | | | c85bb007 Reduce allocation of temporary values on heap. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1698
| * Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-2/+2
| | | | | | | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* | De-duplicate cmUVSignalHackRAIIBrad King2018-01-251-37/+2
| | | | | | | | | | | | This was added separately in `cmCTestMultiProcessHandler` and `cmQtAutoGenerator`. Factor out the duplicate code into a common header for re-use.
* | cmUVSignalHackRAII: Use nullptr instead of NULLBrad King2018-01-251-2/+2
|/
* CTest: Re-implement test process handling using libuvBryon Bean2018-01-101-33/+21
| | | | Co-Author: Brad King <brad.king@kitware.com>
* cmCTestMultiProcessHandler: Factor out duplicate test finish logicBryon Bean2018-01-101-36/+36
|
* cmCTestMultiProcessHandler: Add helper to make libuv use SA_RESTARTBrad King2018-01-101-0/+37
| | | | | | Prior to 1.19, libuv does not use SA_RESTART in its signal handler. Add a helper to cause libuv to install its handler and then revise the handler's flags to add SA_RESTART.
* cmCTestMultiProcessHandler: Fix StartNextTests loop on not-started testBrad King2018-01-081-18/+19
| | | | | | | | If `StartTestProcess` does not start a test, propagate this information back up to the `StartNextTests` loop so that it can move on to another candidate without allocating processors to a test that didn't run. Otherwise we have to wait for the next time `RunTests` loops around and calls `StartNextTests` again.
* cmCTestMultiProcessHandler: Check stop time more directlyBrad King2018-01-081-4/+11
| | | | | | | | Avoid creating a cmCTestRunTest instance if the stop time has been reached. If the stop time occurs in the small time between creating an instance and computing the child process timeout, we will simply compute a zero timeout. This is already done for the case that we StartAgain after the stop time.
* CTest: correct misleading warning message for RUN_SERIAL testsWouter Klouwen2017-11-091-0/+12
| | | | | | | | | As reported in issue 17167, when only RUN_SERIAL tests remain, CTest can display a misleading message that it is waiting for the load to come down when in fact, it cannot start any new tests. This commit fixes that by determining whether this circumstance is what's happening and adds an additional warning message in this case.
* Replace empty-string comparisons with checking against `empty()`.Pavel Solodovnikov2017-09-211-1/+1
|
* Meta: modernize old-fashioned loops to range-based `for` (CTest).Pavel Solodovnikov2017-09-141-101/+67
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Merge topic 'display-ctest-disabled'Brad King2017-06-051-2/+6
|\ | | | | | | | | | | | | | | f59d729c ctest: Display disabled status when ctest -N is called Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Craig Scott <craig.scott@crascit.com> Merge-request: !923
| * ctest: Display disabled status when ctest -N is calledChuck Atkins2017-06-021-2/+6
| |
* | clang-tidy: use .empty() to check emptynessDaniel Pfeifer2017-04-211-1/+1
| |
* | 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'
* Add 'DISABLED' test propertyBetsy McPhail2017-03-291-1/+3
| | | | | | When this property is set, the test is skipped and its status is automatically set to 'Not Run'. A disabled test will not be counted in the total number of tests and its completion status will be 'Disabled'.
* cmWorkingDirectory: use the new classBen Boeckel2017-03-061-8/+3
| | | | | | These functions just need to change the directory for a block of code and then go back to the caller's expected location. Use cmWorkingDirectory to ensure that all return paths are handled.
* clang-tidy: apply readability-redundant-string-init fixesDaniel Pfeifer2016-12-121-1/+1
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* CTest: Add support for test fixturesCraig Scott2016-09-201-0/+10
| | | | | | | | | | | Add new test properties: * FIXTURES_SETUP * FIXTURES_CLEANUP * FIXTURES_REQUIRED to specify the roles and dependencies of tests providing/using test fixtures.
* CTest: fix include-what-you-use violationsDaniel Pfeifer2016-08-251-3/+8
|
* CTest: don't use else after returnDaniel Pfeifer2016-08-181-2/+1
|
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-4/+6
|
* Add missing braces around statements.Daniel Pfeifer2016-06-101-4/+8
| | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* Remove c_str() calls from stream arguments.Daniel Pfeifer2016-06-061-3/+3
| | | | | | Mostly automated: git grep -l '.c_str() <<' | xargs sed -i 's|\.c_str() <<| <<|g'
* Pass arguments that are not modified as const&.Daniel Pfeifer2016-05-261-1/+1
| | | | | | | Use clang-tidy's performance-unnecessary-value-param checker to find value parameter declarations of expensive to copy types that are not modified inside the function. Ignore findings in kwsys. After applying the fix-its, manually change `const T&` to `T const&`.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-403/+298
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* CTest: Fix regression in handling of a RUN_SERIAL test that failsBrad King2015-10-231-5/+4
| | | | | | | Refactoring in commit v3.4.0-rc1~390^2~1 (cmCTestMultiProcessHandler: Refactor RUN_SERIAL implementation, 2015-06-01) forgot to update a code path for cleaning up after a failed RUN_SERIAL test. This causes an infinite loop after a RUN_SERIAL test fails. Fix it and add a test.
* ctest: Optionally avoid starting tests that may exceed a given CPU loadBetsy McPhail2015-06-301-7/+117
| | | | | | | | | | | | | | Add a TestLoad setting to CTest that can be set via a new --test-load command-line option, CTEST_TEST_LOAD variable, or TEST_LOAD option to the ctest_test command. Teach cmCTestMultiProcessHandler to measure the CPU load and avoid starting tests that may take more than the spare load currently available. The expression <current_load> + <test_processors> <= <max-load> must be true to start a new test. Co-Author: Zack Galbreath <zack.galbreath@kitware.com>