3
|
1 |
#
|
|
2 |
# Copyright (c) 2009 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 SmokeTest
|
|
18 |
|
|
19 |
def run():
|
|
20 |
|
|
21 |
#------------------------------------------------------------------------------
|
|
22 |
# Content for files to be generated.
|
|
23 |
#------------------------------------------------------------------------------
|
|
24 |
cpp = "longerfilenamethanyoumightnormallyexpecttobepresent"
|
|
25 |
path = "/test/smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/"
|
|
26 |
path_eabi = "/test/smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/eabi/"
|
|
27 |
|
|
28 |
#------------------------------------------------------------------------------
|
|
29 |
# Some numbers for path and file operations
|
|
30 |
#------------------------------------------------------------------------------
|
|
31 |
cppStart = 1
|
|
32 |
cppStop = 49
|
|
33 |
|
|
34 |
import os
|
|
35 |
import shutil
|
|
36 |
import sys
|
|
37 |
|
|
38 |
#------------------------------------------------------------------------------
|
|
39 |
# Find SBS_Home
|
|
40 |
#------------------------------------------------------------------------------
|
|
41 |
sbsHome = os.environ["SBS_HOME"]
|
|
42 |
|
|
43 |
#------------------------------------------------------------------------------
|
|
44 |
# Create directories for both Linux and Windows
|
|
45 |
#------------------------------------------------------------------------------
|
|
46 |
d = os.path.dirname(sbsHome + path)
|
|
47 |
if not os.path.exists(d):
|
|
48 |
os.makedirs(d)
|
|
49 |
|
|
50 |
d = os.path.dirname(sbsHome + path_eabi)
|
|
51 |
if not os.path.exists(d):
|
|
52 |
os.makedirs(d)
|
|
53 |
|
|
54 |
#------------------------------------------------------------------------------
|
|
55 |
# File generating utility
|
|
56 |
#------------------------------------------------------------------------------
|
|
57 |
while cppStart <= cppStop:
|
|
58 |
t = str(cppStart)
|
|
59 |
filename = sbsHome + path + 'test' + '%02d' %cppStart + '.cpp'
|
|
60 |
content = 'int x' + t + ' = 0;'
|
|
61 |
cppStart = cppStart + 1
|
|
62 |
f = open (filename, 'w')
|
|
63 |
f.write (content + '\n')
|
|
64 |
f.close()
|
|
65 |
cppStart = cppStart + 1
|
|
66 |
|
|
67 |
#------------------------------------------------------------------------------
|
|
68 |
# File copying utility
|
|
69 |
#------------------------------------------------------------------------------
|
|
70 |
dirname = sbsHome + '/test/smoke_suite/test_resources/long/paths/'
|
|
71 |
cpp = dirname + 'test.cpp'
|
|
72 |
bld = dirname + 'bld.inf'
|
|
73 |
deftest = dirname + 'deftest.mmp'
|
|
74 |
e32def = dirname + 'e32def.h'
|
|
75 |
|
|
76 |
deftestu = dirname + 'deftestu.def'
|
|
77 |
distpol = dirname + 'distribution.policy.s60'
|
|
78 |
|
|
79 |
dst_cpp = sbsHome + path + 'test.cpp'
|
|
80 |
dst_bld = sbsHome + path + 'bld.inf'
|
|
81 |
dst_deftest = sbsHome + path + 'deftest.mmp'
|
|
82 |
dst_e32def = sbsHome + path + 'e32def.h'
|
|
83 |
dst_deftestu = sbsHome + path_eabi + 'deftestu.def'
|
|
84 |
dst_distpol = sbsHome + path_eabi + 'distribution.policy.s60'
|
|
85 |
|
|
86 |
|
|
87 |
if os.path.exists(dst_cpp):
|
|
88 |
pass
|
|
89 |
else:
|
|
90 |
shutil.copy(cpp, dst_cpp)
|
|
91 |
shutil.copy(bld, dst_bld)
|
|
92 |
shutil.copy(deftest, dst_deftest)
|
|
93 |
shutil.copy(e32def, dst_e32def)
|
|
94 |
shutil.copy(deftestu , dst_deftestu)
|
|
95 |
shutil.copy(distpol , dst_distpol)
|
|
96 |
dirname = sbsHome + path
|
|
97 |
|
|
98 |
t = SmokeTest()
|
|
99 |
t.id = "41"
|
|
100 |
t.name = "longpath"
|
|
101 |
t.command = "sbs -b " + \
|
|
102 |
"smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/bld.inf" + \
|
|
103 |
" -c armv5"
|
|
104 |
t.targets = [
|
|
105 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll.sym",
|
|
106 |
"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll.sym",
|
|
107 |
"$(EPOCROOT)/epoc32/release/armv5/lib/deftest{000a0000}.dso",
|
|
108 |
"$(EPOCROOT)/epoc32/release/armv5/lib/deftest.dso",
|
|
109 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll",
|
|
110 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll.map",
|
|
111 |
"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll",
|
|
112 |
"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll.map"
|
|
113 |
]
|
|
114 |
t.addbuildtargets('smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/bld.inf', [
|
|
115 |
"deftest_/armv5/udeb/deftest_udeb_objects.via",
|
|
116 |
"deftest_/armv5/udeb/test.o",
|
|
117 |
"deftest_/armv5/udeb/test09.o",
|
|
118 |
"deftest_/armv5/udeb/test19.o",
|
|
119 |
"deftest_/armv5/udeb/test29.o",
|
|
120 |
"deftest_/armv5/udeb/test39.o",
|
|
121 |
"deftest_/armv5/udeb/test49.o",
|
|
122 |
"deftest_/armv5/urel/deftest_urel_objects.via",
|
|
123 |
"deftest_/armv5/urel/test.o",
|
|
124 |
"deftest_/armv5/urel/test09.o",
|
|
125 |
"deftest_/armv5/urel/test19.o",
|
|
126 |
"deftest_/armv5/urel/test29.o",
|
|
127 |
"deftest_/armv5/urel/test39.o",
|
|
128 |
"deftest_/armv5/urel/test49.o"
|
|
129 |
])
|
|
130 |
t.run()
|
|
131 |
return t
|