Commit Graph

111 Commits

Author SHA1 Message Date
Joseph Snyder 220e81345b CTest: Add Javascript coverage parser
Add a coverage parser for the Blanket.js library using the JSON output of
the mocha.js test runner.

Add a test for the new parser.
2014-10-29 11:27:11 -04:00
Brad King ae5686f8d0 Merge topic 'remove-redundant-c_str'
cc1139cc strings: Remove redundant calls to std::string::c_str()
2014-10-21 15:08:01 -04:00
Joseph Snyder 5c31c3e4eb CTest: Add code coverage parser for Pascal/Delphi
Add a class to parse the HTML output of the Delphi-code-coverage tool

 http://code.google.com/p/delphi-code-coverage/

Add a test for the new parser.
2014-10-21 15:02:20 -04:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02: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
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
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
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
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
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
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 eb1d6cef2f CTest: clean TargetDirs between unrelated coverage runs (issue 13143) 2013-10-29 08:13:21 +01:00
Patrick Reynolds d0ec3a01a6 Adding support for the Python coverage.py tool.
This assumes that coverage.py has been run in such a way to produce its
standard XML output. This uses the Cobertura schema and should be somewhat
generalizable.
2013-10-08 09:20:30 -04:00
David Cole 61ace1df26 CTest: Coverage handler: expect certain output lines from gcov 4.7 (#13657)
And do not report them as errors.
2012-12-10 17:03:57 -05:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
David Cole 8e9101a0cb Merge topic 'mumps_coverage'
c806b23 CDash now supports lots of files in coverage. So, show all files.
761d931 Do not try to run bullseye coverage if COVFILE env is empty.
5b69ce4 Update test data to match new coverage format.
1b418f1 Change GT.M Coverage Parser global
b0c07a1 Disable bullseye coverage for mumps coverage test.
0a169e6 Remove uncovered files from cache coverage data.
a7abf5e Add ability to specify more than one package directory or coverage directory.
220afca Use <TARGET_FILE> expression to run ctest so it works with Xcode and VS IDE.
62f6bce Use a script to run the test because WORKING_DIRECTORY is not in 2.8.2.
f5c5db0 Fix some warnings and a bug where it went past the length of a vector.
7955e99 Add support for Cache coverage.
a86cd33 Add virutal destructor to silence warning.
319eeb0 Add test for mumps coverage. Also refactor code to prepare for cache coverage.
72210c2 Fix line length.
dd07161 Fix warning about char* instead of const char*.
e6412e0 Add support to ctest for GTM mumps coverage.
2012-05-17 14:58:54 -04:00
Bill Hoffman c806b23cfe CDash now supports lots of files in coverage. So, show all files.
Prior to this commit the mumps coverage only showed files that
had at least one line of coverage. Now 0% covered files are shown
as well.
2012-05-11 15:22:25 -04:00
Bill Hoffman 761d93129f Do not try to run bullseye coverage if COVFILE env is empty. 2012-05-08 14:47:13 -04:00
David Cole 56f499dcef CTest: Modify reg ex so it also works with gcov 4.7 output (#13121) 2012-05-03 17:08:19 -04:00
Bill Hoffman 7955e995ec Add support for Cache coverage.
This adds support for Cache coverage parsing. A test is added
that does a basic run of the coverage on a small bit of data.
2012-05-01 17:00:43 -04:00
Bill Hoffman 319eeb0247 Add test for mumps coverage. Also refactor code to prepare for cache coverage.
Add a simple test to make sure the GTM mumps coverage is working.
Also refactor the code so that cache coverage can be added.
2012-05-01 13:35:07 -04:00
Bill Hoffman 72210c2662 Fix line length. 2012-04-26 08:33:27 -04:00
Bill Hoffman e6412e084e Add support to ctest for GTM mumps coverage. 2012-04-25 17:04:28 -04:00
Brad King 3247d63abb ctest_coverage: Save/restore LC_ALL around gcov (#13136)
Commit ffbe61bb (make sure english is used for output of gcov, 2008-05-10)
taught ctest_coverage to set LC_ALL=POSIX to get English output from gcov.
Use the more portable value LC_ALL=C and restore the original value when
finished.
2012-04-16 08:48:16 -04:00
Rolf Eike Beer 58d75e22ae CTest: mark all gcov covered files as covered
Even if there are no lines covered in the file the gcov coverage report still
contains valueable information, the amount of uncovered lines and which exactly
they are. Set 'Covered="true"' for files we have a gcov report for even if they
have no lines covered. Otherwise CDash will neither show the uncovered line
count nor the detailed coverage report for this file.

When CTEST_EXTRA_COVERAGE_GLOB was used to collect otherwise uncovered files
'Covered="true"' was unconditionally set, so this can't be worse here.
2012-02-15 21:45:30 +01:00
David Cole 2f309cba45 CTest: Add COVERAGE_EXTRA_FLAGS cache variable (#12490)
COVERAGE_EXTRA_FLAGS is a space separated value of extra flags
that will be passed to gcov when ctest's coverage handler invokes
gcov to do coverage analysis.

Map to CoverageExtraFlags in the CTest ini file. Use default value
of "-l" to match the coverage handler's earlier behavior from ctest
2.8.4 and earlier. The fix for related issue #11717 had added a " -p"
which was the cause of both #12415 and #12490. Here, we revert that
change to the default value, so -p is no longer there by default.
The people that care to add -p may do so in their own build trees
by appending " -p" to the new cache variable COVERAGE_EXTRA_FLAGS.
2011-10-22 11:01:58 -04:00
Marco Craveiro 6e02a3b2bf CTest: Use the gcov --preserve-paths flag (#11717)
To avoid name clashes.

Before this commit, name clashes can occur when invoking gcov on a
project that uses the same file name in different directories. The
--preserve-paths flag ensures all file names have a complete path,
avoiding name clashes.
2011-02-09 16:04:15 -05:00
Kai Wasserbäch 9203e9187e Fix spelling errors reported by Lintian.
During a Lintian run on the binary packages of CMake in Debian I was
notified of many spelling mistakes.
2010-07-13 09:41:37 -04:00
Zach Mullen 9d6567a269 Extra coverage glob should subtract the explicitly defined excluded files 2010-06-11 14:17:00 -04:00
Bill Hoffman 1d4e121d9c Add php coverage to ctest. 2010-05-25 09:23:25 -04:00
Zach Mullen 38cabcd9ff Fix shadowed local warning in coverage handler 2010-05-12 09:37:43 -04:00
Zach Mullen 231cbbef80 Change coverage globbing mechanism to resolve paths earlier 2010-05-07 11:00:21 -04:00
Zach Mullen 6ea9213244 Coverage glob should search in Source dir 2010-04-23 11:22:54 -04:00
Zach Mullen 7049dff85a Implement extra coverage globbing 2010-04-23 09:20:53 -04:00
David Cole 4439f17b20 Fix issue #5668 - use CollapseFullPath when determining if covered file is within source or binary tree. Allows gcc/gcov coverage analysis using MinGW on Windows. 2009-10-12 14:51:54 -04:00
Alexander Neundorf b3040beb41 fix two more warnings from icpc
asfGlob and abfGlob were there since rev 1.3 of this file (Oct 17th 2004) and unused since
then, so remove them

Alex
2009-10-04 11:40:02 -04:00
David Cole 44bcba7461 Fix warnings in CMake source code. Suppress rampant warnings emanating from Qt files. 2009-10-01 16:47:08 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
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.
2009-09-28 11:43:28 -04:00
Brad King 589b4265a6 BUG: Do not produce empty coverage log files
This moves the filtering of source files to before the production of
coverage log files in order to avoid producing a CoverageLog-*.xml file
for 100 filtered-out files.  The change greatly reduces the number of
submitted coverage files when using label filters.
2009-03-11 13:31:40 -04:00
Brad King 5bc17136a3 BUG: Do not carry over file list between coverage
When performing multiple ctest_coverage() commands in a single CTest
instance we need to clear the list of CoverageLog-*.xml files for
submission.  Otherwise if the current coverage run produces fewer log
files than the previous run CTest will attempt to submit non-existing
files.
2009-03-11 13:31:33 -04:00
Brad King f3e713ba65 BUG: Avoid duplicate CTest coverage submission
This teaches ctest_coverage() to remove any existing CoverageLog-*.xml
when it creates new coverage results.  Otherwise the next ctest_submit()
may submit old coverage log files which unnecessarily.
2009-03-11 12:03:47 -04:00
Brad King 1d96c943e0 ENH: Efficiently filter CTest coverage by label
This teaches CTest to process coverage information only for object files
in targets containing labels of interest.  This change also improves
loading of global coverage information by globbing only in each target
support directory instead of the entire build tree.
2009-03-09 12:19:56 -04:00
Brad King a86e81c358 ENH: Generate a central list of target directories
This generalizes the previous CMakeFiles/LabelFiles.txt created at the
top of the build tree to a CMakeFiles/TargetDirectories.txt file.  It
lists the target support directories for all targets in the project.
Labels can still be loaded by looking for Labels.txt files in each
target directory.
2009-03-09 12:19:27 -04:00
Brad King 91a8569648 ENH: Teach ctest_coverage to filter with LABELS
This teaches ctest_coverage() to report only coverage of files labeled
with at least one label given by a new LABELS option.
2009-03-02 15:33:18 -05:00
Brad King 3078fef81c BUG: Fix coverage label reports for Bullseye
This teaches CTest to report Labels elements in the Coverage.xml file
for Bullseye coverage results.
2009-03-02 15:33:03 -05:00
Brad King c4596605df BUG: Fix coverage handler initialization
This resets coverage handler internal state on initialization so that
multiple coverage runs are independent.
2009-03-02 15:32:59 -05:00
Brad King 70b1ed2548 ENH: Teach CTest to put labels in coverage results
This teaches CTest to include source file labels in coverage dashboard
submissions.  The labels for each source are the union of the LABELS
property from the source file and all the targets in which it is built.
2009-02-13 15:17:06 -05:00
Brad King 5be7846277 STYLE: Remove unused variable 2009-02-13 15:16:58 -05:00
Brad King dc13914cd6 ENH: Create cmXMLSafe to help escapes in XML
This class provides easy syntax to efficiently insert blocks of data
into XML documents with proper escapes.  It replaces the old
cmCTest::MakeXMLSafe and cmSystemTools::MakeXMLSafe methods which
allocated extra memory instead of directly streaming the data.
2009-02-05 16:31:37 -05:00