bug 13986: setdefaultlanguage does not set value correctly in Windows registry
[scilab.git] / scilab / build.qa.incl.xml
1         <project name="common_qa">
2     <!--  Unitary testing + code coverage -->
3     
4     <property name="base.dir" location="../../"/>
5     
6     <!-- JAR names -->
7     <property file="${base.dir}/scilab-lib.properties"/>
8     <property file="${base.dir}/scilab-lib-doc.properties"/>
9     <!-- Configure ANT flags -->
10     <property file="${base.dir}/scilab.properties"/>
11     
12     <!-- Where we can find the test sources -->
13     <property name="test.dir" location="tests/"/>
14     <property name="src.test.dir" location="${test.dir}/java/"/>
15     <property name="report.test.dir" location="${base.dir}/reports/"/>
16     <property name="report.xml.test.dir" location="${report.test.dir}/xml/"/>
17     <property name="report.html.test.dir" location="${report.test.dir}/html/"/>
18     <property name="report.codecoverage.dir" location="${report.test.dir}/codecoverage/"/>
19     <property name="report.codecoverage.html.dir" location="${report.test.dir}/html-codecoverage/"/>
20     <property name="report.codecoverage.xml.dir" location="${report.test.dir}/xml-codecoverage/"/>
21     
22     <!-- Check style definitions -->
23     <property name="checkstyle.config.file" value="${base.dir}/checkstyle/scilab_checkstyle_convention.xml"/>
24     <property name="checkstyle.stylesheet" value="${thirdparty.dir}/checkstyle/contrib/checkstyle-noframes-sorted.xsl"/>
25     <property name="checkstyle.report.dir" value="${build.dir}/checkstyle"/>
26     <property name="checkstyle.xml.report.file" value="${checkstyle.report.dir}/checkstyle_errors.xml"/>
27     <property name="checkstyle.html.report.file" value="${checkstyle.report.dir}/checkstyle_errors.htm"/>
28     
29     <path id="unittest.classpath">
30         <pathelement location="${junit4.jar}"/>
31         <pathelement location="${hamcrest-all.jar}"/>
32     </path>
33     <path id="cobertura_classpath">
34         <pathelement location="${cobertura.jar}"/>
35     </path>
36     
37     <!-- Clean test -->
38     <target name="clean-test" description="Clean test files">
39         <delete dir="${build.test.dir}"/>
40     </target>
41     
42     <target name="existing-tests">
43         <available property="test-present" file="${src.test.dir}"/>
44     </target>
45     
46     <!-- Compile test sources -->
47     <target name="compile-test" description="Build tests" depends="existing-tests, clean-test, jar" if="test-present">
48         <!-- clean the test to make sure it will build properly -->
49         <javac srcdir="${src.test.dir}" destdir="${classes.test.dir}" deprecation="on" debug="${build.debug}" verbose="off" listfiles="on" includeAntRuntime="no" source="6" target="6" encoding="UTF-8">
50             <classpath>
51                 <path refid="unittest.classpath"/>
52                 <path refid="compile.classpath"/>
53             </classpath>
54         </javac>
55     </target>
56     
57     <taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>
58     <!-- Checkstyle process -->
59     <target name="checkstyle" depends="checkstyle-init" description="Generates a report of code convention violations.">
60         <checkstyle config="${checkstyle.config.file}" failOnViolation="false">
61             <fileset dir="${src.dir}" includes="**/*.java"/>
62             <!-- Location of cache-file. -->
63             <property key="checkstyle.cache.file" file="${cache.dir}"/>
64             <formatter type="plain"/>
65             <formatter type="xml" toFile="${checkstyle.xml.report.file}"/>
66         </checkstyle>
67         <xslt in="${checkstyle.xml.report.file}" out="${checkstyle.html.report.file}" style="${checkstyle.stylesheet}"/>
68     </target>
69     <!-- Create the build directory -->
70     <target name="checkstyle-init">
71         <mkdir dir="${checkstyle.report.dir}"/>
72     </target>
73     <!-- Delete the build directory -->
74     <target name="checkstyle-clean">
75         <delete dir="${checkstyle.report.dir}"/>
76     </target>
77     
78     
79     <!-- Allows the override of the forkMode by local build.xml -->
80     <condition property="forkModeAlreadySet">
81         <isset property="junit.forkMode" />
82     </condition>
83     
84     <target name="validate">
85         <!-- Empty target to be override by other build.xml -->
86     </target>
87     
88     <taskdef classpathref="cobertura_classpath" resource="tasks.properties" />
89     
90     <target name="instrument">
91         <cobertura-instrument todir="${instrumented.classes.test.dir}" datafile="${report.test.dir}/${library.name}.ser">
92             <fileset dir="${classes.dir}">
93                 <include name="**/*.class" />
94             </fileset>
95         </cobertura-instrument>
96     </target>
97     
98     <target name="codecoverage" depends="compile-test, instrument, test">
99         <cobertura-merge>
100             <fileset dir="${report.test.dir}">
101                 <include name="*.ser" />
102             </fileset>
103         </cobertura-merge>
104         
105         <cobertura-report format="html" destdir="${report.codecoverage.html.dir}"> 
106             
107             <fileset dir="${library.action_binding.src.dir}">
108                 <include name="**/*.java" />
109             </fileset>
110             <fileset dir="${library.commons.src.dir}">
111                 <include name="**/*.java" />
112             </fileset>
113             <fileset dir="${library.graph.src.dir}">
114                 <include name="**/*.java" />
115             </fileset>
116             <fileset dir="${library.graphic_objects.src.dir}">
117                 <include name="**/*.java" />
118             </fileset>
119             <fileset dir="${library.xcos.src.dir}">
120                 <include name="**/*.java" />
121             </fileset>
122             <fileset dir="${library.types.src.dir}">
123                 <include name="**/*.java" />
124             </fileset>
125             <fileset dir="${library.javasci.src.dir}">
126                 <include name="**/*.java" />
127             </fileset>
128         </cobertura-report>
129         
130         <cobertura-report format="xml" destdir="${report.codecoverage.xml.dir}"> 
131             
132             <fileset dir="${library.action_binding.src.dir}">
133                 <include name="**/*.java" />
134             </fileset>
135             <fileset dir="${library.commons.src.dir}">
136                 <include name="**/*.java" />
137             </fileset>
138             <fileset dir="${library.graph.src.dir}">
139                 <include name="**/*.java" />
140             </fileset>
141             <fileset dir="${library.graphic_objects.src.dir}">
142                 <include name="**/*.java" />
143             </fileset>
144             <fileset dir="${library.xcos.src.dir}">
145                 <include name="**/*.java" />
146             </fileset>
147             <fileset dir="${library.types.src.dir}">
148                 <include name="**/*.java" />
149             </fileset>
150             <fileset dir="${library.javasci.src.dir}">
151                 <include name="**/*.java" />
152             </fileset>
153         </cobertura-report>
154         
155     </target>
156     
157     
158     <target name="detectForkMode" unless="forkModeAlreadySet">
159         <property name="junit.forkMode" value="perBatch"/>
160     </target>
161     
162     <target name="test" depends="existing-tests, compile-test, validate, detectForkMode" if="test-present">
163         <mkdir dir="${report.xml.test.dir}" />
164         <mkdir dir="${report.html.test.dir}" />
165         <mkdir dir="${report.codecoverage.dir}/" />
166         <junit fork="yes" forkmode="${junit.forkMode}" failureproperty="junit.failure">
167             <sysproperty key="net.sourceforge.cobertura.datafile"
168                  file="${report.test.dir}/${library.name}.ser" />
169             
170             
171             <classpath location="${instrumented.classes.test.dir}"/>
172             <classpath location="${classes.test.dir}"/>
173             
174             <classpath>
175                 <path refid="unittest.classpath"/>
176                 <path refid="compile.classpath"/>
177                 <pathelement location="${cobertura.jar}"/>
178                 <pathelement location="${classes.test.dir}"/>
179                 <pathelement location="${classes.dir}"/>
180             </classpath>
181             
182             
183             <!-- Where ${basedir} is the module base directory -->
184             <env key="SCI" value="${basedir}/../.."/>
185             <jvmarg value="-DtestngTests=1"/>
186             <jvmarg value="-Djava.library.path=${base.dir}/modules/.libs/:${base.dir}/modules/javasci/.libs/:${base.dir}/modules/types/.libs/:${base.dir}/modules/localization/.libs/:${base.dir}/modules/commons/.libs/:${base.dir}/modules/action_binding/.libs/:${base.dir}/thirdparty/:${base.dir}/bin/:/usr/lib/jni/:/usr/lib64/jni:/usr/lib/java/:/usr/lib64/java:"/>
187             
188             <formatter type="brief" useFile="no" />
189             <formatter type="xml" />
190             
191             <batchtest fork="yes" todir="${report.xml.test.dir}" >
192                 <fileset dir="tests/java/">
193                     <include name="**/*.java"/>
194                 </fileset>
195             </batchtest>
196         </junit>
197         
198         <junitreport todir="${report.xml.test.dir}">
199             <fileset dir="${report.xml.test.dir}">
200                 <include name="*.xml"/>
201             </fileset>
202             <report format="frames" todir="${report.html.test.dir}"/>
203         </junitreport>
204         
205         <fail if="junit.failure" message="Unit test(s) failed. See the report"/>
206     </target>
207 </project>