Commit Graph

1714 Commits

Author SHA1 Message Date
Rose
b86b6aaa4a Source: Cleanup and simplify some code 2021-11-04 09:20:48 -04:00
Rose
6f4727aaa0 Source: Replace C headers with C++ ones
In applicable areas only, of course.
2021-11-02 14:45:29 -04:00
Brad King
4c68a0e71a Merge topic 'envmod-test-modifying-existing'
9c4d6404eb Tests/Environment: also test modifying ambient values
7d52d48a32 cmCTestRunTest: get the default value from the environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6682
2021-11-01 09:08:11 -04:00
Ben Boeckel
7d52d48a32 cmCTestRunTest: get the default value from the environment
This only works due to some assumptions about how the `ENVIRONMENT`
property is processed. Comments have been added to notify anyone
modifying the behavior about where to look.

Fixes: #22819
2021-10-29 10:54:02 -04:00
Brad King
a956be4847 Merge topic 'warnings-cleanup'
7e4e192ce2 Source: fix clang-tidy modernize-redundant-void-arg warning
8d671dd94c Source: fix more -Wmissing-prototypes warnings
1cf14f8c03 Source: fix many -Wmissing-prototypes warnings by marking functions static
319944b3d2 Source: fix some -Wunused-macros warnings
5257d9e71a Source: fix only -Wshorten-64-to-32 warning with explicit cast

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6648
2021-10-27 09:24:54 -04:00
Brad King
9bb7982a15 Merge topic 'purge-sprintf'
b7e9cd05cd Replace the only non-standard _snprintf with snprintf
5ba6e8ac59 Source: Replace most calls to sprintf with snprintf

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6649
2021-10-27 09:23:17 -04:00
Brad King
ede11598ba Merge topic 'simplify-boolean-expressions'
dd918c517d Source: Simplify some boolean expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6654
2021-10-27 09:22:04 -04:00
Brad King
b33c67a6f7 Merge topic 'envmod-support-mod-to-new-variables'
69f95cf1d9 cmCTestRunTest: fix modifying non-existent envvars

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6663
2021-10-27 09:20:46 -04:00
Ben Boeckel
69f95cf1d9 cmCTestRunTest: fix modifying non-existent envvars
When appending or modifying to a variable that has not been modified
before, the iterator was not valid, but it was used to insert into the
map again. Instead, just use indexing into the map since we know it will
exist by the end of the function anyways.

Fixes: #22796
2021-10-26 12:51:44 -04:00
Sean McBride
b7e9cd05cd Replace the only non-standard _snprintf with snprintf 2021-10-25 18:23:13 -04:00
Sean McBride
5ba6e8ac59 Source: Replace most calls to sprintf with snprintf 2021-10-25 18:23:13 -04:00
Sean McBride
8d671dd94c Source: fix more -Wmissing-prototypes warnings 2021-10-25 12:27:10 -04:00
Sean McBride
1cf14f8c03 Source: fix many -Wmissing-prototypes warnings by marking functions static 2021-10-25 12:27:09 -04:00
Sean McBride
319944b3d2 Source: fix some -Wunused-macros warnings
- deleted one unused define
- moved define into #if block where it is used
2021-10-25 12:27:08 -04:00
Rose
dd918c517d Source: Simplify some boolean expressions 2021-10-23 11:30:27 -04:00
Brad King
d723bac01c Merge topic 'lcc-compiler'
02b2607a5c Help: Add release note for MCST LCC compiler support
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture
0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found
ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6608
2021-10-19 09:22:22 -04:00
Brad King
e495f360b2 Merge topic 'ctest_submit-inactivity-timeout'
5d178fcc53 CTest: Add CTEST_SUBMIT_INACTIVITY_TIMEOUT variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6584
2021-10-18 09:27:14 -04:00
Sean McBride
e2a4718d18 Source: Fix Clang -Wdeprecated warnings
Applied C++ 'rule of three'.
2021-10-15 11:23:12 -04:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Nikhil Reddy Ramolla
5d178fcc53 CTest: Add CTEST_SUBMIT_INACTIVITY_TIMEOUT variable
Fixes: #22617
2021-10-14 11:41:44 -04:00
Marc Chevrier
59ad7a1c24 Move helpers functions from cmStringAlgorithms.h to cmValue.h
Helpers functions related to cmValue semantic are now part of
cmValue.h header.
2021-09-21 18:11:00 +02:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
8f52451682 Use new SetOption signatures 2021-09-15 18:08:19 +02:00
Marc Chevrier
8d0ae460de cmCTestGenericHandler::SetOption accepts cmProp or std::string 2021-09-15 18:08:19 +02:00
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