Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-use coverage #187

Merged
merged 4 commits into from
Mar 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/bin/php-scoper.phar*.pubkey
/box.json
/build/
/clover.xml
/dist/
/fixtures/set004/scoper.inc.php
/fixtures/*/vendor
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ script:
make tc
make e2e
else
make tm
make tu
fi

deploy:
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ build: bin/php-scoper src vendor vendor-bin/box/vendor scoper.inc.php box.json
##---------------------------------------------------------------------------

test: ## Run all the tests
test: tu e2e
test: tc e2e

tu: ## Run PHPUnit tests
tu: vendor/bin/phpunit
Expand All @@ -57,7 +57,9 @@ tu: vendor/bin/phpunit
tc: ## Run PHPUnit tests with test coverage
tc: vendor/bin/phpunit vendor-bin/covers-validator/vendor
$(COVERS_VALIDATOR)
phpdbg -qrr -d zend.enable_gc=0 $(PHPUNIT) --coverage-html=dist/coverage --coverage-text
phpdbg -qrr -d zend.enable_gc=0 $(PHPUNIT) --coverage-html=dist/coverage --coverage-text --coverage-clover=clover.xml --coverage-xml=dist/infection-coverage/coverage-xml --log-junit=dist/infection-coverage/phpunit.junit.xml

php -d zend.enable_gc=0 $(PHPUNIT)

tm: ## Run Infection (Mutation Testing)
tm: vendor/bin/phpunit
Expand Down Expand Up @@ -152,18 +154,13 @@ e2e_019: bin/php-scoper.phar fixtures/set019-symfony-console/vendor
diff fixtures/set019-symfony-console/expected-output build/set019-symfony-console/output

e2e_020: ## Run end-to-end tests for the fixture set 020: Infection
e2e_020: bin/php-scoper.phar fixtures/set020-infection/vendor
e2e_020: bin/php-scoper.phar fixtures/set020-infection/vendor clover.xml
php -d zend.enable_gc=0 $(PHPSCOPER) add-prefix --working-dir=fixtures/set020-infection --output-dir=../../build/set020-infection --force --no-interaction --stop-on-failure
composer --working-dir=build/set020-infection dump-autoload

# Create coverage reports to be able to run Infection without running the tests
php -d zend.enable_gc=0 $(PHPUNIT) --coverage-clover=clover.xml --coverage-xml=dist/infection-coverage/coverage-xml --log-junit=dist/infection-coverage/phpunit.junit.xml

php fixtures/set020-infection/vendor/infection/infection/bin/infection --coverage=dist/infection-coverage > build/set020-infection/expected-output
php build/set020-infection/vendor/infection/infection/bin/infection --coverage=dist/infection-coverage > build/set020-infection/output

rm clover.xml

diff build/set020-infection/expected-output build/set020-infection/output

tb: ## Run Blackfire profiling
Expand Down Expand Up @@ -257,3 +254,6 @@ bin/php-scoper.phar: bin/php-scoper src vendor vendor-bin/box/vendor scoper.inc.

box.json:
cat box.json.dist | sed -E 's/\"key\": \".+\",//g' | sed -E 's/\"algorithm\": \".+\",//g' > box.json

clover.xml: src
$(MAKE) tc