summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-9/+10
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-2/+1
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* Merge topic 'pvs-cleanup'Brad King2019-08-261-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7fe3e874d5 cmCPackLog: Fix support for multiple log message tags 74f2c0ea56 cmCTestTestHandler: Remove extra layer of parentheses 7c2767ef3b cmCTestMultiProcessHandler: Explain testRun ownership in comments 303e813438 CTest: Simplify some boolean conditions 51565abe79 cmMessageCommand: Remove extra layer of parentheses b1cfaf7b91 cmVSSetupHelper: Remove unused SmartBSTR copy operations 3f4c4e7afe cmVSSetupHelper: Fix SmartBSTR copy operations a8ca5aea94 cmMakefileTargetGenerator: Check for null before using a pointer ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Acked-by: Artalus <artalus-mail@yandex.ru> Merge-request: !3715
| * CTest: Simplify some boolean conditionsBrad King2019-08-261-2/+1
| | | | | | | | | | | | | | Directly compare two boolean values instead of spelling out accepted combinations. Issue: #19610
* | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-19/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-1/+1
|
* CTest: Add SKIP_REGULAR_EXPRESSION test propertyGabor Bencze2019-07-181-3/+22
|
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|
* CTest: Clean up stdout and logfile output for Pass/Fail regexStephen Manz2019-07-091-9/+12
| | | | | | | | | | For pass regex, display only the element that was found, rather than all elements Rename loop variable for fail regex, from pass to fail For consistency, add space in output for pass Add tests that find and don't find PASS_REGULAR_EXPRESSION, and a test that finds FAIL_REGULAR_EXPRESSION, whose LastTest.log files are checked using *-check.cmake.
* cmCTest: Remove friend declarationsRegina Pfeifer2019-03-181-3/+6
|
* ctest: refactor some codeGregor Jasny2019-03-051-17/+10
|
* Merge topic 'cmCTestRunTest-compress'Brad King2019-02-121-73/+11
|\ | | | | | | | | | | | | 948c55857e cmCTestRunTest: Remove duplicated compression logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2946
| * cmCTestRunTest: Remove duplicated compression logicRegina Pfeifer2019-02-101-73/+11
| |