sbsv2/raptor/test/smoke_suite/longpath.py
author jjkang
Fri, 25 Jun 2010 19:56:45 +0800
changeset 604 b33dd54aaa52
parent 602 3145852acc89
permissions -rw-r--r--
add cpptoolsplat
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# Description: 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
from raptor_tests import SmokeTest
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
def run():
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
	# Content for files to be generated.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
	cpp = "longerfilenamethanyoumightnormallyexpecttobepresent"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
	path = "/test/smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
	path_eabi = "/test/smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/eabi/"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
	# Some numbers for path and file operations
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
	cppStart = 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
	cppStop = 49
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
	import os
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
	import shutil
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
	import sys
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
	# Find SBS_Home
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
	sbsHome = os.environ["SBS_HOME"]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
	# Create directories for both Linux and Windows
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
	d = os.path.dirname(sbsHome + path)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
	if not os.path.exists(d):
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
		os.makedirs(d)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
		
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
	d = os.path.dirname(sbsHome + path_eabi)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
	if not os.path.exists(d):
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
		os.makedirs(d)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
	# File generating utility
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
	while cppStart <= cppStop:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
			t = str(cppStart)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
			filename = sbsHome + path + 'test' + '%02d' %cppStart + '.cpp'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
			content = 'int x' + t + ' = 0;'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
			cppStart = cppStart + 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
			f = open (filename, 'w')
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
			f.write (content + '\n')
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
			f.close()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
	cppStart = cppStart + 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
	# File copying utility
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
	#------------------------------------------------------------------------------
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
	dirname = sbsHome + '/test/smoke_suite/test_resources/long/paths/'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
	cpp = dirname + 'test.cpp'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
	bld = dirname + 'bld.inf'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
	deftest = dirname + 'deftest.mmp'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
	e32def = dirname + 'e32def.h'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
	deftestu = dirname + 'deftestu.def'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
	dst_cpp = sbsHome + path + 'test.cpp'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
	dst_bld = sbsHome + path + 'bld.inf'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
	dst_deftest = sbsHome + path + 'deftest.mmp'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
	dst_e32def = sbsHome + path + 'e32def.h'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
	dst_deftestu = sbsHome + path_eabi + 'deftestu.def'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
		
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
	if os.path.exists(dst_cpp):
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
		pass
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
	else:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
		shutil.copy(cpp, dst_cpp)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
		shutil.copy(bld, dst_bld)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
		shutil.copy(deftest, dst_deftest)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
		shutil.copy(e32def, dst_e32def)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
		shutil.copy(deftestu , dst_deftestu)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
		dirname = sbsHome + path
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
		
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
	t = SmokeTest()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
	t.id = "41"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
	t.name = "longpath"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
	t.command = "sbs -b " + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
			"smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/bld.inf" + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
			" -c armv5"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
	t.targets = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
		"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll.sym",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
		"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll.sym",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
		"$(EPOCROOT)/epoc32/release/armv5/lib/deftest{000a0000}.dso",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
		"$(EPOCROOT)/epoc32/release/armv5/lib/deftest.dso",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
		"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
		"$(EPOCROOT)/epoc32/release/armv5/udeb/deftest.dll.map",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
		"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
		"$(EPOCROOT)/epoc32/release/armv5/urel/deftest.dll.map"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
	t.addbuildtargets('smoke_suite/test_resources/longerpathnamesthanyoumightnormallyexpectinabuildtree/anotherlevelwithareallyreallyreallylongnamethistimeprobablyabitoverthetop/bld.inf', [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
		"deftest_/armv5/udeb/deftest_udeb_objects.via",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
		"deftest_/armv5/udeb/test.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
		"deftest_/armv5/udeb/test09.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
		"deftest_/armv5/udeb/test19.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
		"deftest_/armv5/udeb/test29.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
		"deftest_/armv5/udeb/test39.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
		"deftest_/armv5/udeb/test49.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
		"deftest_/armv5/urel/deftest_urel_objects.via",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
		"deftest_/armv5/urel/test.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
		"deftest_/armv5/urel/test09.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
		"deftest_/armv5/urel/test19.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
		"deftest_/armv5/urel/test29.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
		"deftest_/armv5/urel/test39.o",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
		"deftest_/armv5/urel/test49.o"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
	])
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
	t.run()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
	return t