summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATORBrad King2024-01-291-2/+4
| | | | | | | | Evaluate generator expressions in these properties, as they apply to `add_test`, `add_custom_command`, and `add_custom_target`. The `CMAKE_CROSSCOMPILING_EMULATOR` variable's `try_run` behavior occurs at configure time and so cannot support generator expressions.
* cmTestGenerator: De-duplicate TEST_LAUNCHER and CROSSCOMPILING_EMULATOR implBrad King2024-01-291-20/+20
|
* add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compilingRalf Habacker2023-12-191-1/+3
| | | | | | Add policy CMP0158 to provide compatibility for existing projects. Fixes: #23672
* add_test: Optionally use a launcher for tests running in-project targetsRalf Habacker2023-12-131-0/+12
| | | | | | | Add a `CMAKE_TEST_LAUNCHER` variable and corresponding `TEST_LAUNCHER` target property. Issue: #23672
* add_test: Restore support for empty test argumentsMarc Chevrier2023-06-091-1/+2
| | | | | | | | This was regressed by refactoring in commit e08ba229ee (CMake code rely on cmList class for CMake lists management (part. 1), 2023-04-14, v3.27.0-rc1~174^2). Fix it and add a test case. Fixes: #24986
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-11/+11
|
* cmGeneratorExpression: Require cmake instanceKyle Edwards2022-11-111-1/+2
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+1
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* add_test: Allow special characters in test name (w/ policy CMP0110)Deniz Bahadir2020-08-121-9/+112
| | | | | | | | | | | | | | Restore the change from commit f84af8e270 (add_test: Allow special characters in test name, 2020-05-16, v3.18.0-rc1~142^2) that had to be reverted by commit f84af8e270 (add_test: Allow special characters in test name, 2020-05-16, v3.18.0-rc1~142^2) for compatibility. Add policy CMP0110 to make the change in a compatible way. Also, support even more characters than before by generating the test scripts using bracket arguments around the test names. Fixes: #19391 Signed-off-by: Deniz Bahadir <dbahadir@benocs.com>
* Merge topic 'revert-add_test-special-chars'Brad King2020-07-281-7/+7
|\ | | | | | | | | | | | | 5fc5f4d26e add_test: Revert "Allow special characters in test name" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5067
| * add_test: Revert "Allow special characters in test name"Brad King2020-07-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Revert commit f84af8e270 (add_test: Allow special characters in test name, 2020-05-16, v3.18.0-rc1~142^2). Unfortunately the fix breaks projects that were working around the limitation with manual escaping. The fix can be re-introduced with a policy in a future version. Also add a 3.18.1 release note explaining the change. Fixes: #21017, #20965 Issue: #19391
* | cmNonempty: Convenience inlines to check for non-empty stringVitaly Stakhovsky2020-07-141-1/+1
|/
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* add_test: Allow special characters in test nameDeniz Bahadir2020-05-171-7/+7
| | | | Fixes: #19391
* cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-3/+3
|
* Refactor: Avoid `std::endl` where it's not necessary (part 2)Alex Turbov2020-03-241-5/+5
| | | | | | | | | | | | The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+1
| | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-2/+3
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-0/+2
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Merge topic 'add-test-command-expand-lists'Brad King2019-06-121-8/+29
|\ | | | | | | | | | | | | e791ffac61 add_test: Add COMMAND_EXPAND_LISTS option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3422
| * add_test: Add COMMAND_EXPAND_LISTS optionSergey Bobrenok2019-06-071-8/+29
| | | | | | | | | | | | | | | | | | Add a `COMMAND_EXPAND_LISTS` option to the `add_test` command to cause `;`-separated lists produced by generator expressions to be expanded into multiple arguments. The `add_custom_command` command already has such an option. Fixes: #17284
* | cmPropertyMap: Use std::string as value container classSebastian Holtermann2019-06-081-1/+0
| |
* | cmPropertyMap: Add GetList methodSebastian Holtermann2019-06-081-6/+4
|/
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-1/+1
|
* Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-10/+7
| | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-3/+1
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* CROSSCOMPILING_EMULATOR: Fix test generation for empty valueKyle Edwards2019-01-211-1/+1
| | | | | | | | If CROSSCOMPILING_EMULATOR was set to an empty string, and a test was generated with the executable as the command, CMake would segfault upon trying to generate the test file. Fix this. Fixes: #18819
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-2/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* TestGenerator: Record support file and line where test was addedJustin Goshi2019-01-081-17/+42
| | | | | Add internal test properties that ctest can use to report where the test was added in CMake code.
* cmCompiledGeneratorExpression::Evaluate(): return const std::string&Vitaly Stakhovsky2018-08-091-1/+1
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-2/+3
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* server: ctestInfo fix to return all testsJustin Goshi2017-11-171-0/+10
| | | | | Prior to this change we were looking at targets. But tests are associated with directories. This change fixes how we gather all tests.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-11/+9
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-2/+2
|
* cmScriptGenerator: pass Indent by valueDaniel Pfeifer2017-04-211-9/+5
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-5/+4
|
* cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-1/+1
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-0/+1
|
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-161-0/+8
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-2/+2
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-70/+45
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Remove some obsolete declarationsStephen Kelly2015-10-271-2/+0
| | | | | | | | | | | | | Ensure that cmStandardIncludes.h is included before any platform header in cmGeneratorExpressionEvaluator.h. That file needs to change as a result of removal of the cmMakefile.h header from cmGeneratorExpressionNode.h, affecting the compilation of cmGeneratorExpressionNode.cxx. On AIX we need to include our own headers first to get large file support macros defined consistently within system headers. The old order in this header worked only because it was always included after other headers.
* cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-1/+1
| | | | | | | Mostly automated: values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType") for i in "${values[@]}"; do git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
* cmLocalGenerator: Store cmGeneratorTargets.Stephen Kelly2015-10-141-1/+1
| | | | Relieve cmMakefile of this responsibility.
* cmGeneratorExpression: Port to cmLocalGenerator.Stephen Kelly2015-10-121-3/+3
|