Commit Graph

1395 Commits

Author SHA1 Message Date
Betsy McPhail
a6e0158712 ctest_submit: Add support for a "Done" part
Teach CTest to submit Done.xml. Submission of this file indicates to
CDash that a build is complete and no more files will be uploaded. It
contains the build id returned by CDash and the current time.

This file is submitted last for a given build when using the
`ctest_submit()` command.

If submitting by PARTS, use `ctest_submit(PARTS Done)`.
2018-10-10 06:55:59 -04:00
Betsy McPhail
f460bbd4c8 ctest_submit: Refactor file list to use a vector instead of a set
Remove duplicates in a way that preserves order.
2018-10-10 06:55:05 -04:00
luz.paz
6b4c5a0365 Fix misc. typos
Found via `codespell -q 3 -I ../cmake-whitelist.txt --skip="./Utilities"`
where the whitelist consists of

```
aci
ans
behaviour
buil
convertor
dum
earch
ect
emmited
emmitted
helpfull
iff
isnt
ith
lowercased
mose
nd
nknown
nto
objext
ot
pathes
pevents
splitted
substract
superceded
supercedes
te
tim
todays
uint
upto
whitespaces
```
2018-10-03 15:32:46 -04:00
Brad King
0b1b842e93 Merge topic 'ctest-num-width'
6d28884617 cmCTestRunTest: Avoid float/int conversions in number width logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2433
2018-10-03 11:38:46 -04:00
Brad King
6d28884617 cmCTestRunTest: Avoid float/int conversions in number width logic
Use of `std::log10` added by commit 02c5091c90 (cmCTestRunTest: Simplify
number width computation, 2018-09-08) broke our number width computation
on some platforms where

    static_cast<int>(std::log10(static_cast<size_t>(10)))

somehow produces `0` instead of `1`.  Re-implement the logic to avoid
floating-point computations.
2018-10-02 15:40:29 -04:00
Brad King
17653671e4 Merge topic 'no_buildid_for_files'
c49d13f94b ctest: only create buildid when submitting from Testing/ dir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2423
2018-10-01 09:24:29 -04:00
Brad King
3bb8dda047 Merge topic 'add_progress_summary_console_logging_mode'
b3d5b8b3fb ctest: Add option for live progress summary in terminal
62fbe5002a cmCTestRunTest: Thread number of completed tests through start APIs
02c5091c90 cmCTestRunTest: Simplify number width computation
6a285bb737 cmCTestRunTest: Buffer test result output before printing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2240
2018-10-01 09:20:44 -04:00
Zack Galbreath
c49d13f94b ctest: only create buildid when submitting from Testing/ dir
In 7f530cc we taught CTest to pass extra information to CDash at submit
time.  This extra info is used by CDash to initialize a buildid.

`ctest_submit(FILES)` can be used to send specific files to CDash.
These files are not necessarily associated with the build currently
being performed. For this reason, we modify the behavior of ctest_submit()
to only specify this extra info when we are submitting files from the
current build's Testing directory.
2018-09-28 10:49:45 -04:00
Michael Wegner
b3d5b8b3fb ctest: Add option for live progress summary in terminal 2018-09-26 11:47:49 -04:00
Brad King
6597428c36 ctest: Fix generator platform under --build-nocmake
When constructing a global generator instance in `--build-and-test` mode
we need to set the platform passed by `--build-generator-platform`
directly on the generator.  The old code that set it on the `cmake`
class instance did nothing because that only affects cache
initialization, which is not done by `--build-nocmake`.
2018-09-25 13:27:11 -04:00
Michael Wegner
62fbe5002a cmCTestRunTest: Thread number of completed tests through start APIs 2018-09-25 08:20:57 -04:00
Michael Wegner
02c5091c90 cmCTestRunTest: Simplify number width computation
Use a real logarithm implementation.
2018-09-25 08:20:57 -04:00
Michael Wegner
6a285bb737 cmCTestRunTest: Buffer test result output before printing 2018-09-25 08:20:57 -04:00
Brad King
c0cedaa643 Merge topic 'ctest-more_submit_params'
7f530cc54e ctest_submit: pass additional info to CDash

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2380
2018-09-19 10:36:11 -04:00
Brad King
a8f628c0a4 Merge topic 'getsafedef-stdstring'
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2350
2018-09-18 11:18:00 -04:00
Vitaly Stakhovsky
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& 2018-09-18 11:16:46 -04:00
Zack Galbreath
7f530cc54e ctest_submit: pass additional info to CDash
Specify buildname, site, and buildstamp to CDash upon submission.
CDash will use this extra info to assign and report back a buildid.
2018-09-17 10:38:33 -04:00
Brad King
ed71ec7579 CTest: Improve stop-time implementation
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.
2018-09-12 10:59:55 -04:00
Brad King
c669b59095 Merge topic 'ctest-fix-test-load'
292ec157b6 CTest: Fix --test-load regression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2362
2018-09-11 08:12:09 -04:00
Brad King
292ec157b6 CTest: Fix --test-load regression
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
2018-09-10 07:32:16 -04:00
Vitaly Stakhovsky
6f16be6a62 Remove unnecessary c_str() calls
Use the new IsOn(),IsOff() overloads.
2018-09-05 15:12:57 -04:00
Brad King
e48a278cdc Merge topic 'no-sanitizer-logfile'
5aaaee5e9e ctest_memcheck: Change failure to find log file from error to warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2323
2018-08-31 14:44:32 -04:00
Tim
fde61d3ad3 CTest: Add error exception for sphinx-build WARNING messages
Sphinx-build warnings look like this:

    ../path/to/file.rst:105: WARNING: This is not an error.

CTest detects these as errors by this regex:

    ([^ :]+):([0-9]+): ([^ \\t])

