summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* cmTestGenerator: Require cmLocalGenerator, not cmMakefile.Stephen Kelly2015-08-231-5/+14
|
* Move GetFullPath to cmGeneratorTargetStephen Kelly2015-07-271-1/+1
|
* Genex: Store a backtrace, not a pointer to one.Stephen Kelly2015-07-171-1/+1
| | | | | | | | | | The storage of a pointer means that the ownership and lifetime are externally determined, which is harder to reason about. It also imposes API constraints, requiring APIs to return references to backtraces. This pointer storage was introduced in commit v3.1.0-rc1~425^2~3 (genex: remove the need for backtraces, 2014-05-23). As backtraces are now cheap to copy around, just do that instead.
* Port static calls from cmLocalGenerator to cmOutputConverter.Stephen Kelly2015-06-061-7/+7
|
* Don't use a cmLocalGenerator instance to call static methods.Stephen Kelly2015-05-141-9/+7
|
* TestGenerator: Add CROSSCOMPILING_EMULATOR support.Matt McCormick2015-04-081-1/+20
| | | | | | Prefix test commands with the CROSSCOMPILING_EMULATOR property for target executables. This allows test suites to be run on the host when crosscompiling.
* genex: remove the need for backtracesBen Boeckel2014-06-051-1/+1
| | | | | Rather than making dummy backtraces and passing them around, just make backtraces optional.
* Remove some c_str() calls.Stephen Kelly2014-03-111-1/+1
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-1/+1
|
* cmMakefile: make some methods take const std::string& instead of const char*Rolf Eike Beer2014-01-161-1/+1
| | | | | | | | Most callers already have a std::string, on which they called c_str() to pass it into these methods, which internally converted it back to std::string. Pass a std::string directly to these methods now, avoiding all these conversions. Those methods that only pass in a const char* will get the conversion to std::string now only once.
* Merge branch 'test-property-genex' into generate-modern-styleBrad King2013-09-201-22/+34
|\ | | | | | | | | | | Resolve conflict in Source/cmTestGenerator.cxx by taking "their" side (test-property-genex). It already accounts for the lower-case change in "our" side (generate-modern-style).
| * cmTestGenerator: Evaluate generator expressions in test propertiesBen Boeckel2013-09-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for cases like: add_test(NAME mytest COMMAND mydriver $<TARGET_FILE:myexe>) set_tests_properties(mytest PROPERTIES REQUIRED_FILES "$<TARGET_FILE:myexe>" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>" ) In this example we require the actual test executable to exist to run the test in addition to the test driver at argv[0]. Also the $<CONFIGURATION> expression improves over \${CTEST_CONFIGURATION_TYPE} because the latter is not normalized for case-sensitive filesystems.
| * cmTestGenerator: Separate test properties for each configurationBrad King2013-09-201-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | Move property generation from GenerateScriptConfigs to separate copies in GenerateOldStyle and GenerateScriptForConfig. This causes the per-config tests generated for the add_test(NAME) signature to each get their own test properties. This will allow us to later change the property values based on the test configuration. While at it, generate lower-case CMake code (e.g. set_tests_properties). Inspired-by: Ben Boeckel <mathstuf@gmail.com>
* | Generate modern-style cmake code.Stephen Kelly2013-08-221-4/+4
|/ | | | | | | | | | | The commits 9db31162 (Remove CMake-language block-end command arguments, 2012-08-13) and 77543bde (Convert CMake-language commands to lower case, 2012-08-13) changed most cmake code to use lowercase commands and no parameters in termination commands. However, those changes excluded cmake code generated in c++ by cmake. Make a similar style change to code generated by cmake.
* Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressionsStephen Kelly2012-12-201-2/+2
| | | | | The compiled generator expressions need to outlive the creating type. For the same reason, store the input string in a std::string.
* cmGeneratorExpression: Port users to two-stage processingStephen Kelly2012-09-181-4/+4
| | | | | | | | | | Removing the Process() API and removing the parameters from the constructor will allow cmGeneratorExpressions to be cached and evaluated with multiple configs for example, such as when evaluating target properties. This requires the creation of a new compiled representation of cmGeneratorExpression. The cmListFileBacktrace remains in the constructor so that we can record where a particular generator expression appeared in the CMakeLists file.
* CTest: Report tests not run due to unknown configurationBrad King2011-06-101-0/+16
| | | | | | | | | | | | | When add_test(NAME) is called without the CONFIGURATIONS argument then the test is intended to run in any configuration. In multi-config generators like the VS IDE and Xcode tests created by add_test(NAME) can only be run when testing a known configuration (otherwise there is no way to generate the test command line). If no test command line is known for a particular configuration, or if no configuration is given to ctest, report the test as not run instead of silently skipping it. Also fix CMake's own TestsWorkingDirectory test invocation to correct a previously silent failure exposed by this change.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* Introduce "generator expressions" to add_test()Brad King2009-08-111-2/+7
| | | | | | | | This introduces a new syntax called "generator expressions" to the test COMMAND option of the add_test(NAME) command mode. These expressions have a syntax like $<TARGET_FILE:mytarget> and are evaluated during build system generation. This syntax allows per-configuration target output files to be referenced in test commands and arguments.
* Cleanup test property script code generationBrad King2009-08-101-30/+4
| | | | | | | We teach cmTestGenerator::GenerateScriptConfigs to use the general cmLocalGenerator::EscapeForCMake method to write escaped test property values into test scripts. This eliminates the previous hand-coded escaping implementation.
* ENH: Add NAME mode to ADD_TEST commandBrad King2009-03-161-2/+66
| | | | | | | | This creates command mode add_test(NAME ...). This signature is extensible with more keyword arguments later. The main purpose is to enable automatic replacement of target names with built target file locations. A side effect of this feature is support for tests that only run under specific configurations.
* ENH: Refactor storage of test command linesBrad King2009-03-161-5/+9
| | | | | We used to separate the command executable from its argument vector. It is simpler to just store the whole command line in one vector.
* ENH: Refactor generation of CTestTestfile contentBrad King2009-03-161-0/+126
This moves code which generates ADD_TEST and SET_TESTS_PROPERTIES calls into CTestTestfile.cmake files out of cmLocalGenerator and into a cmTestGenerator class. This will allow more advanced generation without cluttering cmLocalGenerator. The cmTestGenerator class derives from cmScriptGenerator to get support for per-configuration script generation (not yet enabled).