[IE TESTS] Fix passrate in report (#3904)
* [IE TESTS] Fix passrate in report * add skip
This commit is contained in:
parent
573a13b252
commit
a3234593db
@ -68,12 +68,10 @@ struct PassRate {
|
||||
}
|
||||
|
||||
float getPassrate() const {
|
||||
if (passed == 0 && failed == 0) {
|
||||
return 0.;
|
||||
} else if (passed != 0 && failed == 0) {
|
||||
return 100.;
|
||||
if (passed + failed == 0) {
|
||||
return 0.f;
|
||||
} else {
|
||||
return (passed / (passed + failed)) * 100.;
|
||||
return passed * 100.f / (passed + failed + skipped);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -123,10 +123,10 @@ void TestEnvironment::TearDown() {
|
||||
for (const auto &it : stats) {
|
||||
std::string name = std::string(it.first.name) + "-" + std::to_string(it.first.version);
|
||||
pugi::xml_node entry = currentDeviceNode.append_child(name.c_str());
|
||||
entry.append_attribute("passed").set_value(std::to_string(it.second.passed).c_str());
|
||||
entry.append_attribute("failed").set_value(std::to_string(it.second.failed).c_str());
|
||||
entry.append_attribute("skipped").set_value(std::to_string(it.second.skipped).c_str());
|
||||
entry.append_attribute("passrate").set_value(std::to_string(it.second.getPassrate()).c_str());
|
||||
entry.append_attribute("passed").set_value(it.second.passed);
|
||||
entry.append_attribute("failed").set_value(it.second.failed);
|
||||
entry.append_attribute("skipped").set_value(it.second.skipped);
|
||||
entry.append_attribute("passrate").set_value(it.second.getPassrate());
|
||||
}
|
||||
bool result = doc.save_file(reportFileName.c_str());
|
||||
if (!result) {
|
||||
|
Loading…
Reference in New Issue
Block a user