aboutsummaryrefslogtreecommitdiffstats
path: root/build.xml
blob: 0f574507260a2af6399a87b64d6d9d9dad56d330 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>

<project name="friendica" default="test">
	<!-- set up include directories, this is necessary for the tests to work -->
	<php>
		set_include_path(
					get_include_path() . PATH_SEPARATOR
					. 'include' . PATH_SEPARATOR 
					. 'library' . PATH_SEPARATOR 
					. 'library/phpsec' . PATH_SEPARATOR 
					. '.' );
	</php>
	
	<!-- ====================================================== -->
	<!-- Target: clean-test -->
	<!-- deletes directories with old test reports -->
	<!-- ====================================================== -->
	<target name="clean-test">
		<delete dir="report" />
	</target>
	
	<!-- ====================================================== -->
	<!-- Target: prepare-test -->
	<!-- creates directories for test reports -->
	<!-- ====================================================== -->
	<target name="prepare-test" depends="clean-test">
		<mkdir dir="report" />
	</target>
	
	<!-- =================================== -->
	<!-- Target: test -->
	<!-- this target runs all test files -->
	<!-- =================================== -->
	<target name="test" depends="prepare-test">
		<coverage-setup database="./report/coverage-database">
			<fileset dir=".">
				<include name="**/*.php" />
				<exclude name="*test.php"/>
				<exclude name="./index.php"/>
				<exclude name="./library/**"/>
				<exclude name="doc/**"/>
			</fileset>
		</coverage-setup>
		<phpunit printsummary="true" >
			<batchtest>
				<fileset dir="tests">
					<include name="*test.php" />
				</fileset>
			</batchtest>
			<formatter type="xml" todir="report" outfile="testlog.xml" />
		</phpunit>
		<phpunitreport infile="report/testlog.xml" todir="report" />
		<coverage-report outfile="report/coverage-database">
		      <report todir="report" styledir="/home/phing/etc" />
		    </coverage-report>
	</target>

	<!-- ===================================================== -->
	<!-- Target: clean-doc -->
	<!-- this target removes documentation from a previous run -->
	<!-- ===================================================== -->
	<target name="doc-clean">
		<echo msg="Removing old documentation..." />
		<delete dir="./doc/api/" />
		<echo msg="Generate documentation directory..." />
		<mkdir dir="./doc/api/" />
	</target>

	<!-- ====================================== -->
	<!-- Target: doc -->
	<!-- this target builds all documentation -->
	<!-- ====================================== -->
	<target name="doc" depends="doc-clean">
		<echo msg="Building documentation..." />
		<docblox title="Friendica API" destdir="./doc/api">
			<fileset dir=".">
				<include name="**/*.php" />
			</fileset>
		</docblox>
	</target>

</project>