Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're...
[lhc/web/wiklou.git] / tests / phpunit / Makefile
1 .PHONY: help test phpunit install coverage warning destructive parser noparser safe databaseless list-groups
2 .DEFAULT: warning
3
4 SHELL = /bin/sh
5 CONFIG_FILE = $(shell pwd)/suite.xml
6 PHP = php
7 PU = ${PHP} phpunit.php --configuration ${CONFIG_FILE} ${FLAGS}
8
9 all test: warning
10
11 warning:
12 # Use 'make help' to get usage
13 @echo "WARNING -- some tests are DESTRUCTIVE and will alter your wiki."
14 @echo "DO NOT RUN THESE TESTS on a production wiki."
15 @echo ""
16 @echo "Until the default suites are made non-destructive, you can run"
17 @echo "the destructive tests like so:"
18 @echo " make destructive"
19 @echo ""
20 @echo "Some tests are expected to be safe, you can run them with"
21 @echo " make safe"
22 @echo ""
23 @echo "You are recommended to run them with read-only credentials, though."
24 @echo ""
25 @echo "If you don't have a database running, you can still run"
26 @echo " make databaseless"
27 @echo ""
28
29 destructive: phpunit
30
31 phpunit:
32 ${PU}
33
34 install:
35 php install-phpunit.sh
36
37 tap:
38 ${PU} --tap
39
40 coverage:
41 ${PU} --coverage-html ../../../docs/code-coverage
42
43 parser:
44 ${PU} --group Parser
45
46 noparser:
47 ${PU} --exclude-group Parser,Broken
48
49 safe:
50 ${PU} --exclude-group Broken,Destructive
51
52 databaseless:
53 ${PU} --exclude-group Broken,Destructive,Database
54
55 list-groups:
56 ${PU} --list-groups
57
58 help:
59 # Usage:
60 # make <target> [OPTION=value]
61 #
62 # Targets:
63 # phpunit (default) Run all the tests with phpunit
64 # install Install PHPUnit from phpunit.de
65 # tap Run the tests individually through Test::Harness's prove(1)
66 # help You're looking at it!
67 # coverage Run the tests and generates an HTML code coverage report
68 # You will need the Xdebug PHP extension for the later.
69 # [no]parser Skip or only run Parser tests
70 #
71 # list-groups List availabe Tests groups.
72 #
73 # Options:
74 # CONFIG_FILE Path to a PHPUnit configuration file (default: suite.xml)
75 # FLAGS Additional flags to pass to PHPUnit
76 # PHP Path to php