summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-12-24 14:19:36 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-12-24 14:19:36 (GMT)
commit460f90de2b9c9937cc423c44075698e5830133cb (patch)
treeb3790870e1b44c0d737a63d461cc8138a1ea6733
parent09ba0a0a31ccc019020092f8cd219e26fb44fa03 (diff)
downloadCMake-460f90de2b9c9937cc423c44075698e5830133cb.zip
CMake-460f90de2b9c9937cc423c44075698e5830133cb.tar.gz
CMake-460f90de2b9c9937cc423c44075698e5830133cb.tar.bz2
ENH: Fix coverage to actually work and add support for .NoDartCoverage
-rw-r--r--Source/cmCTest.cxx30
1 files changed, 28 insertions, 2 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d57c350..136f2d2 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1472,7 +1472,7 @@ int cmCTest::CoverageDirectory()
covlines[kk] = 0;
}
cov.m_Tested ++;
- covlines[kk] += count;
+ covlines[kk] ++;
//std::cout << "Tested[" << count << "] - ";
}
@@ -1496,6 +1496,19 @@ int cmCTest::CoverageDirectory()
{
continue;
}
+
+ // Check if we should ignore the directory
+ std::string coverage_dir = cmSystemTools::GetFilenamePath(cov.m_AbsolutePath.c_str());
+ coverage_dir += "/.NoDartCoverage";
+ if ( cmSystemTools::FileExists(coverage_dir.c_str()) )
+ {
+ if ( m_Verbose )
+ {
+ std::cout << "Ignore file: " << cov.m_FullPath.c_str() << std::endl;
+ }
+ continue;
+ }
+
if ( ccount == 100 )
{
local_end_time = ::CurrentTime();
@@ -1522,7 +1535,19 @@ int cmCTest::CoverageDirectory()
}
//std::cerr << "Final process of Source file: " << cit->first << std::endl;
-
+ cov.m_UnTested = 0;
+ cov.m_Tested = 0;
+ for ( cc = 0; cc < cov.m_Lines.size(); cc ++ )
+ {
+ if ( cov.m_Lines[cc] == 0 )
+ {
+ cov.m_UnTested ++;
+ }
+ else if ( cov.m_Lines[cc] > 0 )
+ {
+ cov.m_Tested ++;
+ }
+ }
std::ifstream ifile(cov.m_AbsolutePath.c_str());
if ( !ifile )
@@ -1539,6 +1564,7 @@ int cmCTest::CoverageDirectory()
std::vector<cmStdString> lines;
cmSystemTools::Split(buffer, lines);
delete [] buffer;
+
cfileoutput << "\t<File Name=\"" << cit->first << "\" FullPath=\""
<< cov.m_FullPath << "\">\n"
<< "\t\t<Report>" << std::endl;