summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmProcess.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-92/+93
| | | | | | | | | | | | 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.
* CTest: Add options to control test process affinity to CPUsBrad King2018-03-051-1/+17
| | | | | | | | | | 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.
* CTest: introduce cmDurationWouter Klouwen2018-01-231-5/+5
| | | | | | | | This commit introduces cmDuration as a typedef for std::chrono::duration<double, std::ratio<1>>. It is less verbose and provides for a point to put future common functionality for durations. No functional change intended.
* CTest: Fix process output read error casesBrad King2018-01-171-0/+5
| | | | | | | The libuv documentation states that the stream read callback may be called with `nread == 0` for EAGAIN. Handle this gracefully. It also states that the callee is responsible for closing the stream on error. Always close the stream for `nread < 0`.
* CTest: Fix decoding of MBCS character split by bufferingBrad King2018-01-171-8/+7
| | | | | | Use a single `cmProcessOutput` instance persistently to decode all output of a test process so that partial character bytes can be buffered.
* CTest: Re-implement test process handling using libuvBryon Bean2018-01-101-86/+583
| | | | Co-Author: Brad King <brad.king@kitware.com>
* cmProcess: Use explicit enum for process exit exceptionBryon Bean2018-01-101-2/+16
| | | | Translate the values from KWSys Process.
* cmProcess: Use explicit enum for process stateBryon Bean2018-01-101-5/+21
| | | | Translate the values from KWSys Process.
* cmProcess: Remove unused ReportStatus methodBryon Bean2018-01-101-59/+0
|
* CTest: Simplify std::chrono::duration<double> conversion to doubleBrad King2017-12-081-16/+3
| | | | | | | | | The ratio of ticks to seconds for this type is 1, so we can just use its `count()` directly. This also avoids converting through the integer representation of `std::chrono::milliseconds`, which has a much smaller allowed range. Drop our `cmsysProcess_SetTimeout` wrapper as it is now very thin.
* CTest: convert timeouts to std::chrono::durationWouter Klouwen2017-12-041-13/+25
| | | | | | | | | This commit continues the refactoring of CTest to adopt std::chrono. After the last sets of changes that introduced std::chrono::steady_clock and std::chrono::system_clock respectively, it makes sense to have all the timeouts be stored as std::chrono::duration. No functional change intended.
* IWYU: Add mappings for std::enable_if on chrono durationsBrad King2017-11-281-1/+0
| | | | | | | | IWYU incorrectly classifies this internal STL type as not internal, and suggests including `<type_traits>` for it. Work around the problem by mapping the offending names to a file that we always include. See include-what-you-use issue 434.
* CTest: use std::chrono::steady_clock for time keepingWouter Klouwen2017-11-141-5/+9
| | | | | | | | | | | | It was reported in issue #17345 that CTest does not use monotonic time to report test duration. Monotonic clocks are not affected by large NTP adjustments or things like daylight savings time. As CMake 3.10 requires C++11, which introduced std::chrono, this commit moves the time keeping in CTest from cmSystemTools::GetTime() to std::chrono::steady_clock. Fixes: #17345
* Meta: modernize old-fashioned loops to range-based `for` (CTest).Pavel Solodovnikov2017-09-141-3/+2
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* 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-2/+2
|
* CTest: Report more detail about system exceptions in testsBill Hoffman2017-07-121-0/+5
| | | | | This passes the system exception string up to CDash and to the command line instead of just printing "other".
* 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-1/+1
| | | | | Applications which process CMake output will need to decode it as UTF-8 instead of console's codepage.
* Windows: Encode child process output to internally-used encodingDāvis Mosāns2016-11-141-1/+9
| | | | | | Typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need to encode that to our internally-used encoding (`KWSYS_ENCODING_DEFAULT_CODEPAGE`).
* CTest: report time spent after matching outputZack Galbreath2016-10-171-0/+1
| | | | | When using the TIMEOUT_AFTER_MATCH test property, only report the time spent by the test after the matching output was found.
* 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: fix include-what-you-use violationsDaniel Pfeifer2016-08-251-2/+3
|
* CTest: don't use else after returnDaniel Pfeifer2016-08-181-3/+3
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-2/+2
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-109/+73
| | | | | | | | | | | | | 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-3/+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.
* 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: Optionally use a secondary test timeout after matching outputZack Galbreath2016-03-221-0/+10
| | | | | | Allow a test N seconds to complete after we detect a matching line in its output. Activate this behavior with a new TIMEOUT_AFTER_MATCH test property.
* CTest: Capture test stdout/stderr through one pipe (#15600)Brad King2015-06-031-15/+4
| | | | | | | Use the KWSys Process "MergeOutput" option to give each test child process the same pipe for both stdout and stderr. This allows natural merging of stdout and stderr together instead of merging on arbitrary buffered read boundaries as before.
* Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
|
* Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-1/+1
|
* CTest: make sure never to report negative test times (#14132)Rolf Eike Beer2013-05-101-0/+8
| | | | | | | Because of clock scew between processors or just because of someone changing the system time the end timestamp may be before the start time. Reporting a negative time doesn't any sense, just report zero there as it already happens for really fast tests.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-5/+5
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Fix for bug #10859, ctest exit exception incorrectly reported.Bill Hoffman2010-06-221-0/+6
| | | | | CTest was using the return value from the program instead of the exit exception value for the process.
* BUG: We shouldn't be setting the HideWindow option on the test processes we ↵Zach Mullen2010-02-191-1/+0
| | | | create.
* Handle multiple carriage return issue on windows VS9. Also make sure that ↵Zach Mullen2009-11-161-1/+4
| | | | running ctest in showonly mode does not kill our cost store, since many ctest tests do this and corrupt our cost data.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* Avoid shadowing std::vector memberBrad King2009-09-121-3/+3
| | | | | | The cmProcess::Buffer class derives from std::vector. We were using local variable 'data' in the GetLine method but this name shadowed a member of vector with GNU. This renames it to 'text'.
* Fix new CTest output handling for no newlineBrad King2009-09-111-0/+1
| | | | | | When we clear the buffer for an output pipe after returning the last partial line (without a newline) we need to set the partial line range to empty. Otherwise the buffer object is left in an inconsistent state.
* Rewrite CTest child output handlingBrad King2009-09-111-145/+83
| | | | | | | | | | | | | | This commit fixes cmCTestRunTest and cmProcess to more efficiently handle child output. We now use the buffer for each child output pipe to hold at most a partial line plus one new block of data at a time. All complete lines are scanned in-place, and then only the partial line at the end of the buffer is moved back to the beginning before appending new data. We also simplify the cmProcess interface by making GetNextOutputLine the only method that needs to be called while the process is running. This simplifies cmCTestRunTest so that CheckOutput can be called until it returns false when the process is done.
* BUG: Fixed extraneous newlines from ctest process outputZach Mullen2009-09-081-20/+25
|
* BUG: Fixed issue where ctest would hang if a process terminated with output ↵Zach Mullen2009-09-081-6/+28
| | | | in its buffers but no newline
* Fixed ctest output processing. Should now display output as it occurs, as ↵Zach Mullen2009-09-041-14/+18
| | | | well as be able to consume multiple lines if they exist within the timeout.
* Fixed output as-it-happens issue. Now displays output as it receives each ↵Zach Mullen2009-09-041-0/+4
| | | | newline.
* Added the test property EXPENSIVE, which denotes that the given test(s) ↵Zach Mullen2009-09-041-0/+5
| | | | should be started prior to tests that are not marked as such. Also fixed test dependencies, and a few uninitialized variables in cmProcess.
* Fixed 2 unused variable warningsZach Mullen2009-09-031-3/+1
|
* Allowed tests to pull more than one line of output in their quantum. Fixed ↵Zach Mullen2009-09-031-54/+51
| | | | uninitialized variables in the case that the test process could not start.
* ENH: fix return value to ctest_build and remove debug print in cmProcessBill Hoffman2009-01-141-1/+1
|
* ENH: allow ctest_build to return error and warning countsBill Hoffman2009-01-141-1/+1
|