Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
ace5f90d
Commit
ace5f90d
authored
Oct 17, 2004
by
Andy Cedilnik
Browse files
BUG: Fix output to match the Dart output
parent
b40cd9fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/CTest/cmCTestCoverageHandler.cxx
View file @
ace5f90d
...
...
@@ -50,17 +50,19 @@ bool cmCTestCoverageHandler::StartLogFile(std::ofstream& covLogFile, int logFile
return
false
;
}
std
::
string
local_start_time
=
m_CTest
->
CurrentTime
();
m_CTest
->
StartXML
(
covLogFile
);
covLogFile
<<
"<CoverageLog>"
<<
std
::
endl
<<
"
\t
<StartDateTime>"
<<
local_start_time
<<
"</StartDateTime>"
<<
std
::
endl
;
return
true
;
}
//----------------------------------------------------------------------
void
cmCTestCoverageHandler
::
Stop
LogFile
(
std
::
ofstream
&
ostr
,
int
logFileCount
)
void
cmCTestCoverageHandler
::
End
LogFile
(
std
::
ofstream
&
ostr
,
int
logFileCount
)
{
std
::
string
local_end_time
=
m_CTest
->
CurrentTime
();
ostr
<<
"
\t
<EndDateTime>"
<<
local_end_time
<<
"</EndDateTime>"
<<
std
::
endl
<<
"</CoverageLog>"
<<
std
::
endl
;
m_CTest
->
EndXML
(
ostr
);
char
covLogFilename
[
1024
];
sprintf
(
covLogFilename
,
"CoverageLog-%d.xml"
,
logFileCount
);
std
::
cout
<<
"Close file: "
<<
covLogFilename
<<
std
::
endl
;
...
...
@@ -276,7 +278,6 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
{
std
::
cout
<<
" in file: "
<<
fname
<<
std
::
endl
;
}
singleFileCoverageVector
cov
;
std
::
ifstream
ifile
(
fname
.
c_str
());
if
(
!
ifile
)
{
...
...
@@ -356,7 +357,7 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
if
(
cnt
==
100
)
{
cnt
=
0
;
this
->
Stop
LogFile
(
covLogFile
,
logFileCount
);
this
->
End
LogFile
(
covLogFile
,
logFileCount
);
logFileCount
++
;
if
(
!
this
->
StartLogFile
(
covLogFile
,
logFileCount
)
)
{
...
...
@@ -396,7 +397,8 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
const
singleFileCoverageVector
&
fcov
=
fileIterator
->
second
;
covLogFile
<<
"
\t
<File Name=
\"
"
<<
m_CTest
->
MakeXMLSafe
(
fileName
.
c_str
())
<<
"
\"
FullPath=
\"
"
<<
m_CTest
->
MakeXMLSafe
(
fileIterator
->
first
)
<<
"
\"
>"
<<
std
::
endl
<<
"
\"
FullPath=
\"
"
<<
m_CTest
->
MakeXMLSafe
(
m_CTest
->
GetShortPathToFile
(
fileIterator
->
first
.
c_str
()))
<<
"
\"
>"
<<
std
::
endl
<<
"
\t\t
<Report>"
<<
std
::
endl
;
std
::
ifstream
ifs
(
fullFileName
.
c_str
());
...
...
@@ -449,7 +451,8 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
covLogFile
<<
"
\t\t
</Report>"
<<
std
::
endl
<<
"
\t
</File>"
<<
std
::
endl
;
covSumFile
<<
"
\t
<File Name=
\"
"
<<
m_CTest
->
MakeXMLSafe
(
fileName
)
<<
"
\"
FullPath=
\"
"
<<
m_CTest
->
MakeXMLSafe
(
fullFileName
)
<<
"
\"
FullPath=
\"
"
<<
m_CTest
->
MakeXMLSafe
(
m_CTest
->
GetShortPathToFile
(
fullFileName
.
c_str
()))
<<
"
\"
Covered=
\"
"
<<
(
cmet
>
0
?
"true"
:
"false"
)
<<
"
\"
>
\n
"
<<
"
\t\t
<LOCTested>"
<<
tested
<<
"</LOCTested>
\n
"
<<
"
\t\t
<LOCUnTested>"
<<
untested
<<
"</LOCUnTested>
\n
"
...
...
@@ -464,7 +467,7 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
<<
"
\t
</File>"
<<
std
::
endl
;
cnt
++
;
}
this
->
Stop
LogFile
(
covLogFile
,
logFileCount
);
this
->
End
LogFile
(
covLogFile
,
logFileCount
);
int
total_lines
=
total_tested
+
total_untested
;
float
percent_coverage
=
100
*
SAFEDIV
(
static_cast
<
float
>
(
total_tested
),
...
...
Source/CTest/cmCTestCoverageHandler.h
View file @
ace5f90d
...
...
@@ -50,7 +50,7 @@ private:
bool
ShouldIDoCoverage
(
const
char
*
file
,
const
char
*
srcDir
,
const
char
*
binDir
,
bool
verbose
);
bool
StartLogFile
(
std
::
ofstream
&
ostr
,
int
logFileCount
);
void
Stop
LogFile
(
std
::
ofstream
&
ostr
,
int
logFileCount
);
void
End
LogFile
(
std
::
ofstream
&
ostr
,
int
logFileCount
);
struct
cmCTestCoverage
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment