summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib
Commit message (Collapse)AuthorAgeFilesLines
* execute_process: Add ENCODING option for Windows child process outputDāvis Mosāns2016-11-302-0/+52
| | | | Different applications can use different output encodings.
* iwyu: Fix more findingsDaniel Pfeifer2016-11-283-3/+15
|
* iwyu: Fix OSX specific issuesDaniel Pfeifer2016-11-221-1/+3
|
* Simplify CMake per-source license noticesBrad King2016-09-276-66/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* find_package: Optionally sort globbed directories in a meaningful orderPierluigi Taddei2016-09-152-0/+77
| | | | | | | | | | | | Add `CMAKE_FIND_PACKAGE_SORT_{ORDER,DIRECTION}` variables to specify sort order and direction. When multiple package with the same name have been found in the same location sorting option can be used to force a specific version to be loaded (e.g. libA_1.12.0 instead of libA_1.1.0). Currently sorting by NAME and by NATURAL order have been implemented. Natural ordering makes use of the `strverscmp(3)` ordering.
* Tests: Add test for our strverscmp implementationPierluigi Taddei2016-09-141-4/+68
| | | | | Cover typical examples and the ordering defined by the `strverscmp(3)` man page.
* Merge topic 'macro-parenthesis'Brad King2016-09-062-3/+3
|\ | | | | | | | | 1a9de803 surround macro arguments with parentheses
| * surround macro arguments with parenthesesDaniel Pfeifer2016-09-052-3/+3
| |
* | use CM_NULLPTRDaniel Pfeifer2016-09-052-2/+3
|/
* Tests/CMakeLib: include what you useDaniel Pfeifer2016-09-033-4/+7
|
* Tests/CMakeLib: use cmsys::ifstreamDaniel Pfeifer2016-09-032-10/+16
|
* Merge topic 'readability-named-parameter'Brad King2016-08-175-5/+5
|\ | | | | | | | | e7b842e1 Make sure unnused parameters are /*named*/
| * Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-165-5/+5
| |
* | fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-162-0/+11
|/
* Add missing braces around statements.Daniel Pfeifer2016-06-102-10/+17
| | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* PseudoMemcheck: revise style with clang-format.Daniel Pfeifer2016-06-101-14/+8
| | | | | | Rename memtester.cxx.in to memtester.cxx, run clang-format, then restore the original name. Fix the @_retval@ placeholder that was broken by clang-format.
* Merge topic 'remove-needless-copies'Brad King2016-05-271-1/+1
|\ | | | | | | | | | | 27ead963 Remove unnecessary local copies. 618fb23f Pass arguments that are not modified as const&.
| * Pass arguments that are not modified as const&.Daniel Pfeifer2016-05-261-1/+1
| | | | | | | | | | | | | | Use clang-tidy's performance-unnecessary-value-param checker to find value parameter declarations of expensive to copy types that are not modified inside the function. Ignore findings in kwsys. After applying the fix-its, manually change `const T&` to `T const&`.
* | Remove redundant c_str() calls.Daniel Pfeifer2016-05-262-9/+9
|/ | | | | Run clang-tidy's readability-redundant-string-cstr checker. Ignore findings in kwsys.
* Revise C++ coding style using clang-formatKitware Robot2016-05-168-313/+256
| | | | | | | | | | | | | 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-2/+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.
* Help clang-format wrap after braces on long initializer listsBrad King2016-05-061-0/+2
| | | | | | Add a long comment inside a few braced initializer lists in order to convince clang-format to break after the opening brace and format the list without indenting every value past the opening brace.
* 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 use of include <cmsys/ios/*> and cmsys_ios::*Brad King2015-08-202-32/+32
| | | | We no longer need this compatibility layer for the compilers we support.
* cmSystemTools: Teach RunSingleCommand to separate stdout and stderrBrad King2015-04-201-1/+1
| | | | | | | Extend the RunSingleCommand signature to capture stdout and stderr separately. Allow both to be captured to the same std::string to preserve existing behavior. Update all call sites to do this so that this refactoring does not introduce functional changes.
* Merge branch 'backport-no-global-setlocale' into no-global-setlocaleBrad King2015-02-061-2/+0
|\ | | | | | | Resolve conflict in Source/CMakeLists.txt by taking both changes.
* | Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | | | | | All compilers hosting CMake support the std class.
* | Tests: Move CTestTestMemcheck tools into Tests/CMakeLibBrad King2014-12-184-0/+125
|/ | | | | | The dummy memcheck tools we build for the RunCMake.CTestMemcheck tests require CMakeLib, so put them in a Tests/CMakeLib/PseudoMemcheck directory.
* Tests: Fix CMakeLib.testRST for relative __FILE__Brad King2014-06-062-3/+10
| | | | | Pass the test input directory as a runtime argument instead of depending on __FILE__ to locate it.
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-4/+4
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* cmRST: Add support for the note and productionlist directivesBrad King2013-10-302-0/+14
| | | | | | Simply print out the lines as normal paragraph text. Teach the CMakeLib.testRST test to cover this syntax. Update the cmake-developer.7 manual to document support for the directives.
* cmRST: Teach cmake-module directive to scan bracket commentsBrad King2013-10-232-0/+13
| | | | | | | | | | | | | | | | When scanning CMake module files for .rst comments, recognize bracket comments starting in ".rst:" too. For example: #[[.rst: Include the bracket comment content terminated by the closing bracket. Exclude the line containing the bracket if it starts in "#". Teach the CMakeLib.testRST test to cover multiple bracket lengths and ending brackets on lines with and without "#". Update the cmake-developer.7 manual to document the bracket-comment syntax for .rst documentation.
* cmRST: Process literal blocks after paragraphs ending in '::'Brad King2013-10-212-0/+34
| | | | | | | Teach cmRST to recognize non-markup lines ending in '::' followed by a blank line as starting a literal block. Record the whole block as if it were a literal block directive and print it just like a code block. Extend the CMakeLib.testRST test to cover such cases.
* cmRST: Do not process inline markup in code-block literalsBrad King2013-10-212-0/+5
| | | | | | | | Move the ProcessDirectiveParsedLiteral and ProcessDirectiveCodeBlock method internals into an OutputMarkupLines helper. Pass through it a new "inlineMarkup" parameter and teach OutputLine to understand it. When false, do not process inline markup. Extend the CMakeLib.testRST test to cover the two cases.
* Add class cmRST to do basic reStructuredText processingBrad King2013-10-169-0/+246
| | | | | | | | | | | | | | | | Create a cmRST class to perform just enough reStructuredText processing to support display of Help documents in human-readable text format. This will be used to implement --help-* command-line options. Support directives "include", "replace", "parsed-literal", "toctree" (Sphinx), and "cmake-module" (CMake Sphinx Extension to scan .cmake modules). Support inline CMake Sphinx Domain roles to convert cross-references to corresponding title text. Support inline substitutions defined by the "replace" directive, but keep it simple by requiring replacements to be defined before use. Add a CMakeLib "testRST" case to cover processing of supported constructs and compare results against expected output.
* Require CMake 2.8.4 or greater to build CMakeStephen Kelly2013-10-151-1/+1
| | | | | | | | | | | | | | This allows the use of the $<TARGET_FILE:...> generator expression as a replacement for the use of the LOCATION target property. The use of the LOCATION target property is now deprecated for in-build targets. Also drop other checks for older CMake versions: * Simplify cmake_set_target_folder macro. * Use find_package(LibArchive) unconditionally. * Simplify condition for running testVisualStudioSlnParser test. * Convert two macros to functions. * Unconditionally run the CTestTestRerunFailed test.
* VS: Create parser for Visual Studio .sln filesPetr Kmoch2013-04-1219-0/+946
| | | | | | Create class cmVisualStudioSlnParser as a generic parser for Visual Studio .sln files. Implement minimum functionality but keep class extensible. Add tests for the class.
* Avoid string.clear and string.push_back (#13319)Daniel R. Gomez2012-06-191-2/+2
| | | | Compiler "gcc version 2.9-aix51-020209" does not offer them.
* Add newline to the output.Stephen Kelly2012-06-041-1/+1
|
* complex: Move cmSystemTools::UpperCase test to CMakeLibTestsBrad King2011-12-232-0/+34
| | | | | This test belongs in the CMakeLibTests test driver executable which correctly links to CMakeLib.
* complex: Move GeneratedFileStream test to CMakeLibTestsBrad King2011-12-232-0/+101
| | | | | | This test belongs in the CMakeLibTests test driver executable which correctly links to CMakeLib. Fix incorrect library link order in the Complex tests exposed by this change.
* run_compile_commands: Cast istream::get() result to charBrad King2011-05-191-1/+1
| | | | | We perform error checking on the stream after reading so this conversion is safe.
* run_compile_commands: Avoid extra stl vector conversionBrad King2011-05-181-3/+2
| | | | | | | The Sun compiler does not provide the proper vector constructor to initialize it from an iterator pair of a non-matching type. Extend the ParseUnixCommandLine API to provide a vector of the proper type so no conversion is needed.
* run_compile_commands: Avoid shadow in std::map<>::at workaroundBrad King2011-05-171-2/+2
| | | | | The map has a member called "empty" so use a different name for the local variable in our approximate at() method.
* Provide std::map<>::at for use in run_compile_commandsBrad King2011-05-171-2/+0
| | | | | | Many compilers we support do not provide the at() member of std::map. Use the workaround added by commit a7e7a04a (Fix run_compile_commands build on Apple GCC 3.3, 2011-05-16) for all compilers.
* Fix run_compile_commands build on Apple GCC 3.3Brad King2011-05-161-1/+13
| | | | | This compiler does not provide the "at" method of std::map. Approximate it well enough for our needs.
* Only offer the compile command output feature on unix systemsManuel Klimek2011-05-161-2/+4
|
* Adds a test for the compile command line output.Manuel Klimek2011-04-252-0/+135
|
* Create CMakeLibTests output dir for XcodeBrad King2009-12-091-0/+10
| | | | | | | | | Xcode 2.x forgets to create the target output directory before linking the individual architecture pieces of a universal binary for the target CMakeLibTests. Then it passes the directory to -L and -F options when linking the and warns that the directory does not exist. We work around the problem by using a pre-build rule on the target to create the output directory.
* Test XML encoding with UTF-8 character validationBrad King2009-12-082-0/+48
| | | | This creates a unit test for cmXMLSafe. See issue #10003.