Skip to content
This repository was archived by the owner on Oct 19, 2020. It is now read-only.

Commit 992da8e

Browse files
committed
Support for option --html in qa:cc
1 parent 8d07dbc commit 992da8e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Command/CodeCoverage/CodeCoverage.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ protected function configure()
4242
'Fail if covered lines is less than the value.',
4343
80
4444
)
45+
->addOption(
46+
'html',
47+
null,
48+
InputOption::VALUE_REQUIRED,
49+
'Dump HTML format of coverage'
50+
)
4551
->setDescription($this->description);
4652
}
4753

@@ -74,6 +80,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
7480
mkdir('coverage');
7581

7682
$cmd = $paratest.$source.' --colors --coverage-php=coverage/result.cov';
83+
84+
if($input->getOption('html')){
85+
$cmd = $paratest.$source.' --colors --coverage-html=coverage';
86+
}
87+
7788
$output->writeln('<info>Command: '.$cmd.'</>');
7889
$process = new Process($cmd);
7990
$process->setTimeout(3600);
@@ -86,6 +97,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
8697
return $exitCode;
8798
}
8899

100+
if($input->getOption('html')){
101+
$output->writeln('Open the file ./coverage/index.html');
102+
return 0;
103+
}
104+
89105
$cov = $util->checkBinary('phpcov');
90106
$cmd = $cov.' merge --text --show-colors coverage';
91107
$style->newLine();

0 commit comments

Comments
 (0)