Commit Graph

363 Commits

Author SHA1 Message Date
Zack Galbreath
02f1271bdf ctest: allow test output to override the 'details' field
Parse test output for <CTestDetails>...</CTestDetails>.
If found, use this value to override the default 'Details' string reported
to CDash.
2021-06-09 08:31:32 -04:00
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
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
vvs31415
12624ebd7e Source: Reduce c_str() usage 2021-03-13 07:36:07 -05:00
Ben Boeckel
4f396e6528 clang-tidy: fix performance-no-automatic-move warnings 2021-01-27 08:45:44 -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
Asit Dhal
3c324689a7 include: refactor call sites of cmMakefile::ReadDependentFile
Fixes: #16773
2020-10-21 11:20:37 +02: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
Kyle Edwards
a1612af749 CTest: Log environment variables as a test measurement 2020-05-19 10:26:57 -04:00
Brad King
68a59ab288 Merge topic 'stl-support'
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4689
2020-05-01 08:27:37 -04:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Ben Boeckel
24a9fed5d9 IWYU: mark <cstddef> as needed
Newer IWYU is not seeing them as needed for `size_t`.
2020-04-29 11:16:44 -04: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
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +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
Kyle Edwards
060d2ce269 CTest: Add CTEST_RESOURCE_SPEC_FILE variable 2020-04-02 16:29:50 -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
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
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
Rolf Eike Beer
dc21177461 remove pointless return value from cmCTestTestHandler::CleanTestOutput() 2020-03-23 19:47:47 +01:00
Marc Chevrier
44867a8c01 Modernize memory management
Update internals of various classes.
2020-03-08 16:32:44 +01:00
Kyle Edwards
a5be3916ee CTest: Provide more detailed information on resource allocation error 2020-02-24 15:44:01 -05: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
Craig Scott
da9cbeb3e9 Merge topic 'ctest-resource-allocation-spec-message'
b393b32b4b CTest: Improve error handling when reading resource spec file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4162
2019-12-28 19:03:00 -05:00
Kyle Edwards
b393b32b4b CTest: Improve error handling when reading resource spec file
Fixes: #20079
2019-12-27 10:53:52 -05:00
Brad King
28994115e8 ctest_test: Add option to REPEAT tests 2019-11-07 14:21:18 -05:00
Brad King
42d5d8f425 cmCTestMultiProcessHandler: Hold repeat mode as a member 2019-11-07 14:14:36 -05:00
Craig Scott
c544cb6698 CTest: Rename hardware -> resources for source code 2019-11-05 12:08:35 -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
73a40b19ff CTest: Rename "Processes" lexer to "ResourceGroups"
The corresponding test property `PROCESSES` has been renamed to
`RESOURCE_GROUPS`.
2019-11-05 12:08:35 -05:00
Brad King
af9ed543b0 CTest: Rename PROCESSES test property to RESOURCE_GROUPS
The `PROCESSES` test property name added for CMake 3.16 is too close to
the existing `PROCESSORS` test property.  Furthermore, the property in
principle specifies groups of resources organized in a way that is
meaningful to a particular test.  The groups may often correspond to
processes but they could have other meanings.  Since the property name
`PROCESSES` has not been in a final 3.16 release yet, simply rename it
to `RESOURCE_GROUPS`.

Fixes: #19914
2019-11-05 12:08:01 -05:00
Kyle Edwards
e34de0691b CTest: Allocate hardware to tests 2019-10-02 09:33:54 -04:00
Kyle Edwards
bb4a141059 CTest: Add lexer for PROCESSES property 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
Brad King
1a1508c8b8 Merge topic 'modernize-use-auto'
d25a5a7ec9 clang-tidy: modernize-use-auto

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3783
2019-09-12 09:15:38 -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
Regina Pfeifer
cd7d736278 cmCTestTestHandler: Port away from cmCommand 2019-09-09 16:32:05 +02:00
Regina Pfeifer
a1ddf2d0ba clang-tidy: Replace typedef with using
Automate the conversion with

  perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g'

then manually fix a few places.
2019-09-04 18:03:01 +02:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Brad King
de0a2354fc IWYU: Add missing cstddef includes for size_t and nullptr_t
The IWYU tool we use for CI now diagnoses these.
2019-09-03 11:46:52 -04:00
Brad King
1aa0a18c41 cmCTestTestHandler: Re-order includes to follow our convention 2019-09-03 11:46:52 -04:00
Brad King
89479bde94 Merge topic 'pvs-cleanup'
7fe3e874d5 cmCPackLog: Fix support for multiple log message tags
74f2c0ea56 cmCTestTestHandler: Remove extra layer of parentheses
7c2767ef3b cmCTestMultiProcessHandler: Explain testRun ownership in comments
303e813438 CTest: Simplify some boolean conditions
51565abe79 cmMessageCommand: Remove extra layer of parentheses
b1cfaf7b91 cmVSSetupHelper: Remove unused SmartBSTR copy operations
3f4c4e7afe cmVSSetupHelper: Fix SmartBSTR copy operations
a8ca5aea94 cmMakefileTargetGenerator: Check for null before using a pointer
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Acked-by: Artalus <artalus-mail@yandex.ru>
Merge-request: !3715
2019-08-26 10:51:11 -04:00
Brad King
74f2c0ea56 cmCTestTestHandler: Remove extra layer of parentheses
A condition in `ComputeTestListForRerunFailed` contained an extra layer
of parentheses.  Remove them.  The condition itself is correct because
an empty list means "all tests" so we want to include the current test.

Issue: #19610
2019-08-26 09:43:46 -04:00
Brad King
303e813438 CTest: Simplify some boolean conditions
Directly compare two boolean values instead of spelling out accepted
combinations.

Issue: #19610
2019-08-26 09:43:46 -04:00