diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-12-15 17:02:13 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-12-15 17:02:13 (GMT) |
commit | 0c72acd8126a65147b024f524d849a80c90c8ebf (patch) | |
tree | 6429438a396110044545706802c1a17a47dd3cd8 | |
parent | c9e9e8d1211f0491dfccb6ad7fc4b9dbc49f116b (diff) | |
download | CMake-0c72acd8126a65147b024f524d849a80c90c8ebf.zip CMake-0c72acd8126a65147b024f524d849a80c90c8ebf.tar.gz CMake-0c72acd8126a65147b024f524d849a80c90c8ebf.tar.bz2 |
ENH: fix for gcc 3.1
-rw-r--r-- | Source/cmCTest.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 30511d3..2a003dc 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1247,7 +1247,8 @@ int cmCTest::CoverageDirectory() for ( cc = 0; cc < files.size(); cc ++ ) { - std::string command = coverageCommand + " -l \"" + files[cc] + "\""; + std::string command = coverageCommand + " -o \"" + files[cc] + "\""; + command += " -l \"" + files[cc] + "\""; std::string output; int retVal = 0; //std::cout << "Run gcov on " << files[cc] << std::flush; @@ -1282,11 +1283,16 @@ int cmCTest::CoverageDirectory() for ( cc = 0; cc < cfiles.size(); cc ++ ) { std::string& fname = cfiles[cc]; - //std::cout << "File: " << fname << std::endl; + // std::cout << "File: " << fname << std::endl; if ( strcmp(fname.substr(fname.size()-5, 5).c_str(), ".gcov") == 0 ) { files.push_back(fname); std::string::size_type pos = fname.find(".da."); + std::string::size_type pos2 = fname.find(".da##"); + if(pos2 != fname.npos) + { + pos = pos2+1; + } if ( pos != fname.npos ) { pos += 4; @@ -1302,10 +1308,10 @@ int cmCTest::CoverageDirectory() } } } - for ( cc = 0; cc < files.size(); cc ++ ) - { - //std::cout << "File: " << files[cc] << std::endl; - } + // for ( cc = 0; cc < files.size(); cc ++ ) + // { + // std::cout << "File: " << files[cc] << std::endl; + // } std::map<std::string, std::vector<std::string> >::iterator it; cmCTest::tm_CoverageMap coverageresults; @@ -1323,7 +1329,7 @@ int cmCTest::CoverageDirectory() for ( it = sourcefiles.begin(); it != sourcefiles.end(); it ++ ) { - //std::cerr << "Source file: " << it->first << std::endl; + // std::cerr << "Source file: " << it->first << std::endl; std::vector<std::string> &gfiles = it->second; for ( cc = 0; cc < gfiles.size(); cc ++ ) { @@ -1377,12 +1383,15 @@ int cmCTest::CoverageDirectory() } cov.m_Show = true; } + // std::cerr << "number of lines " << lines.size() << "\n"; for ( cc = 0; cc < lines.size(); cc ++ ) { std::string& line = lines[cc]; + //std::cerr << line << "\n"; std::string sub = line.substr(0, strlen(" ######")); int count = atoi(sub.c_str()); - if ( sub.compare(" ######") == 0 ) + if ( sub.compare(0, strlen(" #####"), " #####") == 0 + || sub.compare(" ######") == 0 ) { if ( covlines[cc] == -1 ) { |