Add an exception as we already have for lower-case `: warning`.
2018-08-30 10:02:38 -04:00
Betsy McPhail
5aaaee5e9e ctest_memcheck: Change failure to find log file from error to warning
Sanitizers do not create a log file when no defects are found. Therefore,
it is currently impossible for ctest_memcheck to set both
`CAPTURE_CMAKE_ERROR` and `RETURN_VALUE` to zero.


With defects, `CAPTURE_CMAKE_ERROR`=0 and `RETURN_VALUE`=-1, as expected.

With no defects, `CAPTURE_CMAKE_ERROR`=-1 and `RETURN_VALUE`=0.
2018-08-28 16:45:49 -04:00
Clinton Stimpson
5029d58c38 ctest: allow cdash submissions using alternate authentication methods 2018-08-17 09:18:07 -06:00
Brad King
75844dd609 Merge topic 'cleanup-find-cstr'
69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2271
2018-08-09 08:00:03 -04:00
Vitaly Stakhovsky
69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls 2018-08-07 15:28:24 -04:00
Sebastian Holtermann
b6802cd506 cmGeneratedFileStream: clang-tidy applied to remove redundant `c_str` calls
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
2018-08-07 17:02:39 +02:00
Brad King
08813b17a1 Merge topic 'ctest_submit-https'
71f27c04b0 ctest_submit: show headers as debug info
4464ef21da ctest_submit: Check CA file during CDASH_UPLOAD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2171
2018-06-29 08:56:25 -04:00
Zack Galbreath
71f27c04b0 ctest_submit: show headers as debug info
Hide any headers specified by `ctest_submit(HTTPHEADER ...)` unless ctest
is run with --debug.  This option is used to present bearer tokens to CDash.
We do not want to inadvertently expose this secret data in the console
output log.
2018-06-27 15:08:14 -04:00
Zack Galbreath
4464ef21da ctest_submit: Check CA file during CDASH_UPLOAD
This fixes a bug where ctest(SUBMIT CDASH_UPLOAD ...) would fail when
attemping to submit to a site bearing a genuine SSL certificate.
This code path was missing a call to cmCurlSetCAInfo() which loads
the certificate authority file.
2018-06-27 15:08:14 -04:00
Brad King
b41b30f16e Update use of KWSys SystemTools::SplitString for new signature 2018-06-22 13:38:18 -04:00
luz.paz
be28106880 Fix misc. typos
Found via `codespell` and `grep`
2018-06-04 10:32:49 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
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.
2018-06-01 09:53:42 -04:00
Brad King
f248f8ad78 Merge topic 'parallel_build_option'
1ab3881ec9 cmake: Add options for parallel builds to --build mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !1962
2018-05-29 10:05:09 -04:00
Florian Maushart
1ab3881ec9 cmake: Add options for parallel builds to --build mode
While we already support `cmake --build . -- -j`, the options after `--`
are specific to the native build tool.  Add new options `--parallel
[<N>]` and `-j [<N>]` to abstract this and map to the proper option
for the native build tool.
2018-05-25 09:42:20 -04:00
Brad King
18c71919ac Merge topic 'xml-element-enhance'
ff13b0cdc2 cmCTestLaunch: use cmXMLElement for XML generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2057
2018-05-14 09:34:19 -04:00
Vitaly Stakhovsky
ff13b0cdc2 cmCTestLaunch: use cmXMLElement for XML generation
class `cmXMLElement` enhanced with more members; its use demonstrated
2018-05-11 11:33:13 -04:00
Kyle Edwards
563781099f ctest_start: read model from TAG file
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.
2018-05-09 08:22:55 -04:00
jrp2014
418541035f cmCTestCurl: Fix UploadFile declared parameter names
Match the order used in the definition.
2018-04-05 13:42:49 -04:00
Brad King
cdc6dd888e Merge topic 'gcov-warning-message'
ae1cbff07f CTest: The "Could not find gcov." message should not be a warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1894
2018-03-29 10:16:27 -04:00
Betsy McPhail
ae1cbff07f CTest: The "Could not find gcov." message should not be a warning
It now matches the log level of other coverage messages.
2018-03-28 08:32:46 -04:00
Brad King
9dd7776cd9 Merge topic 'ctest_update-memory-problems'
27f033550a ctest_update: Fix crash when handling svn externals
75e8af3354 cmSystemTools: Fix ParseArguments out-of-bounds read

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1893
2018-03-28 07:23:47 -04:00
Brad King
27f033550a ctest_update: Fix crash when handling svn externals
Refactoring in commit v3.9.0-rc1~156^2 (c++: prefer vectors over lists,
2017-05-04) switched `cmCTestSVN::Repositories` from `std::list` to
`std::vector`.  This can cause re-allocation when svn externals are
processed and break the `RootInfo` pointer that is supposed to point at
the first repository element.  Switch back to `std::list` so that the
address remains stable.

Fixes: #17854
2018-03-27 08:46:20 -04:00
Brad King
e11410bb0c Merge topic 'cmWorkingDirectory_success_checking'
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
2018-03-09 07:43:54 -05:00
Brad King
50b2d0c944 Merge topic 'misc-typos'
32f6b7a43b Fix misc typos in documentation and comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1826
2018-03-08 09:58:19 -05:00
Craig Scott
e60e4dfc88 cmWorkingDirectory: Check success of current dir changes 2018-03-08 20:07:14 +11:00
luz.paz
32f6b7a43b Fix misc typos in documentation and comments 2018-03-07 10:54:46 -05:00
Brad King
6be53c6695 CTest: Add options to control test process affinity to CPUs
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.
2018-03-05 09:21:32 -05:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* 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.
2018-01-31 18:23:03 +03:00