588
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_filter_sysdef.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-filter-sysdef" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>Helium antlib filter sysdef tests.</description>
|
|
25 |
|
|
26 |
<taskdef resource="com/nokia/helium/sysdef/ant/antlib.xml" uri="http://www.nokia.com/helium" />
|
|
27 |
<property name="epocroot" location="../../demo/data" />
|
|
28 |
<property name="epocroot.temp" location="${epocroot}/temp" />
|
|
29 |
|
|
30 |
<!-- is called prior to the test -->
|
|
31 |
<target name="setUp">
|
|
32 |
<delete dir="${epocroot.temp}/" failonerror="false" />
|
|
33 |
<mkdir dir="${epocroot.temp}" />
|
|
34 |
</target>
|
|
35 |
|
|
36 |
<!-- is called after the test, even if that caused an error -->
|
|
37 |
<target name="tearDown">
|
|
38 |
<delete dir="${epocroot.temp}" failonerror="false" />
|
|
39 |
</target>
|
|
40 |
|
|
41 |
<target name="test-noargs">
|
|
42 |
<au:expectfailure expectedMessage="'srcfile' attribute is not defined">
|
|
43 |
<hlm:filterSysdef />
|
|
44 |
</au:expectfailure>
|
|
45 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
46 |
</target>
|
|
47 |
|
|
48 |
<target name="test-destfile-missing">
|
|
49 |
<au:expectfailure expectedMessage="'destfile' attribute is not defined">
|
|
50 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml" />
|
|
51 |
</au:expectfailure>
|
|
52 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
53 |
</target>
|
|
54 |
|
|
55 |
<target name="test-no-nested-filter">
|
|
56 |
<au:expectfailure expectedMessage="You must define at least one nested filterset element.">
|
|
57 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
58 |
destfile="${epocroot.temp}/filtered.xml" />
|
|
59 |
</au:expectfailure>
|
|
60 |
<au:assertFileDoesntExist file="${epocroot.temp}/filtered.xml" />
|
|
61 |
</target>
|
|
62 |
|
|
63 |
<target name="test-empty-nested-filterset">
|
|
64 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
65 |
destfile="${epocroot.temp}/filtered.xml">
|
|
66 |
<filterSet/>
|
|
67 |
</hlm:filterSysdef>
|
|
68 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
69 |
</target>
|
|
70 |
|
|
71 |
<target name="test-nested-filterset">
|
|
72 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
73 |
destfile="${epocroot.temp}/filtered.xml">
|
|
74 |
<filterSet>
|
|
75 |
<filter filter="test" type="has" />
|
|
76 |
<filter filter="test_unittest" type="has" />
|
|
77 |
</filterSet>
|
|
78 |
</hlm:filterSysdef>
|
|
79 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
80 |
</target>
|
|
81 |
|
|
82 |
<target name="test-nested-filterset-missing-filter-attribute">
|
628
|
83 |
<au:expectfailure expectedMessage="'filter' or/and 'idlist' attribute is not defined.">
|
588
|
84 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
85 |
destfile="${epocroot.temp}/filtered.xml">
|
|
86 |
<filterSet>
|
|
87 |
<filter type="has" />
|
|
88 |
</filterSet>
|
|
89 |
</hlm:filterSysdef>
|
|
90 |
</au:expectfailure>
|
|
91 |
<au:assertFileDoesntExist file="${epocroot.temp}/filtered.xml" />
|
|
92 |
</target>
|
|
93 |
|
|
94 |
<target name="test-nested-filterset-refid">
|
|
95 |
<hlm:sysdefFilterSet id="filters.id">
|
|
96 |
<filter filter="test" type="has" />
|
|
97 |
</hlm:sysdefFilterSet>
|
|
98 |
<hlm:sysdefFilterSet id="filters2.id">
|
|
99 |
<filter filter="test_unittest" type="has" />
|
|
100 |
</hlm:sysdefFilterSet>
|
|
101 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
102 |
destfile="${epocroot.temp}/filtered.xml">
|
|
103 |
<filterSet refid="filters.id" />
|
|
104 |
<hlm:sysdefFilterSet refid="filters2.id"/>
|
|
105 |
</hlm:filterSysdef>
|
|
106 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
107 |
</target>
|
|
108 |
|
628
|
109 |
<target name="test-nested-filterset-verbatim">
|
|
110 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
111 |
destfile="${epocroot.temp}/filtered.xml">
|
|
112 |
<filterSet>
|
|
113 |
<filter filter="test" type="has" verbatim="component"/>
|
|
114 |
</filterSet>
|
|
115 |
</hlm:filterSysdef>
|
|
116 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
117 |
</target>
|
|
118 |
|
|
119 |
<target name="test-nested-filterset-verbatim-nofilter">
|
|
120 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
121 |
destfile="${epocroot.temp}/filtered.xml">
|
|
122 |
<filterSet>
|
|
123 |
<filter verbatim="component"/>
|
|
124 |
</filterSet>
|
|
125 |
</hlm:filterSysdef>
|
|
126 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
127 |
</target>
|
|
128 |
|
|
129 |
<target name="test-nested-filterset-with-config-missing-file-attribute">
|
|
130 |
<au:expectfailure expectedMessage="'file' attribute is not defined.">
|
|
131 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
132 |
destfile="${epocroot.temp}/filtered.xml">
|
|
133 |
<filterSet>
|
|
134 |
<config />
|
|
135 |
</filterSet>
|
|
136 |
</hlm:filterSysdef>
|
|
137 |
</au:expectfailure>
|
|
138 |
</target>
|
|
139 |
|
|
140 |
<target name="test-nested-filterset-with-config-missing-invalid-file">
|
|
141 |
<au:expectfailure expectedMessage="Could not find file:">
|
|
142 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
143 |
destfile="${epocroot.temp}/filtered.xml">
|
|
144 |
<filterSet>
|
|
145 |
<config file="invalid_config.hrh"/>
|
|
146 |
</filterSet>
|
|
147 |
</hlm:filterSysdef>
|
|
148 |
</au:expectfailure>
|
|
149 |
</target>
|
|
150 |
|
|
151 |
<target name="test-nested-filterset-with-config-missing-valid-file">
|
|
152 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
153 |
destfile="${epocroot.temp}/filtered.xml">
|
|
154 |
<filterSet>
|
|
155 |
<config file="../data/filter/config/config.hrh"/>
|
|
156 |
</filterSet>
|
|
157 |
</hlm:filterSysdef>
|
|
158 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
159 |
<au:assertLogContains text="-config" />
|
|
160 |
<au:assertLogContains text="-output" />
|
|
161 |
<au:assertLogDoesntContain text="-I" />
|
|
162 |
</target>
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
<target name="test-nested-filterset-with-config-missing-valid-file-and-includes">
|
|
167 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
168 |
destfile="${epocroot.temp}/filtered.xml">
|
|
169 |
<filterSet>
|
|
170 |
<config file="../data/filter/config/config.hrh"
|
|
171 |
includes="${epocroot.temp}/epoc32/include${path.separator}${epocroot.temp}/epoc32/config"/>
|
|
172 |
</filterSet>
|
|
173 |
</hlm:filterSysdef>
|
|
174 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
175 |
<au:assertLogContains text="-config" />
|
|
176 |
<au:assertLogContains text="-output" />
|
|
177 |
<au:assertLogContains text="-I${epocroot.temp}${file.separator}epoc32${file.separator}include" />
|
|
178 |
<au:assertLogContains text="-I${epocroot.temp}${file.separator}epoc32${file.separator}config" />
|
|
179 |
</target>
|
|
180 |
|
|
181 |
<target name="test-nested-filterset-with-config-check-property-for-home-invalid">
|
|
182 |
<property name="sysdef.tools.home" location="../../demo/data/invalid_dir" />
|
|
183 |
<au:expectfailure expectedMessage="The sysdef.tools.home property refers to an invalid directory:">
|
|
184 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
185 |
destfile="${epocroot.temp}/filtered.xml">
|
|
186 |
<filterSet>
|
|
187 |
<config file="../data/filter/config/config.hrh"/>
|
|
188 |
</filterSet>
|
|
189 |
</hlm:filterSysdef>
|
|
190 |
</au:expectfailure>
|
|
191 |
<au:assertFileDoesntExist file="${epocroot.temp}/filtered.xml" />
|
|
192 |
</target>
|
|
193 |
|
|
194 |
<target name="test-nested-filterset-with-config-check-property-for-home">
|
|
195 |
<property name="sysdef.tools.home" location="../../demo/data/sf/os/buildtools/bldsystemtools/sysdeftools" />
|
|
196 |
<hlm:filterSysdef epocroot="${epocroot}" srcfile="../data/filter/canonical_system_definition.xml"
|
|
197 |
destfile="${epocroot.temp}/filtered.xml">
|
|
198 |
<filterSet>
|
|
199 |
<config file="../data/filter/config/config.hrh"/>
|
|
200 |
</filterSet>
|
|
201 |
</hlm:filterSysdef>
|
|
202 |
<au:assertFileExists file="${epocroot.temp}/filtered.xml" />
|
|
203 |
</target>
|
|
204 |
|
|
205 |
</project>
|