Skip to content
Snippets Groups Projects
Commit 59c58c14 authored by bdr7fv's avatar bdr7fv
Browse files

coverage.cpp, prints out to stdout the total number of non-plt funcs...

coverage.cpp, prints out to stdout the total number of non-plt funcs (functions that don't begin with '.') that exceed 50% coverage. 



Former-commit-id: a0b76fa27864a094ab3d271f71523bc483bee40f
parent e7f815e1
No related branches found
No related tags found
No related merge requests found
......@@ -136,7 +136,13 @@ void coverage::print_coverage_for_file(file_coverage *fc, FileIR_t *fileirp, ofs
covered_ins++;
}
out_file<<fc->file<<"+"<<func->GetName()<<" "<<((double)covered_ins)/((double)total_ins)<<" "<<covered_ins<<" "<<total_ins<<endl;
double cov_percent = ((double)covered_ins)/((double)total_ins);
string func_name = func->GetName();
if(func_name.length() > 1 && func_name[0] != '.' && cov_percent >= 0.5)
majority_coverage++;
out_file<<fc->file<<"+"<<func->GetName()<<" "<<cov_percent<<" "<<covered_ins<<" "<<total_ins<<endl;
}
}
......@@ -144,6 +150,9 @@ void coverage::print_coverage_for_file(file_coverage *fc, FileIR_t *fileirp, ofs
void coverage::print_function_coverage_file(libIRDB::VariantID_t *vidp,std::ofstream &out_file)
{
assert(vidp);
majority_coverage = 0;
for(set<File_t*>::iterator it=vidp->GetFiles().begin();
it!=vidp->GetFiles().end();
++it
......@@ -166,4 +175,5 @@ void coverage::print_function_coverage_file(libIRDB::VariantID_t *vidp,std::ofst
delete fileirp;
}
cout<<"Coverage Summary: Non-PLT Functions with 50% coverage or greater: "<<majority_coverage<<endl;
}
......@@ -16,6 +16,7 @@ class coverage
{
private:
std::map<std::string,file_coverage> coverage_map;
int majority_coverage;
file_coverage* find_file_coverage(std::string url);
void print_coverage_for_file(file_coverage *fc, libIRDB::FileIR_t *fileirp, std::ofstream &out_file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment