summaryrefslogtreecommitdiffstats
path: root/tester/covoar/ReportsBase.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tester/covoar/ReportsBase.cc')
-rw-r--r--tester/covoar/ReportsBase.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index d401bdd..b9dcc51 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -14,6 +14,10 @@
#include "ReportsText.h"
#include "ReportsHtml.h"
+#if WIN32
+#include <io.h>
+#endif
+
namespace Coverage {
ReportsBase::ReportsBase( time_t timestamp ):
@@ -35,7 +39,11 @@ FILE* ReportsBase::OpenFile(
std::string file;
// Create the output directory if it does not already exist
+#if WIN32
+ sc = _mkdir( outputDirectory );
+#else
sc = mkdir( outputDirectory,0755 );
+#endif
if ( (sc == -1) && (errno != EEXIST) ) {
fprintf(stderr, "Unable to create output directory %s\n", outputDirectory);
return NULL;
@@ -211,7 +219,7 @@ void ReportsBase::WriteAnnotatedReport(
if ( itr->isInstruction ) {
if (!theCoverageMap->wasExecuted( itr->address - bAddress )){
- annotation = "<== NOT EXECUTED";
+ annotation = "<== NOT EXECUTED";
state = A_NEVER_EXECUTED;
id = theRanges->getId( itr->address );
} else if (theCoverageMap->isBranch( itr->address - bAddress )) {
@@ -230,8 +238,8 @@ void ReportsBase::WriteAnnotatedReport(
sprintf( textLine, "%-70s", itr->line.c_str() );
line = textLine + annotation;
-
- PutAnnotatedLine( aFile, state, line, id);
+
+ PutAnnotatedLine( aFile, state, line, id);
}
AnnotatedEnd( aFile );
@@ -253,7 +261,7 @@ void ReportsBase::WriteBranchReport(
unsigned int count;
bool hasBranches = true;
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
+ if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
(BranchInfoAvailable == false) )
hasBranches = false;
@@ -263,7 +271,7 @@ void ReportsBase::WriteBranchReport(
return;
// If no branches were found of branch coverage is not supported
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
+ if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
(BranchInfoAvailable == false) ) {
PutNoBranchInfo(report);
@@ -359,7 +367,7 @@ void ReportsBase::WriteCoverageReport(
*/
void ReportsBase::WriteSizeReport(
const char* const fileName
-)
+)
{
Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
FILE* report;
@@ -475,7 +483,7 @@ void ReportsBase::WriteSummaryReport(
"Uncovered ranges found : %d\n",
SymbolsToAnalyze->getNumberUncoveredRanges()
);
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
+ if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
(BranchInfoAvailable == false) ) {
fprintf( report, "No branch information available\n" );
} else {
@@ -514,7 +522,7 @@ void GenerateReports()
time_t timestamp;
-
+
timestamp = time(NULL); /* get current cal time */
reports = new ReportsText(timestamp);
reportList.push_back(reports);