In 8 years, this is the first time I see this directory exists and that there is a Makefile that would write to it. I don't know if anyone uses that, but PHPUnit auto-creates this directory as needed. Hence, it need not exist ahead of time. It seems most contributors generate code coverage by invoking PHPUnit directory, which requires a path to be specified. Per https://mediawiki.org/wiki/Manual:PHP_unit_testing/Code_coverage, this tends to be docs/coverage, not docs/code-coverage. Change the Makefile to write there as well, as better example, and also add it to gitignore. Change-Id: I0a4cf716ea9b7fae89c282945b160b0dc7b2d02f
78 lines
2 KiB
Makefile
78 lines
2 KiB
Makefile
.PHONY: help test phpunit coverage warning destructive parser noparser safe databaseless list-groups
|
|
.DEFAULT: warning
|
|
|
|
SHELL = /bin/sh
|
|
CONFIG_FILE = ${PWD}/suite.xml
|
|
PHP = php
|
|
PU = ${PHP} phpunit.php --configuration ${CONFIG_FILE} ${FLAGS}
|
|
|
|
all test: warning
|
|
|
|
warning:
|
|
@echo "Run 'make help' to get usage"
|
|
@echo ""
|
|
@echo "WARNING -- some tests are DESTRUCTIVE and will alter your wiki."
|
|
@echo "DO NOT RUN THESE TESTS on a production wiki."
|
|
@echo ""
|
|
@echo "Until the default tests are made non-destructive, you can run"
|
|
@echo "the destructive tests like so:"
|
|
@echo ""
|
|
@echo " make destructive"
|
|
@echo ""
|
|
@echo "Some tests are expected to be safe, you can run them with"
|
|
@echo ""
|
|
@echo " make safe"
|
|
@echo ""
|
|
@echo "You are recommended to run the tests with read-only credentials."
|
|
@echo ""
|
|
@echo "If you don't have a database running, you can still run"
|
|
@echo ""
|
|
@echo " make databaseless"
|
|
@echo ""
|
|
|
|
destructive: phpunit
|
|
|
|
phpunit:
|
|
${PU}
|
|
|
|
tap:
|
|
${PU} --tap
|
|
|
|
coverage:
|
|
${PU} --coverage-html ../../docs/coverage
|
|
|
|
parser:
|
|
${PU} --group Parser
|
|
noparser:
|
|
${PU} --exclude-group Parser,Broken,Stub
|
|
|
|
safe:
|
|
${PU} --exclude-group Broken,Destructive,Stub
|
|
|
|
databaseless:
|
|
${PU} --exclude-group Broken,Destructive,Database,Stub
|
|
|
|
database:
|
|
${PU} --exclude-group Broken,Destructive,Stub --group Database
|
|
|
|
list-groups:
|
|
${PU} --list-groups
|
|
|
|
help:
|
|
# Usage:
|
|
# make <target> [OPTION=value]
|
|
#
|
|
# Targets:
|
|
# phpunit (default) Run all the tests with phpunit
|
|
# tap Run the tests individually through Test::Harness's prove(1)
|
|
# help You're looking at it!
|
|
# coverage Run the tests and generates an HTML code coverage report
|
|
# You will need the Xdebug PHP extension for the latter.
|
|
# [no]parser Skip or only run Parser tests
|
|
#
|
|
# list-groups List available Tests groups.
|
|
#
|
|
# Options:
|
|
# CONFIG_FILE Path to a PHPUnit configuration file (default: suite.xml)
|
|
# FLAGS Additional flags to pass to PHPUnit
|
|
# PHP Path to php
|