602
|
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],
|
|
89 |
[".*recipe name='resourcecompile'", 1]
|
|
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_"
|
|
130 |
t.command = """
|
|
131 |
sleep 1
|
|
132 |
touch smoke_suite/test_resources/dependencies/dependency.cpp
|
|
133 |
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
|
|
134 |
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
|
|
135 |
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
|
|
136 |
echo INVALIDATE_RESOURCE_DEPENDENCY_FILE >> """+buildLocation+"""/dependency__resource_apps_sc.rpp.d
|
|
137 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel
|
|
138 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel clean
|
|
139 |
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
|
|
140 |
t.mustmatch = []
|
|
141 |
t.countmatch = []
|
|
142 |
t.warnings = 0
|
|
143 |
t.errors = 1 # We expect an error from the first build due to the deliberate dependency file corruption
|
|
144 |
t.targets = hostPlatformTargets
|
|
145 |
t.run(hostPlatform)
|
|
146 |
|
|
147 |
|
|
148 |
t.id = "0098e"
|
|
149 |
t.name ="no_depend_include"
|
|
150 |
t.description = "Invalidate dependency files in order to confirm they aren't processed when --no-depend-include is used"
|
|
151 |
buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
|
|
152 |
t.command = """
|
|
153 |
sleep 1
|
|
154 |
touch smoke_suite/test_resources/dependencies/dependency.cpp
|
|
155 |
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
|
|
156 |
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
|
|
157 |
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
|
|
158 |
sbs --no-depend-include -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
|
|
159 |
t.errors = 0
|
|
160 |
t.targets = hostPlatformTargets
|
|
161 |
t.run(hostPlatform)
|
|
162 |
|
|
163 |
|
|
164 |
t.id = "0098f"
|
|
165 |
t.name ="no_depend_generate"
|
|
166 |
t.description = "Invalidate and remove dependency files in order to confirm they are neither included nor re-generated when --no-depend-generate is used"
|
|
167 |
buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
|
|
168 |
t.command = """
|
|
169 |
sleep 1
|
|
170 |
touch smoke_suite/test_resources/dependencies/dependency.cpp
|
|
171 |
touch smoke_suite/test_resources/dependencies/main.cpp
|
|
172 |
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
|
|
173 |
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
|
|
174 |
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
|
|
175 |
sbs --no-depend-generate -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
|
|
176 |
t.antitargets = [
|
|
177 |
buildLocation+"/armv5/urel/main.o.d",
|
|
178 |
buildLocation+"/armv5/udeb/main.o.d",
|
|
179 |
buildLocation+"/winscw/urel/main.o.d",
|
|
180 |
buildLocation+"/winscw/udeb/main.o.d",
|
|
181 |
buildLocation+"/dependency_exe/tools2/rel/"+hostPlatformOffset+"main.o.d"
|
|
182 |
]
|
|
183 |
t.targets = hostPlatformTargets
|
|
184 |
t.run(hostPlatform)
|
|
185 |
|
|
186 |
# clean-up
|
|
187 |
os.remove("smoke_suite/test_resources/dependencies/dependency.cpp")
|
|
188 |
os.remove("smoke_suite/test_resources/dependencies/dependency.rss")
|
|
189 |
|
|
190 |
t.id = "98"
|
|
191 |
t.name = "dependencies"
|
|
192 |
t.print_result()
|
|
193 |
return t
|
|
194 |
|