Commit Graph

1626 Commits

Author SHA1 Message Date
Craig Scott 348a2a9734 Merge topic 'ctest-memcheck-sanitizers'
e03d3c08f0 CTest: Fix '-T MemCheck' command-line support for sanitizers
82b6091776 Tests: Fix RunCMake.ctest_memcheck test script syntax errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4618
2020-04-19 07:07:13 -04:00
Brad King e03d3c08f0 CTest: Fix '-T MemCheck' command-line support for sanitizers
In commit 49948f7221 (ctest_memcheck: Add support for ThreadSanitizer,
2014-07-07, v3.1.0-rc1~322^2~1) and commit 1e005eadbc (CTest: Fix
MemoryCheckType from 'ctest -T MemCheck', 2014-07-15, v3.1.0-rc1~298^2),
the `CMakeCommand` internal setting was left set only when using `ctest
-S` scripts.  Instead simply use CTest's corresponding CMake directly
without passing it through an internal setting.

Fixes: #20584
2020-04-17 08:36:01 -04:00
Marc Chevrier aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Ben Boeckel 89207abf1f cmParseCacheCoverage: use cmSystemTools::SplitString 2020-04-13 11:26:03 -04:00
Ben Boeckel 59b7adddc4 nits: replace some "c" instances with 'c' 2020-04-13 11:26:03 -04:00
Ben Boeckel f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Kyle Edwards 060d2ce269 CTest: Add CTEST_RESOURCE_SPEC_FILE variable 2020-04-02 16:29:50 -04:00
Brad King a6611577c3 Merge topic 'cmprop-getglobalprop'
c84cf42897 cmState::GetGlobalProperty: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4521
2020-03-27 07:50:28 -04:00
Brad King 3503a79639 Merge branch 'backport-ctest-timeout-report' into ctest-timeout-report 2020-03-26 14:42:17 -04:00
Brad King 7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open
Since commit d1976cd1f2 (CTest: Fix timeout when grandchild keeps pipes
open, 2020-01-13, v3.17.0-rc1~169^2) we no longer hang, but the test
duration we report after the timeout is the amount of time the immediate
child ran before exiting.  Fix the logic to instead report the actual
amount of time we spent monitoring the test before the timeout.

Fixes: #20509
2020-03-26 14:35:54 -04:00
Vitaly Stakhovsky c84cf42897 cmState::GetGlobalProperty: return cmProp 2020-03-25 09:10:46 -04: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 761f1adcae check for a valid URL scheme before starting to do any splitting 2020-03-23 22:41:44 +01:00
Rolf Eike Beer ef778d77e0 replace std::string::substr() with operations that do not allocate memory
Modify the original string instead of creating a new copy with substr() when it
is not used for anything else afterwards.
2020-03-23 22:41:44 +01:00
Rolf Eike Beer 48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Rolf Eike Beer bfb69f9543 replace "substr(0, xx) ==" with cmHasPrefix() 2020-03-23 20:19:26 +01:00
Rolf Eike Beer d6a4e9fbc8 CTest: avoid repeated string compares
Only one key can match per iteration, avoid any further compares when one match
was already found. While at it entirely avoid that the key and value strings are
copied.
2020-03-23 20:18:02 +01:00
Rolf Eike Beer d1e6ee6fe3 Mumps coverage: directly pass std::string as argument 2020-03-23 19:47:47 +01:00
Rolf Eike Beer dc21177461 remove pointless return value from cmCTestTestHandler::CleanTestOutput() 2020-03-23 19:47:47 +01:00
Rolf Eike Beer 36bfb80338 PyCoverage: avoid repeated string splitting, especially for uncovered lines 2020-03-23 19:47:47 +01:00
Rolf Eike Beer 0415fa3be7 use std::string::rfind() instead of open coding it
While at it avoid creating a new string.
2020-03-23 19:47:47 +01:00
Brad King 74954a6657 Merge topic 'modernize-memory-management'
f964739ead cmCTestRunTest: modernize memory management

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4454
2020-03-12 08:25:20 -04:00
Brad King 7ed1d5c342 Merge topic 'ctest-curl-debugfunction'
7a1cce210b CTest: Fix our internal CURL_DEBUGFUNCTION to conform to CURL docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4459
2020-03-12 08:19:43 -04:00
Betsy McPhail 7a1cce210b CTest: Fix our internal CURL_DEBUGFUNCTION to conform to CURL docs
The curl debug callback function must return ``0``.

