Commit Graph

1771 Commits

Author SHA1 Message Date
Kyle Edwards
0e8584c89c CTest: Fix regression in calculating test timeout
Fixes: #25120
2023-07-24 19:29:54 -04:00
Brad King
54c5654f7d ctest: Optionally terminate tests with a custom signal on timeout
CTest normally terminates test processes on timeout using `SIGKILL`.
Offer tests a chance to exit gracefully, on platforms supporting POSIX
signals, by setting `TIMEOUT_SIGNAL_{NAME,GRACE_PERIOD}` properties.

Fixes: #17288
2023-06-02 06:51:13 -04:00
Brad King
e38c05688e CTest/cmProcess: Adopt field tracking reason for the process timeout
A test process may timeout either because the test timeout was reached,
or the overall stop time was reached.  Shorten the lifetime for which
we track this state in `cmCTestRunTest`.
2023-05-31 09:43:03 -04:00
Brad King
25c1468314 cmCTestTestHandler: Remove outdated comment
Remove a comment that has not been relevant since commit 177edc5ed1
(Fixed ctest -N segfault issue.  Further refactored ctest.  Enabled
failover for ctest, 2009-08-27, v2.8.0~250).
2023-05-31 09:43:03 -04:00
Ben Boeckel
8451a3f0b5 cmGlobalGenerator: use a stream for output in Build
This allows output to show up in output immediately instead of being
batched.
2023-05-27 07:04:17 -04:00
Brad King
0a5aeaf302 cmCTestRunTest: Consolidate test timeout selection logic
Test timeout selection was previously spread out over several locations.
Consolidate it in a single place to make it easier to follow.
2023-05-04 17:11:19 -04:00
Brad King
426e38cc10 cmCTestRunTest: Adopt decision for starting cmProcess timer 2023-05-04 17:09:00 -04:00
Brad King
59336b29bd cmCTestRunTest: Remove unnecessary arguments to ForkProcess 2023-05-04 16:58:43 -04:00
Brad King
3edf7fbb41 ctest: Fix TIMEOUT test property with value 0 with --timeout flag
An explicit zero TIMEOUT test property value should not be overridden by
the `--timeout` flag.
2023-05-04 16:58:03 -04:00
Brad King
cd4038fe94 cmCTestTestHandler: Use in-class initialization of properties and results 2023-05-04 10:27:58 -04:00
Marc Chevrier
241304190f CMake code rely on cmList class for CMake lists management (part. 2) 2023-04-29 09:54:31 +02:00
Marc Chevrier
e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Martin Duffy
19305afd8a presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
scivision
7b0a629693 Source: use C++11 nullptr 2023-02-14 14:34:03 -05:00
Kyle Edwards
c6134ca6c7 CTest: Remove usages of CMAKE_INTDIR
The configuration in which CMake/CTest itself is built should not
influence runtime path selection.
2023-02-07 11:10:47 -05:00
Frank Winklmeier
6ef54e0272 CTest: add test failure reason to JUnit XML output
In case of test failure, add the test failure reason (e.g. "Timeout") to
the failure message in the XML file. This is the same value that is
shown in the ctest text output.

Fixes: #24184
2023-02-02 16:57:12 +01:00
Brad King
1cd38de47f ctest: Drop unnecessary use of deprecated CURLOPT_PUT
All usage sites are already preceded by use of its replacement,
CURLOPT_UPLOAD.
2023-01-27 15:43:29 -05:00
Brad King
a429e4b9b1 CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32
Prior to CMake 2.8.4 (released in 2011), we defined `WIN32` on CYGWIN.
That was removed, but an undocumented `CMAKE_LEGACY_CYGWIN_WIN32`
compatibility mode was left to help projects transition.  Only projects
that do not require at least 2.8.4 as their minimum CMake version need
the compatibility mode.  We've also long warned about projects that do
not require at least 2.8.12, so it is now reasonable to remove the
legacy compatibility mode.
2023-01-19 14:29:35 -05:00
Kitware Robot
33abef7416 Revise C++ coding style using clang-format-15
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 15.

* 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.

Fixes: #24315
2023-01-18 16:20:47 -05:00
Vitaly Stakhovsky
b3edfcf46e cmValue: Use operator* explicitly to convert to std::string; avoid extra call 2023-01-15 23:39:02 -05:00
Brad King
f31bb28c78 Merge topic 'ctest-error-newlines'
5e7a4ad1a1 ctest: Add missing newlines on several error messages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8047
2023-01-12 09:25:18 -05:00
Christian Häggström
5e7a4ad1a1 ctest: Add missing newlines on several error messages
Without this:

   user@host:~$ ctest --build-and-test foo
   --build-and-test must have source and binary dir
   Problem parsing command line arguments within a handleruser@host:~$
2023-01-11 15:52:37 -05:00
Vitaly Stakhovsky
0ee984defa CTest: Use std::string arguments 2023-01-03 07:49:22 -05:00
Rose
6d15754814 Make vector operations more efficient 2022-12-10 12:48:09 -05:00
Michael Hirsch
8a16a727f8 ctest_config: pass -S, -B args for log clarity
Fixes: #24135
2022-11-04 15:32:15 -04:00
Tobias Ribizel
59fcbba65e ctest_memcheck: ignore false-positives in CUDA's compute-sanitizer
Add a list of false-positive messages from CUDA's compute-sanitizer to
the CTest memcheck.

