]> git.mxchange.org Git - friendica.git/blob - build.xml
better tests
[friendica.git] / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <project name="friendica" default="test">
4         <!-- set up include directories, this is necessary for the tests to work -->
5         <php>
6                 set_include_path(
7                                         get_include_path() . PATH_SEPARATOR
8                                         . 'include' . PATH_SEPARATOR 
9                                         . 'library' . PATH_SEPARATOR 
10                                         . 'library/phpsec' . PATH_SEPARATOR 
11                                         . '.' );
12         </php>
13         
14         <!-- ====================================================== -->
15         <!-- Target: clean-test -->
16         <!-- deletes directories with old test reports -->
17         <!-- ====================================================== -->
18         <target name="clean-test">
19                 <delete dir="report" />
20         </target>
21         
22         <!-- ====================================================== -->
23         <!-- Target: prepare-test -->
24         <!-- creates directories for test reports -->
25         <!-- ====================================================== -->
26         <target name="prepare-test" depends="clean-test">
27                 <mkdir dir="report" />
28         </target>
29         
30         <!-- =================================== -->
31         <!-- Target: test -->
32         <!-- this target runs all test files -->
33         <!-- =================================== -->
34         <target name="test" depends="prepare-test">
35                 <coverage-setup database="./report/coverage-database">
36                         <fileset dir=".">
37                                 <include name="**/*.php" />
38                                 <exclude name="*test.php"/>
39                                 <exclude name="./index.php"/>
40                                 <exclude name="./library/**"/>
41                                 <exclude name="doc/**"/>
42                         </fileset>
43                 </coverage-setup>
44                 <phpunit printsummary="true" >
45                         <batchtest>
46                                 <fileset dir="tests">
47                                         <include name="*test.php" />
48                                 </fileset>
49                         </batchtest>
50                         <formatter type="xml" todir="report" outfile="testlog.xml" />
51                 </phpunit>
52                 <phpunitreport infile="report/testlog.xml" todir="report" />
53                 <coverage-report outfile="report/coverage-database">
54                       <report todir="report" styledir="/home/phing/etc" />
55                     </coverage-report>
56         </target>
57
58         <!-- ===================================================== -->
59         <!-- Target: clean-doc -->
60         <!-- this target removes documentation from a previous run -->
61         <!-- ===================================================== -->
62         <target name="doc-clean">
63                 <echo msg="Removing old documentation..." />
64                 <delete dir="./doc/api/" />
65                 <echo msg="Generate documentation directory..." />
66                 <mkdir dir="./doc/api/" />
67         </target>
68
69         <!-- ====================================== -->
70         <!-- Target: doc -->
71         <!-- this target builds all documentation -->
72         <!-- ====================================== -->
73         <target name="doc" depends="doc-clean">
74                 <echo msg="Building documentation..." />
75                 <docblox title="Friendica API" destdir="./doc/api">
76                         <fileset dir=".">
77                                 <include name="**/*.php" />
78                         </fileset>
79                 </docblox>
80         </target>
81
82 </project>