Permalink
Browse files

Added code coverage generation to phake tests task.

  • Loading branch information...
1 parent 2beaf9b commit 8a70d82ce343b19f69206c631d99b26b18568fb5 @trq trq committed May 19, 2012
Showing with 10 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +9 −2 Phakefile
View
@@ -1,3 +1,4 @@
build
tests/log/*
+tests/coverage
vendor
View
@@ -17,10 +17,17 @@ group('dev', function() {
desc('Run the unit tests');
task('tests', function($args) {
+ $report = ' ';
+ if (isset($args['coverage'])) {
+ if (!is_dir('tests/coverage')) {
+ mkdir('tests/coverage');
+ }
+ $report = ' --coverage-html tests/coverage ';
+ }
if (isset($args['verbose'])) {
- system('phpunit --colors --debug --verbose --configuration tests/phpunit.xml');
+ system('phpunit' . $report . '--colors --debug --verbose --configuration tests/phpunit.xml');
} else {
- system('phpunit --colors --configuration tests/phpunit.xml');
+ system('phpunit' . $report . '--colors --configuration tests/phpunit.xml');
}
});

0 comments on commit 8a70d82

Please sign in to comment.