Commit Graph

984 Commits

Author SHA1 Message Date
Joseph Snyder 9fd04f874c CTEST: Update Jacoco Coverage search paths
Add a new additional entry to the FilePaths array when a
"package" tag has been found. This path should consist of the package
information found appended to the projects source directory.

This change will allow code held in a /src/main/java/* directory off of the
projects source directory to be found, unlike now which assumes a subdirectory
contains the code.
2014-07-30 11:22:55 -04:00
Bill Hoffman 5d40d88e00 Handle more than one process with sanitizer errors.
Since the Sanitizers write out one log file per process, a single
test might have more than one log file. This commit allows ctest
to read all of the log files found for a particual test.
2014-07-24 11:25:59 -04:00
Brad King 0aa7d9dc10 Merge topic 'encoding-ctest-fixes'
09b2ac38 Encoding:  Fix a few encoding problems with ctest.
2014-07-18 10:56:53 -04:00
Clinton Stimpson 09b2ac38d1 Encoding: Fix a few encoding problems with ctest.
This also fixes some test failures on Windows when the
name of the build directory contains non-ascii characters.
2014-07-18 10:05:01 -04:00
Bill Hoffman 1e005eadbc CTest: Fix MemoryCheckType from 'ctest -T MemCheck'
Before this commit, you would have to run ctest -S mode to get
MemoryCheckType to work. This is because CMAKE_COMMAND was not set.
The fix is to use cmSystemTools::GetCMakeCommand instead.
2014-07-16 11:50:33 -04:00
Bill Hoffman 4472671432 ctest_memcheck: Add support for memory and leak sanitizer.
This adds support for memory and leak sanitizers.  This is built into
clang and gcc 4.8 and new compilers. It is activated with a -f switch
during compile.
2014-07-16 11:50:23 -04:00
Bill Hoffman 49948f7221 ctest_memcheck: Add support for ThreadSanitizer
This commit adds support for ThreadSanitizer to ctest.  ThreadSanitizer
is part of the clang compiler and also gcc 4.8 and later. You have to
compile the code with special flags. Then your code gets the the
ThreadSanitizer ability built into it. To pass options to the
ThreadSanitizer you use an environment variable. This commit teaches
ctest to parse the output from ThreadSanitizer and send it to CDash.
2014-07-09 09:48:35 -04:00
Brad King f33d875a84 CTest: Implement message(STATUS) output for 'ctest -S' scripts
Send status messages to the CTest HANDLER_OUTPUT log since they are part
of the script handler output.  This also ensures they appear inline with
other test command handler output.
2014-07-02 10:39:30 -04:00
Brad King 4c27c51f25 Merge topic 'launcher-limit-warnings-errors'
f7303131 CTest: Teach the launchers to honer the max warnings and errors
2014-06-25 10:53:09 -04:00
Bill Hoffman f730313143 CTest: Teach the launchers to honer the max warnings and errors
The ctest launcher code did not respect the number of errors and
warnings limits.  Limit the number of launcher report fragments that we
report in the final submission.
2014-06-25 10:53:34 -04:00
Bill Hoffman 3c5eac1fbb cmCTestMemCheckHandler: Fix coding style in this class
This class had a method that started with lower case, and also
was called without this->.
2014-06-25 10:51:45 -04:00
Brad King 6b05e03de4 Merge topic 'fix-valgrind-in-path'
58cc3c22 Fix ctest to allow valgrind to show up in the path name of a memcheck tool.
2014-06-16 08:54:50 -04:00
Brad King 8be1a711b2 Merge topic 'add_jacoco_coverage_parsing'
558c2190 CTest: Add Jacoco Coverage functionality
2014-06-13 15:45:03 -04:00
Bill Hoffman 58cc3c22ef Fix ctest to allow valgrind to show up in the path name of a memcheck tool.
For testing purposes CMake creates dummy memory checkers.  The dummy checkers
are in the CMake build tree. Before this change when the path contained the
string valgrind, such as CMake-valgrind, all the checkers were thought to
be valgrind, and this caused tests to fail.
2014-06-13 14:42:43 -04:00
Joseph Snyder 558c2190e8 CTest: Add Jacoco Coverage functionality
Add the ability to parse the XML output of the Jacoco tool.

Jacoco (www.eclemma.org/jacoco) is a Java coverage tool.
Add and integrate a class for the parser and
include a test which utilizes the new parser.
2014-06-12 10:38:19 -04:00
Nils Gladitz 887532f0f0 CTest: Fix combined inclusive/exclusive label regular expressions 2014-06-06 10:28:18 +02:00
Joseph Snyder 50daf239b0 CTest: Generalize Cobertura coverage format handling
Add support for Cobertura coverage files written by Java.

Add a test which uses the report from a Java run of Cobertura to calculate coverage.

In the documentation of CTEST_COVERAGE_COMMAND, give a sample .sh file to merge
the Cobertura .ser files and generate the XML report from the merged file.
2014-06-04 14:26:19 +00:00
Joseph Snyder a2822d3089 CTest: Rename coverage implementation for "Python" to "Cobertura"
The coverage.py tool writes out an XML that conforms to the Cobertura
Coverage tool standard.  Rename the cmParsePythonCoverage files to
instead be cmParseCoberturaCoverage.
2014-06-04 14:21:52 +00:00
Zach Mullen deee7c42a2 CTest: Fix Python coverage.py off-by-one error in results
The cobertura format uses line numbers indexed starting at 1, and CTest
uses a vector indexed starting at 0 to store them.
2014-05-28 12:25:50 -04:00
Roni Choudhury 88b3dcb125 CTest: Improve Python coverage.py source file search algorithm
If the coverage.py source file is not found in the source directory, the
build directory is first searched before raising an error.

This is necessary because it is a valid workflow to build a Python
package from source, then install this package to a virtualenv that
lives in the build directory.  Tests will run against this deployed
package and therefore the covered source files will be found in a
subdirectory of the build directory, and not anywhere in the source
directory.
2014-05-28 12:25:28 -04:00
Brad King 57151fba6a Merge topic 'cmake-gui-capture-output'
209cd475 Help: Add notes for topic 'cmake-gui-capture-output'
d7c69246 execute_process: Send stderr through cmSystemTools::Stderr
92ddf0c9 cmake-gui: Capture cmSystemTools::Stdout and Stderr
f52b5ae3 cmSystemTools: Add callback for Stderr
a9ae1d7a cmSystemTools: Simplify InterruptCallback definition
73b13f56 cmSystemTools: Rename ErrorCallback to MessageCallback
7577a542 cmCTestBuildAndTestHandler: Refactor output capture
b1b4d761 cmCTestBuildAndTestHandler: Refactor local loop var
2014-05-16 10:21:05 -04:00
Brad King f9871f541d Merge topic 'fix_mumps_coverage'
9ad07fbe CTest: Fix MUMPS coverage parsing and test
2014-05-16 10:21:03 -04:00
Joseph Snyder 9ad07fbeb8 CTest: Fix MUMPS coverage parsing and test
Fix the MUMPS coverage parser:

* Account for tabs after entry points

* Stop double incrementing lines that have explicit calls to the 0 line

* If a line has been previously marked as non executable, but then
  contains a count, increment it an extra one to push it back into
  the executable code set.

Add a custom routine and corresponding coverage files in the test case.
This file is smaller and has cmcov/mcov files that have data for only
that routine.
2014-05-16 10:16:40 -04:00
Brad King f52b5ae3c4 cmSystemTools: Add callback for Stderr
Factor a common callback type out of StdoutCallback.  Add an equivalent
StderrCallback.  While at it, use "size_t" for the data length instead
of "int".

Teach "ctest --build-and-test" to capture the Stderr callback because
output sent through it is part of the logical CMake process output.
2014-05-15 10:26:30 -04:00
Brad King 73b13f5641 cmSystemTools: Rename ErrorCallback to MessageCallback
Clarify that it is the callback for the cmSystemTools::Message API.
Rename callback clients too.
2014-05-15 10:24:21 -04:00
Brad King 7577a542df cmCTestBuildAndTestHandler: Refactor output capture
Use an RAII class to add and remove callbacks.
2014-05-15 10:19:29 -04:00
Brad King b1b4d761a1 cmCTestBuildAndTestHandler: Refactor local loop var 2014-05-15 10:16:48 -04:00
Brad King 65a71a5db2 Merge topic 'ctest-bad-generator'
54111286 ctest_build: Do not crash on bad generator name
2014-05-08 11:27:59 -04:00
Brad King 5411128645 ctest_build: Do not crash on bad generator name
If creation of the global generator fails, return early with an error
message instead of trying to use the generator and crashing.

Add a CTestTestBadGenerator test to cover this case.

Reported-by: Mathieu Malaterre <malat@debian.org>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747306
2014-05-07 11:02:16 -04:00
Volkan Gezer 9840320dff CTest: Add support for Intel coverage files
By default, Intel compiler coverage tools generate HTML files as
reports, but the option -txtlcov can be given to codecov to output a
coverage file with LCov format.

To use Intel coverage:

* build the project with coverage flags
* run the application
* run profmerge
* run codecov

The output file will be "build_dir/CodeCoverage/SRCFILEDIR.LCOV".

Ask users to compile with -prof-dir${BUILD_DIR} instead of searching
the entire build tree recursively to find coverage files.
2014-03-13 16:18:10 -04:00
Brad King cb8f87f622 Merge topic 'remove-c_str-calls'
3be265b3 Workaround Sun C++ 5.9 compiler crash
af8a1643 Remove c_str calls when using stream APIs.
21c573f6 Remove some c_str() calls.
2014-03-12 10:42:38 -04:00
Stephen Kelly af8a1643c1 Remove c_str calls when using stream APIs.
Use an ad-hoc clang tool for matching the calls which should be
ported.
2014-03-11 15:03:50 +01:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
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.
2014-03-11 15:03:50 +01:00
Volkan Gezer ef1c1153d3 CTest: Teach ctest_coverage() to read CTEST_COVERAGE_EXTRA_FLAGS
Use it to set the CoverageExtraFlags value just as COVERAGE_EXTRA_FLAGS
does in the CTest module for creating DartConfiguration.tcl.
2014-03-10 09:54:27 -04:00
Ben Boeckel 85fc9f26a7 stringapi: Command names 2014-03-08 13:05:39 -05:00
Ben Boeckel 1a1b737c99 stringapi: Use strings for generator names 2014-03-08 13:05:38 -05:00
Ben Boeckel b3bf31a548 stringapi: Miscellaneous char* parameters 2014-03-08 13:05:37 -05: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
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Ben Boeckel 3742bb0d32 stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Zack Galbreath 0a6f028067 CTest: notify user if gcov cannot be found
Emit an error message when we're performing coverage using
gcov and the gcov executable cannot be found.
2014-02-28 09:23:03 -05:00
Nils Gladitz 47702b8d49 CTest: exclude /showIncludes notes when scraping logs
My last related commit e5e3f3d4 (CTest: filter /showIncludes output from
ninja compile launcher, 2013-12-01) filtered /showIncludes messages from
the generated xml output but they also need to be filtered in
ScrapeLog().  Otherwise they are being detected as warnings when using
compilers withs english diagnostics.
2014-02-25 11:23:57 -05:00
Alex Neundorf 22e5c6c26b Kate: handle spaces in build dir
They need to be escaped in the json file... I'm quite
sure I tested this before, obviously I didn't test it
correctly.

Alex
2014-02-17 09:54:03 -05:00
Pedro Navarro 243cfc2f6f ctest_update: Handle P4 unknown revisions more robustly
Mark unknown revisions as such and fail instead of reporting revision 0.
Otherwise CTest reports massive file updates between revisions when the
server timeouts while trying to fetch the current revision number.
2014-01-22 08:33:33 -05:00
Rolf Eike Beer 3a0d164bb2 allow to mark a test as "Not Run" with a specific return code (#8466) 2014-01-14 23:57:40 +01:00
Clinton Stimpson 5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Nils Gladitz 7f0d4aff24 CTest: fix regressions introduced by the ctest-fix-run-serial topic
The first regression resulted in endless looping due to unrun test
dependencies. The second regression prioritized all tests with dependencies
in serial test runs.
2013-12-23 15:31:15 +01:00
Nils Gladitz e5e3f3d4ff CTest: filter /showIncludes output from ninja compile launcher
Teach "ctest --launch" a new "--filter-prefix" option.  Set it using
the CMAKE_CL_SHOWINCLUDES_PREFIX value with the Ninja generator.
2013-12-03 09:25:53 -05:00
Stephen Kelly 4fe963f656 Use new cmHasLiteralPrefix function 2013-11-21 20:53:15 +01:00
Brad King 4d1d7725f3 ctest: Teach --build-options to allow zero options
The --build-options option consumes all following arguments until either
--build-target or --test-command.  Fix the logic to allow this to be
zero options.
2013-11-18 11:30:49 -05:00