summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-1/+1
| | | | | | | | | | | | | | | After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
* 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-104/+139
| | | | | | | | | | | | 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_start: read model from TAG fileKyle Edwards2018-05-091-5/+55
| | | | | | | | This change reworks ctest_start() so that simply calling ctest_start(APPEND) will read all the information from the TAG file. On top of that, it relaxes the argument parsing for ctest_start() to allow greater flexibility in the argument ordering, and the documentation for ctest_start() has been cleaned up.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-20/+18
| | | | | | | | | | * 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 'ctest_start_function_scope'Brad King2018-01-291-0/+8
|\ | | | | | | | | | | | | | | 13347740 Help: add release notes, documentation for CTEST_RUN_CURRENT_SCRIPT behavior 74092d92 cmCTestScriptHandler: Add new field ShouldRunCurrentScript Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1703
| * cmCTestScriptHandler: Add new field ShouldRunCurrentScriptKyle Edwards2018-01-261-0/+8
| | | | | | | | | | | | | | | | | | | | This is to avoid scope issues with CTEST_RUN_CURRENT_SCRIPT. If ctest_start() is called within a function scope, the value of CTEST_RUN_CURRENT_SCRIPT that it sets doesn't make it to the global scope. With this change, ctest_start() no longer sets CTEST_RUN_CURRENT_SCRIPT, and instead sets a field directly in cmCTestScriptHandler. The old behavior of CTEST_RUN_CURRENT_SCRIPT has also been kept for projects and tests that rely on setting it.
* | CTest: add safe conversion from cmDuration to integer typesWouter Klouwen2018-01-231-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | A problem area by recent refactoring of time to std::chrono has been the unsafe conversion from duration<double> to std::chrono::seconds, which is of an unspecified integer type. This commit adds a template function that for a given type provides a safe conversion, effectively clamping a duration<double> into what fits safely in that type. A specialisation for int and unsigned int are provided. It changes the protential problem areas to use this safe function.
* | CTest: introduce cmDurationWouter Klouwen2018-01-231-18/+14
|/ | | | | | | | 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.
* cmCTest: Refactor stop time calculationsBrad King2018-01-081-37/+34
| | | | | Calculate the stop time up front instead of re-parsing its string for every test.
* cmCTest: Remove unused member LastStopTimeoutBrad King2018-01-081-1/+0
| | | | | | | This member was added by commit v2.8.2~285 (Better detection of stop_time being passed, 2010-03-19), but its logic has no effect. The member is only used for comparison against a value to which it was just assigned.
* Merge topic 'fix-ctest-chrono'Brad King2017-12-121-15/+15
|\ | | | | | | | | | | | | | | | | | | | | | | ba6caafa CTest: Use integer-representable value for "infinite" timeout 548e8f6f CTest: Simplify std::chrono::duration<double> conversion to double de0035fd cmCTestBuildAndTestHandler: Convert timeout to std::chrono::duration 687a26b7 CTest: Fix regression in build-and-test timeout forwarding e770b1b8 CTest: Fix regression in build-and-test timeout compuatation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: dublet <github@dublet.org> Merge-request: !1574
| * CTest: Use integer-representable value for "infinite" timeoutBrad King2017-12-111-10/+9
| | | | | | | | | | | | | | | | Refactoring in commit 66419bc046 (CTest: convert timeouts to std::chrono::duration, 2017-11-20) changed out "infinite" timeout to a value not representable by a 64-bit integer. This causes undefined behavior when e.g. KWSys Process converts the duration to a `long` to interact with system APIs. Use the old `1.0e7` maximum value.
| * CTest: Simplify std::chrono::duration<double> conversion to doubleBrad King2017-12-081-4/+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: Fix regression in build-and-test timeout forwardingBrad King2017-12-081-0/+1
| | | | | | | | | | | | | | | | Refactoring in commit 66419bc046 (CTest: convert timeouts to std::chrono::duration, 2017-11-20) changed out "infinite" timeout to a value not representable by a 64-bit integer. Update the `--build-and-test` forwarding of `--test-timeout` to not forward an "infinite" timeout.
| * CTest: Fix regression in build-and-test timeout compuatationBrad King2017-12-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring in commit 66419bc046 (CTest: convert timeouts to std::chrono::duration, 2017-11-20) accidentally changed the logic used to compute the timeout for a test when it starts. It incorrectly limits the maximum possible timeout to 2 minutes rather than 2 minutes less than the total allowed test time remaining. Update the new logic to restore the original behavior. Avoid subtracting 2 minutes from our "infinite" timeout value to avoid creating very large timeouts that are not "infinite" and may exceed integer type ranges.
* | CTest: Remove unfinished batch test modeBrad King2017-12-081-4/+0
|/ | | | | This was partially implemented by commit v2.8.0~154 (Added some ctest batch capabilities, 2009-09-10) but never finished.
* CTest: convert timeouts to std::chrono::durationWouter Klouwen2017-12-041-25/+51
| | | | | | | | | 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.
* CTest: adopt std::chrono::system_clockWouter Klouwen2017-11-171-2/+2
| | | | | | | | | | | | | | | | | | After the refactor to make CTest use std::chrono::steady_clock for the keeping of time for test duration, there are still references to cmSystemTools::GetTime() left. To further adopt std::chrono for time related activities, this commit changes those remaining references to std::chrono::system_clock::now() calls and alters the storage from either unsigned int or double to std::chrono::system_clock::time_point. For ease of conversion, a converter method is added to cmXMLWriter that converts from a std::chrono::system_clock::time_point to the number of seconds since the UN*X epoch as that is expected behaviour. This means no more casts as required. Functionally should be no difference as the system_clock is implemented in the same terms.
* cmCTest: Remove dead codeBetsy McPhail2017-11-071-7/+3
| | | | The option 'ctest-config' is ignored.
* CTest: fix Time formatting in Notes.xmlZack Galbreath2017-10-311-1/+2
| | | | | | | | | | Notes.xml was reporting its timestamp in E-notation. Here's an example of what this looked like: <Time>1.50938e+09</Time> This format is unsuitable for precisely determining when the Notes file was generated. As a result of this commit, the same field now appears as: <Time>1509383044</Time>
* Improve several occurrences of vector::push_back in loopsMatthias Maennich2017-09-281-0/+2
| | | | | | | 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>
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-8/+7
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Replace empty-string comparisons with checking against `empty()`.Pavel Solodovnikov2017-09-211-3/+3
|
* Merge topic 'string-clear'Brad King2017-09-191-7/+7
|\ | | | | | | | | | | | | 5db3aac1 Meta: replace empty-string assignments with `clear()`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1276
| * Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-9/+9
| |
* | pass arguments as vector to cmCTest::RunCommand()Rolf Eike Beer2017-09-151-11/+5
|/ | | | | | | The only 2 callers took care to construct a properly escaped string, but not using the documented way, and that string was passed only to be immediately split into tokens again. Start with a vector and join it only for logging, avoiding needless quotes during that.
* Meta: modernize old-fashioned loops to range-based `for` (CTest).Pavel Solodovnikov2017-09-141-45/+33
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-21/+16
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Replace C-style castsDaniel Pfeifer2017-08-271-4/+4
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-25/+25
|
* Merge topic 'labels-for-subprojects'Brad King2017-07-131-0/+34
|\ | | | | | | | | | | | | | | | | | | | | 376dc3eb Help: Add notes for topic 'labels_for_subprojects' a70d8e93 Add tests for new directory labels and labels-for-subprojects features 47b3a57c Display subproject timing summary d3859624 Add directory property 'LABELS' and CMAKE_DIRECTORY_LABELS variable d08ec4d2 Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1004
| * Display subproject timing summaryBetsy McPhail2017-07-101-0/+4
| | | | | | | | Use the '--no-subproject-summary' option to disable timing summary.
| * Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variableBetsy McPhail2017-07-101-0/+30
| | | | | | | | | | Use this variable to specify a list of labels that will be reported to CDash as subprojects.
* | cmCTest: Add missing switch case fallthrough markupBrad King2017-07-051-1/+2
|/ | | | | | Without this, GCC 7 warns. Reported-by: Rolf Eike Beer <eike@sf-mail.de>
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-3/+2
|
* Access string npos without instancePavel Solodovnikov2017-06-011-9/+9
|
* cmake: initialize with Role that controls which commands to registerDaniel Pfeifer2017-05-081-1/+1
|
* Add ctest options for limiting which tests fixtures addCraig Scott2017-05-011-0/+28
| | | | | 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-9/+9
| | | | | | | | | | | | | 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'
* cmCTest, cmCTestCoverageHandler: remove cwd danceBen Boeckel2017-03-061-2/+0
| | | | The working directory changes here didn't really accomplish anything.
* clang-tidy: apply misc-redundant-expression fixesDaniel Pfeifer2016-12-121-1/+1
|
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-2/+2
|
* Add Encoding option for RunChild, RunMakeCommand and RunProcessDāvis Mosāns2016-11-141-6/+6
|
* Windows: Encode child process output to internally-used encodingDāvis Mosāns2016-11-141-9/+47
| | | | | | 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`).
* Do not query CDash for versionZack Galbreath2016-11-081-48/+0
| | | | | | | | | | | | | | | | | | This check was not functioning properly for the following reasons: * The "DropSite" and "DropLocation" CTest Configurations do not get set until ctest_submit() is called. So if ctest_submit() was not called before ctest_test() we would end up with uncompressed output, even if the CDash server was new enough to support this feature. * CDash's API is now versioned. The current location to query is now /api/v1/getversion.php, not /api/getversion.php. As a result of these issues, CTest would not compress test/memcheck output when it should. Rather than fix this check, we now assume that CTest is communicating with a new enough version of CDash. This behavior can be controlled through the use of the --no-compress-output command-line argument.
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-22/+23
|
* cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | Include it in dependents which have previously relied on it transitively.
* cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-1/+1
| | | | Port dependent code to the change.