author | Zheng Shen <zheng.shen@nokia.com> |
Tue, 26 Oct 2010 11:12:31 +0800 | |
changeset 654 | 7c11c3d8d025 |
parent 625 | a1925fb7753a |
child 674 | 37ee82a83d43 |
permissions | -rw-r--r-- |
591 | 1 |
# |
2 |
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
# All rights reserved. |
|
4 |
# This component and the accompanying materials are made available |
|
5 |
# under the terms of the License "Eclipse Public License v1.0" |
|
6 |
# which accompanies this distribution, and is available |
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
# |
|
9 |
# Initial Contributors: |
|
10 |
# Nokia Corporation - initial contribution. |
|
11 |
# |
|
12 |
# Contributors: |
|
13 |
# |
|
14 |
# Description: |
|
15 |
# |
|
16 |
||
17 |
from raptor_tests import AntiTargetSmokeTest |
|
18 |
from raptor_meta import BldInfFile |
|
19 |
import os |
|
20 |
||
21 |
def run(): |
|
22 |
t = AntiTargetSmokeTest() |
|
23 |
t.usebash = True |
|
24 |
||
25 |
genericTargets = [ |
|
26 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe", |
|
27 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe.map", |
|
28 |
"$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe", |
|
29 |
"$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe.map", |
|
30 |
"$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe", |
|
31 |
"$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe.map", |
|
32 |
"$(EPOCROOT)/epoc32/release/winscw/udeb/dependency.exe", |
|
33 |
"$(EPOCROOT)/epoc32/include/dependency.rsg", |
|
34 |
"$(EPOCROOT)/epoc32/data/z/resource/apps/dependency.rsc", |
|
35 |
"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/dependency.rsc", |
|
36 |
"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/dependency.rsc", |
|
37 |
"$(EPOCROOT)/epoc32/include/main.rsg", |
|
38 |
"$(EPOCROOT)/epoc32/data/z/resource/apps/main.rsc", |
|
39 |
"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/main.rsc", |
|
40 |
"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/main.rsc" |
|
41 |
] |
|
42 |
windowsTargets = [ |
|
43 |
"$(EPOCROOT)/epoc32/release/tools2/rel/dependency.exe", |
|
44 |
"$(EPOCROOT)/epoc32/tools/dependency.exe" |
|
45 |
] |
|
46 |
linuxTargets = [ |
|
47 |
"$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/rel/dependency", |
|
48 |
"$(EPOCROOT)/epoc32/tools/dependency" |
|
49 |
] |
|
50 |
||
51 |
# Set general host platform specifics from first test run, but assume Windows initially |
|
52 |
hostPlatform = "windows" |
|
53 |
hostPlatformTargets = genericTargets + windowsTargets |
|
54 |
hostPlatformOffset = "" |
|
55 |
||
56 |
t.id = "0098a" |
|
57 |
t.name = "baseline_build" |
|
58 |
t.description = "Build a component with source and resource files that are dependent on header files exported in the build" |
|
59 |
t.command = """ |
|
60 |
cp smoke_suite/test_resources/dependencies/src/dependency1.cpp smoke_suite/test_resources/dependencies/dependency.cpp |
|
61 |
cp smoke_suite/test_resources/dependencies/src/dependency1.rss smoke_suite/test_resources/dependencies/dependency.rss |
|
62 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel""" |
|
63 |
t.mustnotmatch = [ |
|
64 |
"<warning>Missing dependency detected: .*</warning>" |
|
65 |
] |
|
66 |
t.targets = hostPlatformTargets |
|
67 |
t.run(hostPlatform) |
|
68 |
if t.result == AntiTargetSmokeTest.SKIP: |
|
69 |
hostPlatform = "linux" |
|
70 |
hostPlatformTargets = genericTargets + linuxTargets |
|
71 |
hostPlatformOffset = "$(HOSTPLATFORM_DIR)/" |
|
72 |
t.targets = hostPlatformTargets |
|
73 |
t.run(hostPlatform) |
|
74 |
||
75 |
# Ensure we don't clean up from the previous build in the following two tests |
|
76 |
t.targets = [] |
|
77 |
||
78 |
# Core expected outcome for the following two tests |
|
79 |
t.mustmatch = [ |
|
80 |
".*recipe name='compile' target='.*dependency\.o'", |
|
81 |
".*recipe name='win32compile2object' target='.*dependency\.o'", |
|
82 |
".*recipe name='compile2object' target='.*dependency\.o'", |
|
83 |
".*recipe name='resourcecompile' target='.*dependency\.rsc'" |
|
84 |
] |
|
85 |
t.countmatch = [ |
|
86 |
[".*recipe name='compile'", 2], |
|
87 |
[".*recipe name='win32compile2object'", 2], |
|
88 |
[".*recipe name='compile2object'", 1], |
|
625
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
89 |
[".*recipe name='resourcecompile", 2] |
591 | 90 |
] |
91 |
||
92 |
||
93 |
t.id = "0098b" |
|
94 |
t.name ="touched_header_dependencies" |
|
95 |
t.description = "Touch the exported header files and check that only the related source and resource files are re-built" |
|
96 |
t.command = """ |
|
97 |
sleep 1 |
|
98 |
touch $(EPOCROOT)/epoc32/include/dependency.h |
|
99 |
touch $(EPOCROOT)/epoc32/include/dependency.rh |
|
100 |
sbs -f- -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel""" |
|
101 |
t.run() |
|
102 |
||
103 |
||
104 |
t.id = "0098c" |
|
105 |
t.name ="redundant_header_dependencies" |
|
106 |
t.description = """ |
|
107 |
Build the component again, but manipulate it so that (a) it no longer has a dependency on the exported header files and |
|
108 |
(b) the header files have been removed and (c) the header files are no longer exported. Check that only the related source |
|
109 |
and resource files are re-built""" |
|
110 |
t.command = """ |
|
111 |
cp smoke_suite/test_resources/dependencies/src/dependency2.cpp smoke_suite/test_resources/dependencies/dependency.cpp |
|
112 |
cp smoke_suite/test_resources/dependencies/src/dependency2.rss smoke_suite/test_resources/dependencies/dependency.rss |
|
113 |
rm -rf $(EPOCROOT)/epoc32/include/dependency.h |
|
114 |
rm -rf $(EPOCROOT)/epoc32/include/dependency.rh |
|
115 |
sbs -f- --noexport -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel""" |
|
116 |
t.mustnotmatch = [] |
|
117 |
# Note that the resource build does not exhibit a missing dependency as its dependency files are generated in a separate stage where |
|
118 |
# the target file isn't actually a target of that stage |
|
119 |
t.mustmatch.extend([ |
|
120 |
"<warning>Missing dependency detected: .*/epoc32/include/dependency.h</warning>" |
|
121 |
]) |
|
122 |
t.warnings = 1 |
|
123 |
t.run() |
|
124 |
||
125 |
||
126 |
t.id = "0098d" |
|
127 |
t.name ="invalid_dependency_files" |
|
128 |
t.description = "Invalidate dependency files, then make sure we can clean and re-build successfully" |
|
129 |
buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_" |
|
625
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
130 |
# use one long bash command so that we can capture |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
131 |
# the output in a way that isn't messed up with all the ordering confused. |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
132 |
t.command = " mkdir -p $(EPOCROOT)/epoc32/build/smoketestlogs ; { sleep 1 ; set -x ; \ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
133 |
touch smoke_suite/test_resources/dependencies/dependency.cpp; \ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
134 |
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> %s/armv5/urel/dependency.o.d ; \ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
135 |
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> %s/winscw/urel/dependency.o.d ;\ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
136 |
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> %s/dependency_exe/tools2/rel/%s/dependency.o.d ;\ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
137 |
echo INVALIDATE_RESOURCE_DEPENDENCY_FILE >> %s/dependency__resource_apps.rsc.d ;\ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
138 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel ;\ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
139 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel clean ;\ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
140 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel ; } > ${SBSLOGFILE} 2>&1; grep 'missing separator' ${SBSLOGFILE} " %(buildLocation, buildLocation, buildLocation, hostPlatformOffset, buildLocation) |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
141 |
# We expect an error from the first build due to the deliberate dependency file corruption |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
142 |
t.mustmatch = [ |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
143 |
".*dependency.o.d:[0-9]+: \*\*\* missing separator" |
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
144 |
] |
591 | 145 |
t.countmatch = [] |
146 |
t.warnings = 0 |
|
625
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
147 |
t.errors = 0 |
591 | 148 |
t.targets = hostPlatformTargets |
149 |
t.run(hostPlatform) |
|
150 |
||
151 |
||
152 |
t.id = "0098e" |
|
153 |
t.name ="no_depend_include" |
|
154 |
t.description = "Invalidate dependency files in order to confirm they aren't processed when --no-depend-include is used" |
|
155 |
buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_" |
|
156 |
t.command = """ |
|
157 |
sleep 1 |
|
158 |
touch smoke_suite/test_resources/dependencies/dependency.cpp |
|
159 |
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d |
|
160 |
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d |
|
161 |
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d |
|
162 |
sbs --no-depend-include -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel""" |
|
625
a1925fb7753a
sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
163 |
t.mustmatch = [] |
591 | 164 |
t.errors = 0 |
165 |
t.targets = hostPlatformTargets |
|
166 |
t.run(hostPlatform) |
|
167 |
||
168 |
||
169 |
t.id = "0098f" |
|
170 |
t.name ="no_depend_generate" |
|
171 |
t.description = "Invalidate and remove dependency files in order to confirm they are neither included nor re-generated when --no-depend-generate is used" |
|
172 |
buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_" |
|
173 |
t.command = """ |
|
174 |
sleep 1 |
|
175 |
touch smoke_suite/test_resources/dependencies/dependency.cpp |
|
176 |
touch smoke_suite/test_resources/dependencies/main.cpp |
|
177 |
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d |
|
178 |
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d |
|
179 |
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d |
|
180 |
sbs --no-depend-generate -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel""" |
|
181 |
t.antitargets = [ |
|
182 |
buildLocation+"/armv5/urel/main.o.d", |
|
183 |
buildLocation+"/armv5/udeb/main.o.d", |
|
184 |
buildLocation+"/winscw/urel/main.o.d", |
|
185 |
buildLocation+"/winscw/udeb/main.o.d", |
|
186 |
buildLocation+"/dependency_exe/tools2/rel/"+hostPlatformOffset+"main.o.d" |
|
187 |
] |
|
188 |
t.targets = hostPlatformTargets |
|
189 |
t.run(hostPlatform) |
|
190 |
||
191 |
# clean-up |
|
192 |
os.remove("smoke_suite/test_resources/dependencies/dependency.cpp") |
|
193 |
os.remove("smoke_suite/test_resources/dependencies/dependency.rss") |
|
194 |
||
195 |
t.id = "98" |
|
196 |
t.name = "dependencies" |
|
197 |
t.print_result() |
|
198 |
return t |
|
199 |