2010-12-14 16:26:35 +00:00
|
|
|
.PHONY: help test phpunit install coverage warning destructive parser noparser safe databaseless list-groups
|
|
|
|
|
.DEFAULT: warning
|
|
|
|
|
|
|
|
|
|
SHELL = /bin/sh
|
2013-01-10 03:12:42 +00:00
|
|
|
CONFIG_FILE = ${PWD}/suite.xml
|
2010-12-14 16:26:35 +00:00
|
|
|
PHP = php
|
|
|
|
|
PU = ${PHP} phpunit.php --configuration ${CONFIG_FILE} ${FLAGS}
|
|
|
|
|
|
|
|
|
|
all test: warning
|
|
|
|
|
|
|
|
|
|
warning:
|
2010-12-21 18:11:22 +00:00
|
|
|
@echo "Run 'make help' to get usage"
|
|
|
|
|
@echo ""
|
2010-12-14 16:26:35 +00:00
|
|
|
@echo "WARNING -- some tests are DESTRUCTIVE and will alter your wiki."
|
|
|
|
|
@echo "DO NOT RUN THESE TESTS on a production wiki."
|
|
|
|
|
@echo ""
|
2010-12-21 18:11:22 +00:00
|
|
|
@echo "Until the default tests are made non-destructive, you can run"
|
2010-12-14 16:26:35 +00:00
|
|
|
@echo "the destructive tests like so:"
|
2010-12-21 18:11:22 +00:00
|
|
|
@echo ""
|
|
|
|
|
@echo " make destructive"
|
2010-12-14 16:26:35 +00:00
|
|
|
@echo ""
|
|
|
|
|
@echo "Some tests are expected to be safe, you can run them with"
|
|
|
|
|
@echo ""
|
2010-12-21 18:11:22 +00:00
|
|
|
@echo " make safe"
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "You are recommended to run the tests with read-only credentials."
|
2010-12-14 16:26:35 +00:00
|
|
|
@echo ""
|
|
|
|
|
@echo "If you don't have a database running, you can still run"
|
2010-12-21 18:11:22 +00:00
|
|
|
@echo ""
|
|
|
|
|
@echo " make databaseless"
|
2010-12-14 16:26:35 +00:00
|
|
|
@echo ""
|
|
|
|
|
|
|
|
|
|
destructive: phpunit
|
|
|
|
|
|
|
|
|
|
phpunit:
|
|
|
|
|
${PU}
|
|
|
|
|
|
|
|
|
|
install:
|
2010-12-21 18:11:22 +00:00
|
|
|
./install-phpunit.sh
|
2010-12-14 16:26:35 +00:00
|
|
|
|
|
|
|
|
tap:
|
|
|
|
|
${PU} --tap
|
|
|
|
|
|
|
|
|
|
coverage:
|
2010-12-21 18:11:22 +00:00
|
|
|
${PU} --coverage-html ../../docs/code-coverage
|
2010-12-14 16:26:35 +00:00
|
|
|
|
|
|
|
|
parser:
|
|
|
|
|
${PU} --group Parser
|
2012-01-10 20:50:34 +00:00
|
|
|
parserfuzz:
|
|
|
|
|
@echo "******************************************************************"
|
|
|
|
|
@echo "* This WILL kill your computer by eating all memory AND all swap *"
|
|
|
|
|
@echo "* *"
|
|
|
|
|
@echo "* If you are on a production machine. ABORT NOW!! *"
|
|
|
|
|
@echo "* Press control+C to stop *"
|
|
|
|
|
@echo "* *"
|
|
|
|
|
@echo "******************************************************************"
|
|
|
|
|
${PU} --group Parser,ParserFuzz
|
2010-12-14 16:26:35 +00:00
|
|
|
noparser:
|
2012-01-10 20:50:34 +00:00
|
|
|
${PU} --exclude-group Parser,Broken,ParserFuzz,Stub
|
2010-12-14 16:26:35 +00:00
|
|
|
|
|
|
|
|
safe:
|
2012-01-10 20:50:34 +00:00
|
|
|
${PU} --exclude-group Broken,ParserFuzz,Destructive,Stub
|
2010-12-14 16:26:35 +00:00
|
|
|
|
|
|
|
|
databaseless:
|
2012-01-10 20:50:34 +00:00
|
|
|
${PU} --exclude-group Broken,ParserFuzz,Destructive,Database,Stub
|
2010-12-14 16:26:35 +00:00
|
|
|
|
2011-03-02 20:45:44 +00:00
|
|
|
database:
|
2012-01-10 20:50:34 +00:00
|
|
|
${PU} --exclude-group Broken,ParserFuzz,Destructive,Stub --group Database
|
2011-03-02 20:45:44 +00:00
|
|
|
|
2010-12-14 16:26:35 +00:00
|
|
|
list-groups:
|
|
|
|
|
${PU} --list-groups
|
|
|
|
|
|
|
|
|
|
help:
|
|
|
|
|
# Usage:
|
|
|
|
|
# make <target> [OPTION=value]
|
|
|
|
|
#
|
|
|
|
|
# Targets:
|
|
|
|
|
# phpunit (default) Run all the tests with phpunit
|
|
|
|
|
# install Install PHPUnit from phpunit.de
|
2010-12-21 18:11:22 +00:00
|
|
|
# tap Run the tests individually through Test::Harness's prove(1)
|
2010-12-14 16:26:35 +00:00
|
|
|
# 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 later.
|
|
|
|
|
# [no]parser Skip or only run Parser tests
|
|
|
|
|
#
|
2014-12-12 08:41:27 +00:00
|
|
|
# list-groups List available Tests groups.
|
2010-12-14 16:26:35 +00:00
|
|
|
#
|
|
|
|
|
# Options:
|
|
|
|
|
# CONFIG_FILE Path to a PHPUnit configuration file (default: suite.xml)
|
|
|
|
|
# FLAGS Additional flags to pass to PHPUnit
|
|
|
|
|
# PHP Path to php
|