Fixes: #20449
2020-03-11 13:36:58 -04:00
Marc Chevrier f964739ead cmCTestRunTest: modernize memory management 2020-03-11 17:46:11 +01:00
Vitaly Stakhovsky a6cd48ac41 Source: use std::string overloads 2020-03-10 10:55:09 -04:00
Marc Chevrier 44867a8c01 Modernize memory management
Update internals of various classes.
2020-03-08 16:32:44 +01:00
Kyle Edwards a5be3916ee CTest: Provide more detailed information on resource allocation error 2020-02-24 15:44:01 -05:00
Kyle Edwards f0df3ed5b9 Refactor: Provide more detailed error information from TryAllocateResources() 2020-02-24 15:44:01 -05:00
Kyle Edwards f1c34443b7 CTest: Improve error reporting with bad working directory for tests 2020-02-24 15:44:01 -05:00
Kyle Edwards 1dec359422 Refactor: Require detail when calling cmCTestRunTest::StartFailure() 2020-02-24 15:44:01 -05: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 d1976cd1f2 CTest: Fix timeout when grandchild keeps pipes open
When a test's process creates its own child and exits, the grandchild
may keep pipes open.  Fix CTest logic to correctly timeout if the
grandchild does not exit and close the pipes before the timeout expires.
This was broken by commit b5e21d7d2e (CTest: Re-implement test process
handling using libuv, 2017-12-10, v3.11.0-rc1~117^2) which added an
unnecessary condition to the timeout handling.

Fixes: #20116
2020-01-14 10:29:05 -05:00
Marc Chevrier 968477517e Refactoring: suppress cmEraseIf in favor of cm::erase_if 2020-01-09 11:19:20 +01:00
Marc Chevrier a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +01:00
Craig Scott da9cbeb3e9 Merge topic 'ctest-resource-allocation-spec-message'
b393b32b4b CTest: Improve error handling when reading resource spec file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4162
2019-12-28 19:03:00 -05:00
Kyle Edwards b393b32b4b CTest: Improve error handling when reading resource spec file
Fixes: #20079
2019-12-27 10:53:52 -05:00
Marc Chevrier f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Brad King 0e0571599f Merge topic 'ctest-drmemory-support'
676befdf52 ctest: add support for memcheck using Dr. Memory
2db0a65f56 cmCTestMemCheckHandler.cxx: minor refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4119
2019-12-12 11:54:54 -05:00
Dietmar Scheidl 676befdf52 ctest: add support for memcheck using Dr. Memory
Fixes: #19788
2019-12-10 14:42:30 -05:00
Dietmar Scheidl 2db0a65f56 cmCTestMemCheckHandler.cxx: minor refactoring 2019-12-10 14:36:19 -05:00
Julien Jomier e6f758be6d ctest: Populate CTEST_CONFIGURATION_TYPE from the -C command line when set 2019-12-09 13:10:59 -05:00
Brad King 3d5227e6b6 Merge topic 'ctest-resource-fixes'
a033bafbe0 Help: Clarify how tests are run if no resource spec file is specified
a64ba0235f CTest: Clarify that resource requirements can be split
f9f294f5fa CTest: Add version field to resource spec file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4080
2019-11-26 09:12:34 -05:00
Kyle Edwards f9f294f5fa CTest: Add version field to resource spec file
Fixes: #20007
2019-11-25 11:08:27 -05:00
Brad King 28994115e8 ctest_test: Add option to REPEAT tests 2019-11-07 14:21:18 -05:00
Brad King 42d5d8f425 cmCTestMultiProcessHandler: Hold repeat mode as a member 2019-11-07 14:14:36 -05: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 016601e5e6 Merge branch 'backport-ctest-resource-groups' 2019-11-05 12:59:16 -05:00
Craig Scott c544cb6698 CTest: Rename hardware -> resources for source code 2019-11-05 12:08:35 -05:00
Craig Scott 6ce27d3a2e cmCTestMultiProcessHandler: Rename resource locking functions
Renaming these ahead of other refactoring which will use the
previous names. The previous names more accurately reflect their
purpose after this commit anyway (talking about locking and
unlocking rather than allocating and deallocating).
2019-11-05 12:08:35 -05:00