591
|
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 |
|
|
78 |
dst_cpp = sbsHome + path + 'test.cpp'
|
|
79 |
dst_bld = sbsHome + path + 'bld.inf'
|
|
80 |
dst_deftest = sbsHome + path + 'deftest.mmp'
|
|
81 |
dst_e32def = sbsHome + path + 'e32def.h'
|
|
82 |
dst_deftestu = sbsHome + path_eabi + 'deftestu.def'
|
|
83 |
|
|
84 |
|
|
85 |
if os.path.exists(dst_cpp):
|
|
86 |
pass
|
|
87 |
else:
|
|
88 |
shutil.copy(cpp, dst_cpp)
|
|
89 |
shutil.copy(bld, dst_bld)
|
|
90 |
shutil.copy(deftest, dst_deftest)
|
|
91 |
shutil.copy(e32def, dst_e32def)
|
|
92 |
shutil.copy(deftestu , dst_deftestu)
|
|
93 |
dirname = sbsHome + path
|
|
94 |
|
|
95 |
t = SmokeTest()
|
|
96 |
t.id = "41"
|
|
97 |
t.name = "longpath"
|
|
98 |
t.command = "sbs -b " + \
|
|
99 |
"smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/bld.inf" + \
|
|
100 |
" -c armv5"
|
|
101 |
t.targets = [
|
|
102 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll.sym",
|
|
103 |
"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll.sym",
|
|
104 |
"$(EPOCROOT)/epoc32/release/armv5/lib/deftest{000a0000}.dso",
|
|
105 |
"$(EPOCROOT)/epoc32/release/armv5/lib/deftest.dso",
|
|
106 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll",
|
|
107 |
"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll.map",
|
|
108 |
"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll",
|
|
109 |
"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll.map"
|
|
110 |
]
|
|
111 |
t.addbuildtargets('smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/bld.inf', [
|
|
112 |
"deftest_/armv5/udeb/deftest_udeb_objects.via",
|
|
113 |
"deftest_/armv5/udeb/test.o",
|
|
114 |
"deftest_/armv5/udeb/test09.o",
|
|
115 |
"deftest_/armv5/udeb/test19.o",
|
|
116 |
"deftest_/armv5/udeb/test29.o",
|
|
117 |
"deftest_/armv5/udeb/test39.o",
|
|
118 |
"deftest_/armv5/udeb/test49.o",
|
|
119 |
"deftest_/armv5/urel/deftest_urel_objects.via",
|
|
120 |
"deftest_/armv5/urel/test.o",
|
|
121 |
"deftest_/armv5/urel/test09.o",
|
|
122 |
"deftest_/armv5/urel/test19.o",
|
|
123 |
"deftest_/armv5/urel/test29.o",
|
|
124 |
"deftest_/armv5/urel/test39.o",
|
|
125 |
"deftest_/armv5/urel/test49.o"
|
|
126 |
])
|
|
127 |
t.run()
|
|
128 |
return t
|