fail count

This commit is contained in:
James 2020-02-10 18:01:10 +00:00
parent 1d2ca239e7
commit afc4c618f4

View File

@ -7,7 +7,7 @@ final class Poster{
private $report; private $report;
private $level=0; private $level=0;
private $total_fail=0; private $failCount=0;
function __construct($xml_path){ function __construct($xml_path){
$this->xml = simplexml_load_file($xml_path); $this->xml = simplexml_load_file($xml_path);
@ -23,13 +23,17 @@ final class Poster{
// create the issue // create the issue
if(trim($this->report)){ if(trim($this->report)){
$issue=$this->repo->createIssue([ $issue=$this->repo->createIssue([
'title'=>"$title ({$this->total_fail} fail)", 'title'=>"$title ({$this->failCount} fail)",
'body'=>$this->report 'body'=>$this->report
]); ]);
} }
} }
public function getFailCount(){
return $this->failCount;
}
private function process($item){ private function process($item){
$this->level++; $this->level++;
if(isset($item->testcase)){ if(isset($item->testcase)){
@ -41,7 +45,7 @@ final class Poster{
if(trim($v)) $failmsg.="```plain\n$v\n```\n"; if(trim($v)) $failmsg.="```plain\n$v\n```\n";
} }
if($failmsg){ if($failmsg){
$this->total_fail++; $this->failCount++;
$this->report.=" * [ ] {$att->name[0]} $failmsg\n"; $this->report.=" * [ ] {$att->name[0]} $failmsg\n";
}else{ }else{
$this->report.=" * [x] {$att->name[0]}\n"; $this->report.=" * [x] {$att->name[0]}\n";