Fixes: #24001
2022-10-07 11:36:12 -04:00
Brad King
120945587f Merge topic 'ctest_ninja_full_output'
65260d6c1e ctest: only report make-level errors when no others are found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7710
2022-09-27 10:20:30 -04:00
Zack Galbreath
65260d6c1e ctest: only report make-level errors when no others are found
In commit ab9ad2a6a0 (ctest: report make-level errors to CDash when
using launchers, 2020-09-24, v3.19.0-rc1~84^2~1) we taught CTest to
capture and report errors from the build command when using launchers.

This had the unintended side effect of reporting a separate build error containing
the full build output when the build command returns non-zero. To fix this problem,
we now only report build command errors from CTest launchers when no other
more specific build errors are found.

Fixes: #23991
2022-09-26 09:40:58 -04:00
Brad King
29c0633793 Merge topic 'truncation_invalid'
bd30d20bc3 Tests: Add cases covering bad ctest output truncation types
dbf840392d ctest: print error for invalid CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7596
2022-09-09 09:52:06 -04:00
Frank Winklmeier
dbf840392d ctest: print error for invalid CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION
Print an error message for invalid values of
`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` in a ctest dashboard script.
The option was added by commit 140704d443 (ctest: add option for
output truncation, 2022-03-07, v3.24.0-rc1~513^2).

Fixes: #23869
2022-09-07 11:52:03 -04:00
Alex Reinking
e2854b4fa2 cmCTestRunTest: Implement the ENVIRONMENT test property with EnvDiff too
Going through the same internal API for both `ENVIRONMENT` and
`ENVIRONMENT_MODIFICATION` properties will make it easier to implement
checkpointing for `MYVAR=reset:` more efficiently if the need ever
presents itself.  It also makes the two-stage nature of the environment
mutation clearer in the code itself.
2022-08-15 14:19:16 -04:00
Alex Reinking
bfa1c5285b cmSystemTools: Add EnvDiff class to hold ENVIRONMENT_MODIFICATION logic
Prepare to re-use this logic when enhancing `cmake -E env`.
2022-08-15 14:11:47 -04:00
Alex Reinking
a0b1c4ee90 cmCTestRunTest: Simplify by using GetSystemPathlistSeparator
Part of the implementation of `ENVIRONMENT_MODIFICATION` replicated the
logic in this function. Using it here de-duplicates code and will be
useful during the upcoming refactoring.
2022-08-15 14:11:20 -04:00
Alex Reinking
4e6cbb1f13 cmCTestRunTest: Remove unnecessary CMAKE_BOOTSTRAP guard
CTest is not compiled during CMake's `bootstrap` build.
2022-08-15 14:10:34 -04:00
Brad King
98cf623821 cmCTestHandlerCommand: Capture list of parsed keywords via binding 2022-07-25 13:52:11 -04:00
Brad King
f95a5832c7 cmArgumentParser: Drop unused keywordsMissingValue argument to Parse()
All clients have been converted to encoding this requirement in their
bindings.
2022-07-25 13:51:43 -04:00
Brad King
e6d1e29ffa cmArgumentParser: Model maybe-empty and non-empty lists with wrapper types
Previously bindings to `std::vector<std::string>` required at least one
value.  Some clients have been filtering `keywordsMissingValue` to
support keywords followed by empty lists.  Instead, require clients to
specify whether a keyword's list can be empty as part of the binding
type.
2022-07-07 09:48:58 -04:00
Brad King
2586afa31b cmCTest*Command:: Use cm::optional for keyword argument presence 2022-07-05 16:55:40 -04:00
Brad King
1ee5a4a548 cmArgumentParser: Avoid allocating copies of keyword strings 2022-07-05 16:34:57 -04:00
FeRD (Frank Dana)
98a10290a8 cmSystemTools: Fix 'ErrorOccurred' spelling
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.

Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
2022-06-13 09:05:24 -04:00
Ben Boeckel
b89c085237 clang-tidy: fix readability-static-definition-in-anonymous-namespace lints 2022-05-24 09:09:44 -04:00
Ben Boeckel
6ff03d463f clang-tidy: address google-readability-casting lints
At least those involving `static_cast`.
2022-05-24 09:09:43 -04:00
Ben Boeckel
9409e5c04f clang-tidy: address readability-container-data-pointer lints 2022-05-24 09:09:43 -04:00
Ben Boeckel
a5f8cbe8b1 clang-tidy: address modernize-use-default-member-init lints 2022-05-24 09:09:43 -04:00
Ben Boeckel
97220f5b3f cmCTestSubmitHandler: avoid double fetching envvars
Technically, they can change between these two calls, so use the
verified pointer to assign to strings. Discovered by `clang-analyzer`.
2022-05-21 17:23:19 -04:00
Ben Boeckel
f1d55ff7e9 style: use cmStrCat in some more locations 2022-05-19 15:54:28 -04:00
Martin Duffy
30336dab66 cmJSONHelpers: Restructure cmJSONHelpers
Restructure cmJSONHelpers to prevent SunPro errors when passing context.
2022-05-05 12:12:12 -04:00
Brad King
75e8173322 Source: Fix clang -Wunused-but-set-variable warnings 2022-04-06 16:02:05 -04:00
Brad King
ab5baa32ad Merge topic 'ctest-WORKING_DIRECTORY'
a116fd413d ctest: print WORKING_DIRECTORY property with -V

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7060
2022-03-10 08:39:33 -05:00
Kevin Puetz
a116fd413d ctest: print WORKING_DIRECTORY property with -V 2022-03-09 13:00:01 -06:00