217
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_logging.ant.xml
|
|
5 |
Part of : Helium
|
|
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_logging" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>
|
|
25 |
Logging testing targets
|
|
26 |
</description>
|
|
27 |
<property environment="env"/>
|
|
28 |
|
|
29 |
<property name="helium.dir" location="../../.." />
|
|
30 |
<property name="build.drive" location="${env.TEMP}/helium/temp_drive"/>
|
|
31 |
<import file="../../../helium.ant.xml"/>
|
|
32 |
|
|
33 |
|
|
34 |
<!--target name="test-tempRecordMacro">
|
|
35 |
<delete file="${build.cache.log.dir}/test.log" failonerror="false"/>
|
|
36 |
<delete file="${build.cache.log.dir}/test.log.xml" failonerror="false"/>
|
|
37 |
<delete file="${build.cache.log.dir}/test.sqlite" failonerror="false"/>
|
|
38 |
<delete file="${metadata.dbfile}" failonerror="false"/>
|
|
39 |
<property name="build.log.dir" value="${build.cache.dir}/helium/temp_drive/output/logs" />
|
|
40 |
<property name="test.log.dir" value="${build.cache.dir}/helium/temp_drive/output/logs/test" />
|
|
41 |
<hlm:tempRecordStartMacro name="test.log" />
|
|
42 |
<echo>ERROR: an error</echo>
|
|
43 |
<echo>WARNING: a warning</echo>
|
|
44 |
<echo>INFO: some useless message</echo>
|
|
45 |
<hlm:tempRecordStopMacro name="test.log" database="${build.cache.log.dir}/test.sqlite" phase="test"/>
|
|
46 |
<au:assertTrue>
|
|
47 |
<and>
|
|
48 |
<hlm:hasSeverity file="${build.cache.log.dir}/signals/test.log.status.xml" severity="error"/>
|
|
49 |
<hlm:hasSeverity file="${build.cache.log.dir}/signals/test.log.status.xml" severity="warning"/>
|
|
50 |
<hlm:hasSeverity file="${build.cache.log.dir}/signals/test.log.status.xml" severity="info"/>
|
|
51 |
</and>
|
|
52 |
</au:assertTrue>
|
|
53 |
</target-->
|
|
54 |
|
|
55 |
<!--target name="test-specificlogmacro-create">
|
|
56 |
<hlm:startSpecificLogMacro name="${env.TEMP}/record_test.log" phase="test"/>
|
|
57 |
<echo>astalavista</echo>
|
|
58 |
<hlm:stopSpecificLogMacro name="${env.TEMP}/record_test.log" phase="test"/>
|
|
59 |
|
|
60 |
<au:assertFileExists file="${env.TEMP}/record_test.log"/>
|
|
61 |
|
|
62 |
<loadfile property="file.message" srcFile="${env.TEMP}/record_test.log"/>
|
|
63 |
<au:assertTrue message="Failed to match content!!">
|
|
64 |
<equals arg1="${file.message}" arg2="[echo] astalavista" trim="true"/>
|
|
65 |
</au:assertTrue>
|
|
66 |
<delete file="${env.TEMP}/record_test.log"/>
|
|
67 |
</target-->
|
|
68 |
|
|
69 |
|
|
70 |
<!--target name="test-specificlogmacro-backup">
|
|
71 |
<touch file="${env.TEMP}/backup_test.log"/>
|
|
72 |
<echo file="${env.TEMP}/backup_test.log">childhood memory</echo>
|
|
73 |
<hlm:startSpecificLogMacro name="${env.TEMP}/backup_test.log" backup="true" phase="test"/>
|
|
74 |
<echo>Now a days</echo>
|
|
75 |
<hlm:stopSpecificLogMacro name="${env.TEMP}/backup_test.log" phase="test"/>
|
|
76 |
|
|
77 |
<loadfile property="backup.message" srcFile="${backup.file.name}"/>
|
|
78 |
<au:assertTrue message="Failed to match content!!">
|
|
79 |
<equals arg1="${backup.message}" arg2="childhood memory" trim="true"/>
|
|
80 |
</au:assertTrue>
|
|
81 |
|
|
82 |
<loadfile property="current.message" srcFile="${env.TEMP}/backup_test.log"/>
|
|
83 |
<au:assertTrue message="Failed to match content!!">
|
|
84 |
<equals arg1="${current.message}" arg2="[echo] Now a days" trim="true"/>
|
|
85 |
</au:assertTrue>
|
|
86 |
|
|
87 |
<delete file="${env.TEMP}/backup_test.log"/>
|
|
88 |
<delete>
|
|
89 |
<fileset dir="${env.TEMP}" includes="backup_test.log.*"/>
|
|
90 |
</delete>
|
|
91 |
</target-->
|
|
92 |
|
|
93 |
<target name="test-log4j-log-file">
|
|
94 |
<au:assertFileExists file="${log4j.cache.dir}/hlm_debug.log" />
|
|
95 |
<au:assertFileDoesntExist file="hlm_debug.log" />
|
|
96 |
</target>
|
|
97 |
|
|
98 |
<!-- Check the build-property-cache-file exists or not -->
|
|
99 |
<target name="test-build-property-cache-file-exists">
|
|
100 |
<antcall target="diamonds"/>
|
|
101 |
<au:assertFileExists file="${build.property.cache.file}" />
|
|
102 |
</target>
|
|
103 |
|
|
104 |
<!-- Check the build-property-cache-file contents-->
|
|
105 |
<target name="test-build-property-cache-file-content">
|
|
106 |
<antcall target="diamonds"/>
|
|
107 |
<loadfile property="test.data" srcFile="${build.property.cache.file}"/>
|
|
108 |
<au:assertMatches string="${test.data}" pattern="diamonds.build.url" />
|
|
109 |
</target>
|
|
110 |
|
|
111 |
|
|
112 |
</project>
|
|
113 |
|