Commit Graph

1690 Commits

Author SHA1 Message Date
Marc Chevrier
f9bcde974e cmCTestGenericHandler::GetOption returns cmProp 2021-09-13 11:29:07 +02:00
Ben Boeckel
ce44c2cec3 ctest_memcheck: generate DynamicAnalysis-Test.xml as well
This is useful so that memcheck results also show up as test results on
CDash. It will be submitted with the other `MemCheck` parts.

Fixes: #22190
2021-09-08 21:04:46 -04:00
Marc Chevrier
e5cd39ca80 cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
2021-08-08 16:19:08 +02:00
Kyle Edwards
d2515f77e1 Merge branch 'master' into ctest-test-changing-labels 2021-07-28 09:59:23 -04:00
Kyle Edwards
26170ea306 CTest: Reset multi-options to persistent multi-options
44ad3f0b added multi-options to CTest, but didn't reset them,
causing ctest_test() to fail if it was run multiple times with
different label arguments. Reset the multi-options.

Fixes: #22485
2021-07-28 09:58:28 -04:00
Brad King
3265fa51cd Merge topic 'ctest-environment-modifications'
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
4c757fa3c8 Help/prop_test/ENVIRONMENT: clarify the scope of the changes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6299
2021-07-13 08:24:36 -04:00
Brad King
2065bd73cb cmState: Construct with mode 2021-07-12 12:21:44 -04:00
Ben Boeckel
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
This property allows projects to modify environment variables at test
time rather than trying to guess what the state should be based on what
is present at configure time. Of particular interest is the ability to
use a `PATH` present at test time while adding entries known to be
necessary for the test itself.

There are multiple operations provided to modify variables, including:

  - setting and unsetting
  - appending and prepending as:
    - strings
    - path lists
    - CMake lists

Additionally, a `reset` action is provided to cancel any prior
modifications to that particular variable in the case of incremental
additions to the test property.
2021-07-09 08:45:18 -04:00
Zack Galbreath
5489ce74b3 ctest: support <CTestMeasurement> for runtime measurements
Teach CTest to parse output for <CTestMeasurement> in addition to
<DartMeasurement> for measurements defined at runtime.

Use a new class (cmCTestTestMeasurementXMLParser) derived from cmXMLParser
to parse the data and attributes these XML elements. This is an improvement
over our previous approach of using a series of regular expressions.

As part of this commit we also rename some member variables and methods
to make their purpose more clear.

DartStuff                        -> AllTestMeasurementsRegex
DartStuff1                       -> SingleTestMeasurementRegex
DartString                       -> TestMeasurementsOutput
GenerateDartOutput()             -> GenerateCTestXML()
GenerateRegressionImages()       -> RecordCustomTestMeasurements()
cmCTestRunTest::DartProcessing() -> ParseOutputForMeasurements()
2021-07-01 15:16:23 -04:00
Zack Galbreath
bd38749fd4 ctest: allow test output to add labels
Parse test output for <CTestLabel>...</CTestLabel>.
If found, add this value to the list of labels associated with this test.
2021-06-17 14:09:01 -04:00
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
Joseph Snyder
5d5610b04f CTest: Exit coverage handling early if no binary dir
Check for the existence of the Binary directory string before checking
for coverage files.  If the directory is not specified, write an error
message and do not do any checking.

Fixes: #22102
2021-06-02 08:41:09 -04:00
Marius Messerschmidt
bceb8e2ed2 cmMessenger: Pass title inside a metadata structure 2021-05-19 09:06:27 -04:00
Vitaly Stakhovsky
5e8fa0b7bc Source: Minor code improvements 2021-05-11 11:20:04 -04:00
Craig Scott
1aa4f97c97 cmCTestGenericHandler: Remove unused Command member
This was causing a cppcheck warning about an uninitialized member in
the constructor. Since nothing was using it, remove it.
2021-05-08 16:32:43 +10:00
friendlyanon
d2b856bc92 ctest_build: Add the PARALLEL_LEVEL argument
Fixes: #19712
2021-05-04 20:30:18 +02:00
friendlyanon
4dd4e9dd6c cmGlobalGenerator: Add parallel parameter to GenerateCMakeBuildCommand 2021-05-01 16:08:21 +02: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
Brad King
82e40607a4 ctest: Display test "WAITING" messages only in extra-verbose mode
These messages are incidental scheduling output.  Avoid cluttering
the normal verbose output showing tests starting and finishing.
2021-04-06 14:48:14 -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
Brad King
ff55f33c68 Merge topic 'ctest-dashboard-with-modified-files'
33fa015b4a CTest: Restore running dashboard client Test step with modified files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5791
2021-02-10 07:45:30 -05:00
Brad King
33fa015b4a CTest: Restore running dashboard client Test step with modified files
Since commit 6a6f1d1edd (CTest: exit nonzero after
message(SEND_ERROR|FATAL_ERROR), 2020-04-03, v3.19.0-rc1~260^2), `ctest`
no longer runs tests if there are errors before the full set of tests is
defined.  Such errors were previously treated more like warnings.

