Commit Graph

1791 Commits

Author SHA1 Message Date
Brad King
37c80628ba Merge topic 'ctest-timeout-flag'
d267c128a2 ctest: Restore support for --timeout values higher than default test timeout
dd779a4bc2 Tests: Clarify RunCMake.CTestTimeout case name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8851
2023-10-02 08:57:36 -04:00
Brad King
d267c128a2 ctest: Restore support for --timeout values higher than default test timeout
Since refactoring in commit 0a5aeaf302 (cmCTestRunTest: Consolidate test
timeout selection logic, 2023-05-04, v3.27.0-rc1~120^2) we accidentally
truncate `--timeout` values to ctest's default `TimeOut`.  Fix the
logic to prefer the flag whenever the `TIMEOUT` property is not set.

In combination with the prior refactoring, this also fixes a bug that
caused `--timeout` values of 10000000 seconds or more to be ignored.

Fixes: #23979
2023-09-29 09:25:01 -04:00
scivision
d49ea4a4d9 Source: Remove redundant FileIsDirectory checks 2023-09-18 23:11:28 -04:00
Brad King
825e8c3d09 Merge topic 'ctest_submit_follow_redirects'
26ce8dc290 ctest: Restore support for http redirects during Submit step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8782
2023-09-08 08:58:56 -04:00
Zack Galbreath
26ce8dc290 ctest: Restore support for http redirects during Submit step
After CDash PR 1519 introduced HTTP status codes greater than 200 for
various error cases, CMake commit b7c871f745 (ctest: Update ctest_submit
for CDash behavior change, 2023-07-24, v3.27.1~3^2) modified CTest's
submit handler to check the status returned by CDash and throw an error
when this status is not equal to 200.

That change had the unintended side effect of causing CTest submissions
to fail when uploading results to a URL that returns a redirect status
code (3xx).  Fix this by configuring cURL to follow the redirect.  The
status cURL reports to CTest is now 200 instead of 3xx when CDash is
located behind a redirect.

Fixes: #25159
2023-09-07 15:37:27 -04:00
Kyle Edwards
0712e3cfea cmCTestCoverageHandler: Replace cmsysProcess with cmUVProcessChain 2023-08-29 10:51:30 -04:00
Kyle Edwards
96b3dd329e cmCTestLaunchReporter: Replace cmsysProcess with cmUVProcessChain
And convert cmCTestLaunch and cmCTestBuildHandler too.
2023-08-29 10:51:30 -04:00
Kyle Edwards
b15ad7ebb6 cmCTest: Replace cmsysProcess with cmUVProcessChain 2023-08-29 10:51:30 -04:00
Kyle Edwards
49a37d5a97 cmCTestScriptHandler: Replace cmsysProcess with cmUVProcessChain
And update cmSystemTools::WaitForLine() to use cmUVProcessChain.
2023-08-29 10:51:30 -04:00
Kyle Edwards
ec124582ac cmProcessTools::RunProcess(): Replace cmsysProcess with cmUVProcessChain
And convert the VCS code to std::vector<std::string>.
2023-08-29 10:51:30 -04:00
Kyle Edwards
0d95b68bd8 Merge topic 'ctest-generate-resource-spec-file'
c8c1dd0d95 CTest: Add ability to dynamically generate resource spec file
3f5a5a5856 cmCTestRunTest::StartFailure(): Add total argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8699
2023-08-14 11:18:03 -04:00
Kyle Edwards
c8c1dd0d95 CTest: Add ability to dynamically generate resource spec file
Issue: #25106
2023-08-10 16:47:51 -04:00
Kyle Edwards
3f5a5a5856 cmCTestRunTest::StartFailure(): Add total argument
This function was being called when TotalNumberOfTests hadn't been
initialized, resulting in undefined output. It's not clear why this
was never apparent until now. Accept a total argument to ensure it's
initialized.
2023-08-10 16:46:25 -04:00
Ben Boeckel
0abde043d2 cmCryptoHash: prefer to cmSystemTools::ComputeFileHash 2023-08-08 13:23:55 -04:00
Brad King
241ee252ce IWYU: Update for Debian 12 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 12.
2023-07-28 09:14:08 -04:00
Brad King
e49ff2b2f2 Merge topic 'ExportTestLabelToJUnit'
2b99e64413 set_test_properties: link to the test properties in the documentation
b11e8afbfa ctest: export test labels to junit xml

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8635
2023-07-28 09:12:23 -04:00
Alex Neundorf
b11e8afbfa ctest: export test labels to junit xml
With this patch, the junit files written by ctest also contain the
test labels as testcase properties, see
https://github.com/testmoapp/junitxml#properties

The name for the property is "cmake_labels", where "cmake_"
is used namespace-like. This could be done the same way
if we export more properties to junit.
Also this makes it clear to consumers that this is coming
from cmake, and the list is a cmake-formatted string.
2023-07-26 22:58:35 +02:00
Brad King
f6b8bd41bc Merge topic 'cdash_checksum_400'
b7c871f745 ctest: Update ctest_submit for CDash behavior change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8648
2023-07-25 11:03:06 -04:00
Brad King
d89bcc8891 Merge topic 'cdash_checksum_400' into release-3.27
b7c871f745 ctest: Update ctest_submit for CDash behavior change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8648
2023-07-25 11:03:05 -04:00
Zack Galbreath
b7c871f745 ctest: Update ctest_submit for CDash behavior change
open.cdash.org was recently upgraded in preparation for the release of
CDash v3.2.0. This upgrade brought a change in behavior where CDash now
responds with HTTP 400 (bad request) rather than HTTP 200 (OK) for MD5
checksum mismatches during submission time.

This commit removes our usage of CURLOPT_FAILONERROR in
cmCTestSubmitHandler.cxx This was necessary to pass along the contents
of the request body ("md5 mismatch") in cases where the web server
(CDash) responds with an error status (400).

Fixes: #25121
2023-07-25 09:09:56 -04:00
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