587
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_cmt.ant.xml
|
|
5 |
Part of : Helium AntLib
|
|
6 |
|
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
8 |
All rights reserved.
|
|
9 |
This component and the accompanying materials are made available
|
|
10 |
under the terms of the License "Eclipse Public License v1.0"
|
|
11 |
which accompanies this distribution, and is available
|
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
13 |
|
|
14 |
Initial Contributors:
|
|
15 |
Nokia Corporation - initial contribution.
|
|
16 |
|
|
17 |
Contributors:
|
|
18 |
|
|
19 |
Description:
|
|
20 |
|
|
21 |
============================================================================
|
|
22 |
-->
|
|
23 |
<project name="test-cmt" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>Helium antlib Quality CMT related tests.</description>
|
|
25 |
|
588
|
26 |
<taskdef name="fmpp" classname="fmpp.tools.AntTask" onerror="report"/>
|
|
27 |
|
587
|
28 |
<taskdef resource="com/nokia/helium/quality/ant/antlib.xml" uri="http://www.nokia.com/helium" />
|
588
|
29 |
<property name="cmt.output.dir" location="${test.temp.dir}/output"/>
|
587
|
30 |
<property name="test.data.src" value="./../data/helloworldcons"/>
|
588
|
31 |
<property name="temp.diamonds.header.xml" location="${cmt.output.dir}/cmt/diamonds_header.xml" />
|
|
32 |
<property name="temp.diamonds.footer.xml" location="${cmt.output.dir}/cmt/diamonds_footer.xml" />
|
|
33 |
|
587
|
34 |
<basename property="componentbase" file="${test.data.src}"/>
|
588
|
35 |
<property name="diamonds.build.output.dir" location="${cmt.output.dir}/cmt" />
|
587
|
36 |
|
|
37 |
<!-- is called prior to the test -->
|
|
38 |
<target name="setUp">
|
588
|
39 |
<delete dir="${cmt.output.dir}/cmt" failonerror="false" />
|
|
40 |
<mkdir dir="${cmt.output.dir}/cmt" />
|
628
|
41 |
<echo file="${temp.diamonds.header.xml}"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
|
42 |
<diamonds-build>
|
|
43 |
<schema>23</schema>
|
|
44 |
]]></echo>
|
|
45 |
<echo file="${temp.diamonds.footer.xml}"><![CDATA[</diamonds-build>
|
|
46 |
]]></echo>
|
587
|
47 |
</target>
|
|
48 |
|
|
49 |
<!-- is called after the test, even if that caused an error -->
|
|
50 |
<target name="tearDown">
|
588
|
51 |
<delete dir="${cmt.output.dir}/cmt" failonerror="false" />
|
|
52 |
<delete file="${temp.diamonds.header.xml}" failonerror="false" />
|
|
53 |
<delete file="${temp.diamonds.footer.xml}" failonerror="false" />
|
587
|
54 |
</target>
|
|
55 |
<condition property="do.cmt.test">
|
|
56 |
<os family="windows" />
|
|
57 |
</condition>
|
|
58 |
|
|
59 |
|
|
60 |
<!--
|
|
61 |
**************************************************************
|
|
62 |
** test CMT for windows
|
|
63 |
**************************************************************
|
|
64 |
-->
|
|
65 |
|
|
66 |
<target name="test-cmt-with-all-reqd-params-set" if="do.cmt.test">
|
588
|
67 |
<hlm:cmt output="${cmt.output.dir}\logs\cmt_test.txt">
|
587
|
68 |
<fileset id="input" dir="${test.data.src}">
|
|
69 |
<include name="**/*.h"/>
|
|
70 |
<include name="**/*.cpp"/>
|
|
71 |
</fileset>
|
|
72 |
</hlm:cmt>
|
588
|
73 |
<au:assertLogContains text="run command: cmt"/>
|
|
74 |
<au:assertFileExists file="${cmt.output.dir}\logs\cmt_test.txt"/>
|
|
75 |
</target>
|
|
76 |
|
|
77 |
<target name="test-cmt-with-html-output-dir" if="do.cmt.test">
|
|
78 |
<hlm:cmt output="${cmt.output.dir}\logs\cmt_test.txt" htmlOutputDir="${cmt.output.dir}\logs\cmthtmlFolder">
|
|
79 |
<fileset id="input" dir="${test.data.src}">
|
|
80 |
<include name="**/*.h"/>
|
|
81 |
<include name="**/*.cpp"/>
|
|
82 |
</fileset>
|
|
83 |
</hlm:cmt>
|
|
84 |
<au:assertLogContains text="run command: cmt"/>
|
|
85 |
<au:assertFileExists file="${cmt.output.dir}\logs\cmt_test.txt"/>
|
|
86 |
<au:assertLogContains text="run command: cmt2html.bat"/>
|
|
87 |
<au:assertFileExists file="${cmt.output.dir}\logs\cmthtmlFolder\CMTHTML\index.html"/>
|
587
|
88 |
</target>
|
|
89 |
|
|
90 |
<!--
|
|
91 |
**************************************************************
|
|
92 |
** test noargs
|
|
93 |
**************************************************************
|
|
94 |
-->
|
|
95 |
<target name="test-norargs-set" if="do.cmt.test">
|
|
96 |
<au:expectfailure expectedMessage="Nested Element 'fileset' missing for task 'cmt'.">
|
|
97 |
<hlm:cmt/>
|
|
98 |
</au:expectfailure>
|
|
99 |
</target>
|
|
100 |
|
|
101 |
<!--
|
|
102 |
**************************************************************
|
|
103 |
** test Only fileset set
|
|
104 |
**************************************************************
|
|
105 |
-->
|
|
106 |
<target name="test-only-fileset-set" if="do.cmt.test">
|
|
107 |
<au:expectfailure expectedMessage="Parameter 'output' missing for task 'cmt'.">
|
|
108 |
<hlm:cmt>
|
|
109 |
<fileset id="input" dir="${test.data.src}">
|
|
110 |
<include name="**/*.h"/>
|
|
111 |
<include name="**/*.cpp"/>
|
|
112 |
</fileset>
|
|
113 |
</hlm:cmt>
|
|
114 |
</au:expectfailure>
|
|
115 |
</target>
|
|
116 |
|
|
117 |
<!--
|
|
118 |
**************************************************************
|
|
119 |
** test CMT for linux
|
|
120 |
**************************************************************
|
|
121 |
-->
|
|
122 |
<target name="test-cmt-linux" unless="do.cmt.test">
|
588
|
123 |
<au:expectfailure expectedMessage="CMT supported only on windows platforms">
|
|
124 |
<hlm:cmt/>
|
|
125 |
</au:expectfailure>
|
|
126 |
</target>
|
|
127 |
|
|
128 |
<!--
|
|
129 |
** test CMT convert to diamonds (input file has all the wanted data on 2 lines only)
|
|
130 |
-->
|
|
131 |
<target name="test-cmt-cnvt-dia-valid-2lines" if="do.cmt.test">
|
|
132 |
<property name="cmt.id" value="1" />
|
|
133 |
<property name="cmt.test.data.src" location="${test.data.src}/index_${cmt.id}.html" />
|
|
134 |
<property name="output.file.name" location="${diamonds.build.output.dir}/cmt_summary_${cmt.id}.xml"/>
|
|
135 |
|
|
136 |
<hlm:cmtsummarytask diamondsHeaderFileName="${temp.diamonds.header.xml}" diamondsFooterFileName="${temp.diamonds.footer.xml}"
|
|
137 |
outputFile="${output.file.name}"
|
|
138 |
inputFile="${cmt.test.data.src}" />
|
|
139 |
<au:assertFileExists file="${output.file.name}" />
|
|
140 |
<au:assertFilesMatch expected="${output.file.name}"
|
|
141 |
actual="${test.data.src}/../cmt_summary_${cmt.id}.xml" />
|
|
142 |
|
|
143 |
</target>
|
|
144 |
|
|
145 |
<!--
|
|
146 |
** test CMT convert to diamonds (input file has all the wanted data on 4 lines)
|
|
147 |
-->
|
|
148 |
<target name="test-cmt-cnvt-dia-valid-split" if="do.cmt.test">
|
|
149 |
<property name="cmt.id" value="2" />
|
|
150 |
<property name="cmt.test.data.src" location="${test.data.src}/index_${cmt.id}.html" />
|
|
151 |
<property name="output.file.name" location="${diamonds.build.output.dir}/cmt_summary_${cmt.id}.xml"/>
|
|
152 |
|
|
153 |
<hlm:cmtsummarytask diamondsHeaderFileName="${temp.diamonds.header.xml}" diamondsFooterFileName="${temp.diamonds.footer.xml}"
|
|
154 |
outputFile="${output.file.name}"
|
|
155 |
inputFile="${cmt.test.data.src}" />
|
|
156 |
<au:assertFileExists file="${output.file.name}" />
|
|
157 |
<au:assertFilesMatch expected="${output.file.name}"
|
|
158 |
actual="${test.data.src}/../cmt_summary_${cmt.id}.xml" />
|
|
159 |
|
587
|
160 |
</target>
|
|
161 |
|
588
|
162 |
<!--
|
|
163 |
** test CMT convert to diamonds input file has no CMT summary data
|
|
164 |
-->
|
|
165 |
<target name="test-cmt-cnvt-dia-invalid-no-summary" if="do.cmt.test">
|
|
166 |
<property name="cmt.id" value="3" />
|
|
167 |
<property name="cmt.test.data.src" location="${test.data.src}/index_${cmt.id}.html" />
|
|
168 |
<property name="output.file.name" location="${diamonds.build.output.dir}/cmt_summary_${cmt.id}.xml"/>
|
|
169 |
|
|
170 |
<hlm:cmtsummarytask diamondsHeaderFileName="${temp.diamonds.header.xml}" diamondsFooterFileName="${temp.diamonds.footer.xml}"
|
|
171 |
outputFile="${output.file.name}"
|
|
172 |
inputFile="${cmt.test.data.src}" />
|
|
173 |
<au:assertFileExists file="${output.file.name}" />
|
|
174 |
<au:assertFilesMatch expected="${output.file.name}"
|
|
175 |
actual="${test.data.src}/../cmt_summary_${cmt.id}.xml" />
|
|
176 |
|
|
177 |
</target>
|
|
178 |
|
|
179 |
<!--
|
|
180 |
** test CMT convert to diamonds input file none existant
|
|
181 |
-->
|
|
182 |
<target name="test-cmt-cnvt-dia-invalid-no-file" if="do.cmt.test">
|
|
183 |
<property name="cmt.id" value="4" />
|
|
184 |
<property name="cmt.test.data.src" location="${test.data.src}/index_${cmt.id}.html" />
|
|
185 |
<property name="output.file.name" location="${diamonds.build.output.dir}/cmt_summary_${cmt.id}.xml"/>
|
|
186 |
|
|
187 |
<hlm:cmtsummarytask diamondsHeaderFileName="${temp.diamonds.header.xml}" diamondsFooterFileName="${temp.diamonds.footer.xml}"
|
|
188 |
outputFile="${output.file.name}"
|
|
189 |
inputFile="${cmt.test.data.src}" />
|
|
190 |
<au:assertFileDoesntExist file="${output.file.name}" />
|
|
191 |
|
|
192 |
</target>
|
|
193 |
|
|
194 |
<!--
|
|
195 |
** test CMT convert to diamonds input file has spaces after number text in CMT summary data
|
|
196 |
-->
|
|
197 |
<target name="test-cmt-cnvt-dia-invalid-space-after-numtext-no-summary" if="do.cmt.test">
|
|
198 |
<property name="cmt.id" value="5" />
|
|
199 |
<property name="cmt.test.data.src" location="${test.data.src}/index_${cmt.id}.html" />
|
|
200 |
<property name="output.file.name" location="${diamonds.build.output.dir}/cmt_summary_${cmt.id}.xml"/>
|
|
201 |
|
|
202 |
<hlm:cmtsummarytask diamondsHeaderFileName="${temp.diamonds.header.xml}" diamondsFooterFileName="${temp.diamonds.footer.xml}"
|
|
203 |
outputFile="${output.file.name}"
|
|
204 |
inputFile="${cmt.test.data.src}" />
|
|
205 |
<au:assertFileExists file="${output.file.name}" />
|
|
206 |
<au:assertFilesMatch expected="${output.file.name}"
|
|
207 |
actual="${test.data.src}/../cmt_summary_${cmt.id}.xml" />
|
|
208 |
|
|
209 |
</target>
|
|
210 |
|
587
|
211 |
</project> |