summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmCTestMultiProcessHandler: Simplify test startup batchingBrad King2023-11-211-4/+1
| | | | | | | Once a test is ready to run, count it against the number of tests to start in the current batch whether or not the test process actually starts successfully. If a test process does fail to start, simply schedule a new startup batch on the next loop iteration.
* cmCTestMultiProcessHandler: Clarify resource availability error member namesBrad King2023-11-171-1/+1
| | | | | The members are about the availability of sufficient resources, not allocation of them.
* cmCTestMultiProcessHandler: Use cm::uv_loop_ptr abstractionBrad King2023-11-171-1/+2
| | | | This ensures all loop resources are released.
* cmCTestRunTest: Consolidate initialization in constructorBrad King2023-11-171-3/+6
|
* Merge topic 'ctest-timeout-flag'Brad King2023-10-021-5/+6
|\ | | | | | | | | | | | | | | | | 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
| * ctest: Restore support for --timeout values higher than default test timeoutBrad King2023-09-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | CTest: Add ability to dynamically generate resource spec fileKyle Edwards2023-08-101-0/+22
| | | | | | | | Issue: #25106
* | cmCTestRunTest::StartFailure(): Add total argumentKyle Edwards2023-08-101-5/+6
|/ | | | | | | 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.
* CTest: Fix regression in calculating test timeoutKyle Edwards2023-07-241-3/+5
| | | | Fixes: #25120
* ctest: Optionally terminate tests with a custom signal on timeoutBrad King2023-06-021-0/+18
| | | | | | | | 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
* CTest/cmProcess: Adopt field tracking reason for the process timeoutBrad King2023-05-311-6/+12
| | | | | | 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`.
* cmCTestRunTest: Consolidate test timeout selection logicBrad King2023-05-041-47/+64
| | | | | Test timeout selection was previously spread out over several locations. Consolidate it in a single place to make it easier to follow.
* cmCTestRunTest: Adopt decision for starting cmProcess timerBrad King2023-05-041-1/+5
|
* cmCTestRunTest: Remove unnecessary arguments to ForkProcessBrad King2023-05-041-15/+9
|
* cmCTestTestHandler: Use in-class initialization of properties and resultsBrad King2023-05-041-5/+0
|
* cmCTestRunTest: Implement the ENVIRONMENT test property with EnvDiff tooAlex Reinking2022-08-151-8/+7
| | | | | | | | 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.
* cmSystemTools: Add EnvDiff class to hold ENVIRONMENT_MODIFICATION logicAlex Reinking2022-08-151-121/+6
| | | | Prepare to re-use this logic when enhancing `cmake -E env`.
* cmCTestRunTest: Simplify by using GetSystemPathlistSeparatorAlex Reinking2022-08-151-5/+1
| | | | | | 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.
* cmCTestRunTest: Remove unnecessary CMAKE_BOOTSTRAP guardAlex Reinking2022-08-151-2/+0
| | | | CTest is not compiled during CMake's `bootstrap` build.
* Merge topic 'ctest-WORKING_DIRECTORY'Brad King2022-03-101-0/+8
|\ | | | | | | | | | | | | | | a116fd413d ctest: print WORKING_DIRECTORY property with -V Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7060
| * ctest: print WORKING_DIRECTORY property with -VKevin Puetz2022-03-091-0/+8
| |
* | ctest: add option for output truncationFrank Winklmeier2022-03-081-1/+2
|/ | | | | | | | | | Add `--test-output-truncation` to `ctest`. This option can be used to customize which part of the test output is being truncated. Currently supported values are `tail`, `middle` and `head`. Also add equivalent `CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable. Fixes: #23206
* Merge topic 'envmod-test-modifying-existing'Brad King2021-11-011-1/+17
|\ | | | | | | | | | | | | | | 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
| * cmCTestRunTest: get the default value from the environmentBen Boeckel2021-10-291-1/+17
| | | | | | | | | | | | | | | | 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
* | Merge topic 'purge-sprintf'Brad King2021-10-271-4/+6
|\ \ | |/ |/| | | | | | | | | | | 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
| * Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-4/+6
| |
* | cmCTestRunTest: fix modifying non-existent envvarsBen Boeckel2021-10-261-6/+2
|/ | | | | | | | | 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
* CTest: add an ENVIRONMENT_MODIFICATION propertyBen Boeckel2021-07-091-3/+142
| | | | | | | | | | | | | | | | | | | | 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.
* ctest: support <CTestMeasurement> for runtime measurementsZack Galbreath2021-07-011-8/+12
| | | | | | | | | | | | | | | | | | | 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()
* ctest: allow test output to add labelsZack Galbreath2021-06-171-0/+17
| | | | | Parse test output for <CTestLabel>...</CTestLabel>. If found, add this value to the list of labels associated with this test.
* ctest: allow test output to override the 'details' fieldZack Galbreath2021-06-091-0/+16
| | | | | | Parse test output for <CTestDetails>...</CTestDetails>. If found, use this value to override the default 'Details' string reported to CDash.
* Merge topic 'ctest-progress-output-fixes'Brad King2021-01-071-3/+4
|\ | | | | | | | | | | | | | | 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
| * ctest: Don't treat skipped test as failed tests in progess reportSylvain Joubert2021-01-051-3/+4
| | | | | | | | | | Skipped tests should not stand out on their own lines Fixes #21143
* | Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-5/+5
|/ | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* cmCTest: Members accept std::string parametersVitaly Stakhovsky2020-07-271-4/+4
|
* Merge branch 'backport-ctest-repeat-notrun' into ctest-repeat-notrunBrad King2020-05-271-0/+5
|\
| * CTest: Make sure NOT_RUN tests show up in the failed test logRobert Maynard2020-05-271-0/+5
| | | | | | | | Issue: #20543
* | CTest: Log environment variables as a test measurementKyle Edwards2020-05-191-2/+32
| |
* | IWYU: mark <cstddef> as neededBen Boeckel2020-04-291-1/+1
| | | | | | | | Newer IWYU is not seeing them as needed for `size_t`.
* | cmCTestRunTest: modernize memory managementMarc Chevrier2020-03-111-18/+43
|/
* CTest: Improve error reporting with bad working directory for testsKyle Edwards2020-02-241-1/+1
|
* Refactor: Require detail when calling cmCTestRunTest::StartFailure()Kyle Edwards2020-02-241-4/+6
|
* CTest: Rename internal APIs for --repeat optionsBrad King2019-11-071-7/+7
| | | | Replace use of the term "rerun" with "repeat" to match the public names.
* Merge branch 'backport-ctest-resource-groups'Brad King2019-11-051-8/+8
|\
| * CTest: Rename hardware -> resources for source codeCraig Scott2019-11-051-5/+5
| |
| * CTest: Rename PROCESSES test property to RESOURCE_GROUPSBrad King2019-11-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The `PROCESSES` test property name added for CMake 3.16 is too close to the existing `PROCESSORS` test property. Furthermore, the property in principle specifies groups of resources organized in a way that is meaningful to a particular test. The groups may often correspond to processes but they could have other meanings. Since the property name `PROCESSES` has not been in a final 3.16 release yet, simply rename it to `RESOURCE_GROUPS`. Fixes: #19914
* | ctest: Add --repeat-after-timeout optionBrad King2019-10-291-5/+8
| | | | | | | | | | Add an option to re-run tests if they timeout. This will help tolerate sporadic timeouts on busy machines.
* | ctest: Add --repeat-until-pass optionBrad King2019-10-291-4/+10
| | | | | | | | | | | | | | | | | | Add an option to re-run tests if they fail. This will help tolerate sporadic failures. Issue: #17010 Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Co-Author: Chuck Atkins <chuck.atkins@kitware.com>
* | cmCTestRunTest: Use inline member initializersBrad King2019-10-291-3/+0
|/
* CTest: Allocate hardware to testsKyle Edwards2019-10-021-0/+43
|