The change exposed some cases where we were issuing an error message but
proceeding to run tests anyway.  The above commit downgraded one such
case (missing `DartConfiguration.tcl`) to a warning explicitly in order
to restore its former warning-like semantics.

Downgrade the Update step's diagnostic about modified or conflicting
files to a warning for the same reason.

Fixes: #21783
2021-02-09 11:05:08 -05:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Ben Boeckel
808b17b120 clang-tidy: fix readability-make-member-function-const warnings 2021-01-27 08:45:45 -05:00
Ben Boeckel
4f396e6528 clang-tidy: fix performance-no-automatic-move warnings 2021-01-27 08:45:44 -05:00
Pawel Dac
54866346de CTest: Save sanitizer output files after test execution
Prior to this change after tests were executed output files
produced by sanitizers were removed. User couldn't check
in detail why test case didn't pass. Output files are
kept without pid in the end.
2021-01-13 22:08:53 +01: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
1bcd9b06b9 ctest: Don't treat skipped test as failed tests in progess report
Skipped tests should not stand out on their own lines
Fixes #21143
2021-01-05 10:32:33 +01:00
Vitaly Stakhovsky
4d9b1b42bc cmCTestBuildCommand: code improvement 2020-11-29 08:09:00 -05:00
Brad King
c8b2331e8b Merge topic 'rename_cuda_memcheck'
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5514
2020-11-18 07:29:54 -05:00
Tobias Ribizel
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer 2020-11-17 21:06:30 +01:00
Vitaly Stakhovsky
f6e7d5f3a0 Reduce the scope of temporary cmProp variables and other improvements 2020-11-05 11:07:39 -05:00
Asit Dhal
3c324689a7 include: refactor call sites of cmMakefile::ReadDependentFile
Fixes: #16773
2020-10-21 11:20:37 +02:00
Adriaan de Groot
c27553afb2 cmCTestBuildHandler: Avoid uninitialized line-numbers
When commands fail, there is no line number to report; still initialize
it explicitly to avoid compiler warnings.

Issue: #21166
2020-10-05 09:14:32 -04:00
Tobias Ribizel
050720f3ad CTest: add compute-sanitizer alias for cuda-memcheck 2020-10-01 09:01:01 +02:00
Zack Galbreath
a8b7dd061b ctest: improve Unicode support for launchers
Fix launcher behavior for international characters in the path on Windows.
2020-09-28 13:13:52 -04:00
Zack Galbreath
ab9ad2a6a0 ctest: report make-level errors to CDash when using launchers
Fixes: #19545
2020-09-28 13:13:52 -04:00
Zack Galbreath
56e4e942d2 ctest: split launcher XML writer into separate class
This refactor will allow us to more easily add additional warnings and errors
to builds that use launchers.
2020-09-28 13:13:52 -04:00
Kyle Edwards
b2f3f831e2 Refactor: Use JSON helpers in CTest resource spec 2020-09-09 12:48:29 -04: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
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
Tobias Ribizel
562dcec3c4 CTest: Add error types to cuda-memcheck parser 2020-08-05 10:51:44 +02:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Brad King
79d341d4d4 Merge topic 'cmctest-stdstring'
825b04c67a cmCTest: Members accept std::string parameters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5064
2020-07-28 08:25:47 -04:00
Vitaly Stakhovsky
825b04c67a cmCTest: Members accept std::string parameters 2020-07-27 10:58:39 -04:00