Zack Galbreath
cbcb92d1cb
ctest: add support for attaching files to tests at run time
...
Allow tests to specify files to upload at runtime. Previously this was
only possible to specify at configure time with the ATTACHED_FILES
test properties.
This commit also fixes a bug in how our test data tarballs were generated
by CTest. Previously, if you tried to attach a file outside of the binary
directory, CTest would generate a tar file with a relative path, and tar
would not allow you to extract it. We resolve this problem by creating
tar files with a flat directory structure instead.
Fixes : #22284
2021-06-08 09:27:19 -04:00
Martin Willers
df0e50d756
CTest: Add env var CLICOLOR to disable color output
...
Based on the implementation in Terminal.c:kwsysTerminalStreamIsVT100.
2021-05-06 11:40:40 -04:00
Zack Galbreath
25bf514447
ctest: Add support for writing test results in JUnit XML format
...
Addresses #18654
2021-04-26 08:55:22 -04:00
Brad King
ec1b6157cb
Update CMake code using KWSys to account for Status return values
...
KWSys as of 2021-04-14 changed the return type of `SystemTools`
operations from `bool` to `Status`. Update our call sites.
This may improve error reporting accuracy in a few places.
2021-04-14 13:14:09 -04:00
Adriaan de Groot
44ad3f0b7f
ctest: Support multiple -L and -LE options to mean "AND"
...
Fixes : #21087
2021-03-28 12:04:05 +11:00
Kyle Edwards
8bc5c8961e
CMakePresets.json: Add the ability to conditionally disable presets
2021-03-22 15:04:54 -04:00
vvs31415
12624ebd7e
Source: Reduce c_str() usage
2021-03-13 07:36:07 -05:00
Brad King
6fa3647023
ctest: Add support for '--prefix=<prefix>' form of the argument
...
The main `cmake --preset` argument for configure presets supports both
forms, so support it for `ctest --preset` too.
Fixes : #21855
2021-02-23 09:22:00 -05:00
Sam Freed
7fd6bb6895
presets: Remove unintended rerunFailed option from test presets
...
This was accidentally included after discussion in #21391 had decided to
leave it out. It was never included in a release.
Issue: #21391
2021-02-15 10:52:32 -05:00
Sam Freed
676ecf0d37
cmake-presets: Add build and test presets
...
Fixes : #21391
2021-02-01 11:59:40 -05:00
Brad King
18b1ccfa51
Merge topic 'ctest-progress-output-fixes'
...
39cdc8afb9 ctest: Make verbose mode override progress behavior
1bcd9b06b9 ctest: Don't treat skipped test as failed tests in progess report
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !5663
2021-01-07 08:14:48 -05:00
Oleksandr Koval
209daa20b2
Code style: add missed explicit 'this->'
...
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Sylvain Joubert
39cdc8afb9
ctest: Make verbose mode override progress behavior
...
Start and results should now be back in verbose mode even with progress
mode enabled.
2021-01-05 10:32:33 +01:00
Asit Dhal
dbcf86d24d
Ctest: Support build tree on command line
...
Fixes : #21268
2020-12-17 05:01:03 +01:00
Asit Dhal
5a6c199069
ctest: Provide hints about inspecting test failures
...
Fixes : #20955
2020-12-01 01:53:03 +01:00
Vitaly Stakhovsky
11425041f0
cmMakefile::GetDefinition: return cmProp
2020-09-02 07:27:32 -04:00
Kevin Puetz
6a6f1d1edd
CTest: exit nonzero after message(SEND_ERROR|FATAL_ERROR)
...
Fixes : #21004
2020-08-26 11:27:05 -04:00
Vitaly Stakhovsky
825b04c67a
cmCTest: Members accept std::string parameters
2020-07-27 10:58:39 -04:00
Brad King
09ff1cb650
cmCTest: Explicitly specify '.tmp' extension on in-progress log files
...
Do not depend on `cmGeneratedFileStream` to have this default.
2020-07-08 15:49:56 -04:00
Vitaly Stakhovsky
b36d1bdd9d
Single location for cmProp typedef
2020-06-01 08:54:20 -04:00
Marc Chevrier
2faa3f6c55
Refactoring: Third-parties public headers are under cm3p prefix
...
Fixes : #20666
2020-05-07 12:06:08 +02:00
Marc Chevrier
8d4a9ee398
Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>
2020-04-30 09:53:27 +02:00
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
Ben Boeckel
f2a33107be
clang-tidy: address bugprone-branch-clone lints
...
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.
See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Brad King
a6611577c3
Merge topic 'cmprop-getglobalprop'
...
c84cf42897 cmState::GetGlobalProperty: return cmProp
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !4521
2020-03-27 07:50:28 -04:00
Vitaly Stakhovsky
c84cf42897
cmState::GetGlobalProperty: return cmProp
2020-03-25 09:10:46 -04: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
8ca2504a4d
use string_views to avoid memory allocations
2020-03-24 17:50:37 +01:00
Rolf Eike Beer
ef778d77e0
replace std::string::substr() with operations that do not allocate memory
...
Modify the original string instead of creating a new copy with substr() when it
is not used for anything else afterwards.
2020-03-23 22:41:44 +01:00
Rolf Eike Beer
48adc29721
replace "std::string::find(x) == 0" with cmHasPrefix()
2020-03-23 22:41:43 +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
Rolf Eike Beer
d6a4e9fbc8
CTest: avoid repeated string compares
...
Only one key can match per iteration, avoid any further compares when one match
was already found. While at it entirely avoid that the key and value strings are
copied.
2020-03-23 20:18:02 +01:00
Marc Chevrier
557cecdc3d
Modernize memory management
...
Update internals of various classes
2020-02-27 11:11:30 +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
Marc Chevrier
f7d12609f0
Refactoring: use append functions from cmext/algorithm
2019-12-17 10:44:02 +01:00
Brad King
32c165d263
CTest: Consolidate '--repeat-* n' options as --repeat *:n
...
Combine `--repeat-until-fail`, `--repeat-until-pass`, and
`--repeat-after-timeout` to create a single `--repeat <mode>:<n>`
option. Retain `--repeat-until-fail` too because that has been
available in previous releases.
2019-11-15 10:08:33 -05: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
016601e5e6
Merge branch 'backport-ctest-resource-groups'
2019-11-05 12:59:16 -05:00
Craig Scott
a7c1e15cc4
CTest: Rename hardware -> resources for CMake variables, command options
...
Only changes the user-visible effects of renaming hardware
allocation to resource allocation. Code changes are the minimum
needed to achieve that.
2019-11-05 12:08:35 -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
Kyle Edwards
e34de0691b
CTest: Allocate hardware to tests
2019-10-02 09:33:54 -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
Marc Chevrier
c688b401d3
cmstd: Modernize CMake system headers
...
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes : #19491
2019-09-20 10:01:37 -04:00
Regina Pfeifer
f30523d090
clang-tidy: modernize-deprecated-headers
2019-09-16 10:11:13 -04:00
Regina Pfeifer
d25a5a7ec9
clang-tidy: modernize-use-auto
...
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators. Leave new expressions and cast
expressions for later.
2019-09-10 22:21:41 +02:00
Brad King
d16402ddc4
Merge topic 'ctest-CLICOLOR_FORCE'
...
074a6a8cf6 CTest: Add env var CLICOLOR_FORCE to force color output
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !3733
2019-08-27 10:54:24 -04:00
Marin Baron
074a6a8cf6
CTest: Add env var CLICOLOR_FORCE to force color output
...
Base impl on `Source/kwsys/Terminal.c:kwsysTerminalStreamIsVT100`.
This enables pipes/logs with colors.
2019-08-26 11:04:57 -04:00
Brad King
37c671570c
Merge topic 'source_sweep_ostringstream_single'
...
3b2b02825d Source sweep: Replace std::ostringstream when used with a single append
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !3726
2019-08-26 10:49:10 -04:00
Brad King
8685d0d291
Merge topic 'source_sweep_cmExpandedList'
...
aaf59120bf Source sweep: Replace cmExpandList with the shorter cmExpandedList
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !3725
2019-08-26 10:47:24 -04:00