232 Commits

Author SHA1 Message Date
Johnny Jazeix
e89aeba5c4 ctest: add option --stop-on-failure
To stop the tests once one has failed

Fixes: #16628
2020-04-20 23:05:15 +02:00
Rolf Eike Beer
ec7928ef26 use _s to construct static string_views at several places
This should avoid the runtime strlen() call.
2020-03-24 19:40:44 +01:00
Rolf Eike Beer
7df84ffe58 allow cmCTest::CleanString() to skip input characters
This entirely avoids that one needs to call std::string::substr() for the
input.
2020-03-23 20:19:26 +01:00
Stefan Dinkelacker
a39d4139d0 Add --no-tests=<[error|ignore]> option to CTest
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>
2020-01-31 18:17:13 +01:00
Brad King
ed65b3e984 CTest: Rename internal APIs for --repeat options
Replace use of the term "rerun" with "repeat" to match the public names.
2019-11-07 14:14:28 -05:00
Brad King
39ac8b4eb5 ctest: Add --repeat-after-timeout option
Add an option to re-run tests if they timeout.  This will help tolerate
sporadic timeouts on busy machines.
2019-10-29 15:14:36 -04:00
Brad King
80c2c9d14c ctest: Add --repeat-until-pass option
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>
2019-10-29 15:10:12 -04:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
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.
2019-10-01 12:26:36 -04:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Zack Galbreath
2a71a0390c ctest: rename TRACK to GROUP
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.
2019-08-22 13:10:18 -04:00
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints.  Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
2019-07-10 11:48:56 -04:00
Regina Pfeifer
5a72dbd40c cmCTest: Remove dead code 2019-03-20 11:41:29 -04:00
Regina Pfeifer
a5eeb0310d cmCTest: Cleanup typedefs 2019-03-20 11:41:29 -04:00
Regina Pfeifer
71a3391b5f cmCTest: Use default member initialization 2019-03-20 11:41:29 -04:00
Regina Pfeifer
b172a81d55 cmCTest: Use concrete accessor functions for TestingHandlers 2019-03-20 11:39:14 -04:00
Regina Pfeifer
da5ee509b2 cmCTest: Move all data members to private implementation struct 2019-03-18 22:55:50 +01:00
Regina Pfeifer
670d27da64 cmCTest: Remove friend declarations 2019-03-18 22:25:50 +01:00
Regina Pfeifer
9406844616 cmCTest: De-inline all member functions 2019-03-18 22:25:50 +01:00
Vitaly Stakhovsky
4e315e9449 cmSystemTools: More functions accept std::string params 2019-02-20 14:53:39 -05:00
Albert Astals Cid
ae5e97a005 Delete some default constructors and assignment operators
They are unused, but if someone used them they would lead to
problems since they would copy the internal raw pointers
and the destructor would cause double delete
2019-02-15 07:25:47 -05:00
Regina Pfeifer
094f01d0f0 cleanup: Prefer compiler provided special member functions 2019-01-25 06:45:00 -05:00
Regina Pfeifer
55671b41d2 clang-tidy: Use = default
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
2019-01-25 06:44:32 -05:00
Regina Pfeifer
65f1fc9d63 CTest: Add function GetSubmitURL 2019-01-16 10:34:08 -05:00
Justin Goshi
fc41a95f08 CTest: Add --show-only[=format] option to print test info
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.
2019-01-10 07:37:32 -05:00
Regina Pfeifer
b2aa3aedea clang-tidy: Use default member initialization 2018-12-15 10:52:37 +01:00
Regina Pfeifer
9501a6145d CTest: Remove special case for Dart version <= 1 2018-11-29 00:29:13 +01:00
Regina Pfeifer
a2648dda97 Mark operator bool explicit 2018-11-19 23:35:09 +01:00
Sylvain Joubert
ffdec37a19 CTest: Add colored output on tests summary where supported
- Number of passed/failed tests is colored according to the whole outcome
- Individual listed tested are colored according to their completion status:
  * Disabled: blue
  * Failed: red
  * Not Run: yellow
2018-11-09 18:57:41 +01:00
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
Michael Wegner
b3d5b8b3fb ctest: Add option for live progress summary in terminal 2018-09-26 11:47:49 -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
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
luz.paz
32f6b7a43b Fix misc typos in documentation and comments 2018-03-07 10:54:46 -05:00
Brad King
18153217e2 Merge topic 'ctest_start_function_scope'
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
2018-01-29 08:04:59 -05:00
Kyle Edwards
74092d92bf cmCTestScriptHandler: Add new field ShouldRunCurrentScript
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.
2018-01-26 09:27:22 -05:00
Wouter Klouwen
695951bc46 CTest: introduce cmDuration
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.
2018-01-23 10:04:38 -05:00
Brad King
2567e5df69 cmCTest: Refactor stop time calculations
Calculate the stop time up front instead of re-parsing its string for
every test.
2018-01-08 12:55:00 -05:00
Brad King
1138feb38f cmCTest: Remove unused member LastStopTimeout
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.
2018-01-08 12:55:00 -05:00
Brad King
1f5b2a8de9 Merge topic 'fix-ctest-chrono'
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
2017-12-12 08:02:33 -05:00
Brad King
ba6caafa42 CTest: Use integer-representable value for "infinite" timeout
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.
2017-12-11 10:41:48 -05:00
Brad King
f984296ba8 CTest: Remove unfinished batch test mode
This was partially implemented by commit v2.8.0~154 (Added some ctest
batch capabilities, 2009-09-10) but never finished.
2017-12-08 11:23:33 -05:00
Wouter Klouwen
66419bc046 CTest: convert timeouts to std::chrono::duration
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.
2017-12-04 10:43:14 -05:00
Betsy McPhail
e80dc2ad7f cmCTest: Remove dead code
The option 'ctest-config' is ignored.
2017-11-07 14:15:20 -05:00
Rolf Eike Beer
69fac3c3d5 pass arguments as vector to cmCTest::RunCommand()
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.
2017-09-15 17:50:56 +02:00
Daniel Pfeifer
ca2233e31f IWYU: Mark cmConfigure.h with pragma: keep
Also remove `#include "cmConfigure.h"` from most source files.
2017-08-26 07:41:04 +02:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Betsy McPhail
47b3a57c9b Display subproject timing summary
Use the '--no-subproject-summary' option to disable timing summary.
2017-07-10 16:25:18 -04:00
Betsy McPhail
d08ec4d25a Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable
Use this variable to specify a list of labels that will be reported to
CDash as subprojects.
2017-07-10 16:25:18 -04:00