1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-09 15:38:15 +08:00

242 Commits

Author SHA1 Message Date
Jake D'Esposito
304396d13c ctest: Show error on invalid ctest arguments
Fixes: #24227
2024-04-03 21:33:19 -04:00
Brad King
5de1e21659 ctest: Allow passing -j without value to choose a contextual default
Under job server integration, added by commit 80fe56c481 (ctest: Add
support for running under a make job server on POSIX systems,
2023-11-15, v3.29.0-rc1~324^2), use a very high default so that
parallelism is effectively limited only by available job server tokens.

Otherwise, choose a default limit based on the number of processors.

Also allow passing `0` to specify unbounded parallelism.

Fixes: #25739
2024-03-10 11:41:39 -04:00
Kyle Edwards
b15ad7ebb6 cmCTest: Replace cmsysProcess with cmUVProcessChain 2023-08-29 10:51:30 -04:00
Vitaly Stakhovsky
0ee984defa CTest: Use std::string arguments 2023-01-03 07:49:22 -05:00
Kyle Edwards
bea4ed5430 CTest: Add support for outputJUnitFile in presets
Fixes: #22400
2022-10-18 16:52:23 -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
Adriaan de Groot
44ad3f0b7f ctest: Support multiple -L and -LE options to mean "AND"
Fixes: #21087
2021-03-28 12:04:05 +11:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Vitaly Stakhovsky
825b04c67a cmCTest: Members accept std::string parameters 2020-07-27 10:58:39 -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
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