Commit Graph

26 Commits

Author SHA1 Message Date
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Brad King 7ca6bdf035 Tests: Move CTestTestMemcheck tools into Tests/CMakeLib
The dummy memcheck tools we build for the RunCMake.CTestMemcheck tests
require CMakeLib, so put them in a Tests/CMakeLib/PseudoMemcheck
directory.
2014-12-18 10:12:16 -05:00
Brad King 218699eb28 Tests: Fix CMakeLib.testRST for relative __FILE__
Pass the test input directory as a runtime argument instead of
depending on __FILE__ to locate it.
2014-06-06 10:39:45 -04:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
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.
2014-03-08 13:05:35 -05:00
Brad King 450b515ad0 cmRST: Add support for the note and productionlist directives
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.
2013-10-30 10:26:29 -04:00
Brad King 2945814de2 cmRST: Teach cmake-module directive to scan bracket comments
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.
2013-10-23 09:36:00 -04:00
Brad King 2d0287dd5e cmRST: Process literal blocks after paragraphs ending in '::'
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.
2013-10-21 15:40:26 -04:00
Brad King 7b9ae406f3 cmRST: Do not process inline markup in code-block literals
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.
2013-10-21 14:56:26 -04:00
Brad King 25f2877eef Add class cmRST to do basic reStructuredText processing
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.
2013-10-16 09:22:35 -04:00
Stephen Kelly 920ffbf50f Require CMake 2.8.4 or greater to build CMake
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.
2013-10-15 09:22:56 -04:00
Petr Kmoch df035e4825 VS: Create parser for Visual Studio .sln files
Create class cmVisualStudioSlnParser as a generic parser for Visual
Studio .sln files. Implement minimum functionality but keep class
extensible.  Add tests for the class.
2013-04-12 11:35:35 -04:00
Daniel R. Gomez 96b66a4963 Avoid string.clear and string.push_back (#13319)
Compiler "gcc version 2.9-aix51-020209" does not offer them.
2012-06-19 14:21:34 -04:00
Stephen Kelly 8778357898 Add newline to the output. 2012-06-04 23:42:37 +02:00
Brad King 569cee1d9e complex: Move cmSystemTools::UpperCase test to CMakeLibTests
This test belongs in the CMakeLibTests test driver executable which
correctly links to CMakeLib.
2011-12-23 16:16:54 -05:00
Brad King 76ac88b730 complex: Move GeneratedFileStream test to CMakeLibTests
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.
2011-12-23 16:16:50 -05:00
Brad King 4268e3d7e9 run_compile_commands: Cast istream::get() result to char
We perform error checking on the stream after reading so this conversion
is safe.
2011-05-19 08:02:21 -04:00
Brad King c45c60b24f run_compile_commands: Avoid extra stl vector conversion
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.
2011-05-18 09:44:28 -04:00
Brad King 7c5be5114c run_compile_commands: Avoid shadow in std::map<>::at workaround
The map has a member called "empty" so use a different name for the
local variable in our approximate at() method.
2011-05-17 09:25:44 -04:00
Brad King 169bb05f90 Provide std::map<>::at for use in run_compile_commands
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.
2011-05-17 08:56:08 -04:00
Brad King a7e7a04aaf Fix run_compile_commands build on Apple GCC 3.3
This compiler does not provide the "at" method of std::map.  Approximate
it well enough for our needs.
2011-05-16 12:05:49 -04:00
Manuel Klimek 8346a28a0a Only offer the compile command output feature on unix systems 2011-05-16 10:42:10 -04:00
Manuel Klimek 0e6b05fcba Adds a test for the compile command line output. 2011-04-25 13:27:59 -04:00
Brad King 9478ad0945 Create CMakeLibTests output dir for Xcode
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.
2009-12-09 10:56:30 -05:00
Brad King f5ac85a29e Test XML encoding with UTF-8 character validation
This creates a unit test for cmXMLSafe.  See issue #10003.
2009-12-08 15:44:45 -05:00
Brad King 0a64936f49 Test UTF-8 decoding
This creates a unit test for cm_utf8.  See issue #10003.
2009-12-08 15:44:22 -05:00
Brad King 5872cc7c1f Create CMakeLib test driver and test cmXMLParser
We create a new CMakeLibTests driver executable in which to writes unit
tests for CMakeLib.  Our first test is a smoke-test of cmXMLParser.
2009-12-08 11:44:50 -05:00