sbsv2/raptor/test/unit_suite/raptor_meta_unit.py
author yiluzhu
Tue, 25 May 2010 10:23:35 +0100
branchfix
changeset 570 971d2c670e06
parent 458 79718b9711e8
permissions -rw-r--r--
SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     1
#
458
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
     2
# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     3
# All rights reserved.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     4
# This component and the accompanying materials are made available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     6
# which accompanies this distribution, and is available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     8
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     9
# Initial Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    11
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    12
# Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    13
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    14
# Description: 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    15
# raptor_meta_unit module
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    16
# This module tests the classes forming the Raptor bld.inf and .mmp parsing support
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    17
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    18
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    19
import raptor
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    20
import raptor_meta
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    21
import raptor_utilities
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    22
import raptor_data
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    23
import mmpparser
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    24
import unittest
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    25
import generic_path
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    26
import os
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    27
import sys
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    28
import re
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    29
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    30
class TestRaptorMeta(unittest.TestCase):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    31
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    32
	def setUp(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    33
		self.raptor = raptor.Raptor()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    34
		self.__testRoot = generic_path.Path(os.environ[raptor.env], "test").Absolute()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    35
		self.__makefilePathTestRoot = self.__testRoot
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    36
		self.__epocroot = self.__testRoot
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    37
		self.__variant_cfg_root = self.__testRoot.Append('metadata/config')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    38
		self.__variant_cfg = self.__variant_cfg_root.Append('test_cfg.cfg')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    39
		self.__platmacros_armv5 = "ARMCC EPOC32 MARM EABI ARMCC_2 ARMCC_2_2 GENERIC_MARM MARM_ARMV5"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    40
		self.__platmacros_armv6 = "ARMCC EPOC32 MARM EABI ARMCC_2 ARMCC_2_2 GENERIC_MARM MARM_ARMV5 ARMV6"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    41
		self.__platmacros_armv7 = "ARMCC EPOC32 MARM EABI ARMCC_2 ARMCC_2_2 GENERIC_MARM MARM_ARMV5 ARMV7"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    42
		self.__platmacros_winscw = "CW32 WINS WINSCW"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    43
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    44
		self.variant_hrh = self.__testRoot.Append('metadata/include/test_hrh.hrh')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    45
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    46
		self.__OSRoot = ""
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    47
		if raptor_utilities.getOSFileSystem() == "cygwin":
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    48
			self.__OSRoot = str(self.__makefilePathTestRoot)[:2]
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    49
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    50
		# we need some sort of generic platform for preprocessing
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    51
		self.defaultPlatform = { 'PLATFORM': 'generic',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    52
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    53
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    54
							     'SYSTEMINCLUDE' : '',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    55
							     'id': 0,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    56
							     'key': '0000000000000000',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    57
							     'key_md5': '0000000000000000',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    58
							     'ISFEATUREVARIANT' : False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    59
							     'PLATMACROS' : self.__platmacros_armv5,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    60
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    61
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    62
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    63
		# For testing purposes, the ARMV5 platform is flagged here as feature variant.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    64
		# In metadata processing terms, this means that the location of the HRH file
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    65
		# is not automatically added to the SYSTEMINCLUDE path, and so is specified
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    66
		# directly.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    67
		self.ARMV5           = { 'PLATFORM': 'ARMV5',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    68
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    69
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    70
							     'SYSTEMINCLUDE' : str(self.variant_hrh.Dir()),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    71
							     'id': 1,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    72
							     'key': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    73
							     'key_md5': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    74
							     'ISFEATUREVARIANT' : True,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    75
							     'PLATMACROS' : self.__platmacros_armv5,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    76
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    77
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    78
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    79
		self.ARMV5SMP        = { 'PLATFORM': 'ARMV5SMP',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    80
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    81
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    82
							     'SYSTEMINCLUDE' : str(self.variant_hrh.Dir()),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    83
							     'id': 1,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    84
							     'key': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    85
							     'key_md5': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    86
							     'ISFEATUREVARIANT' : False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    87
							     'PLATMACROS' : self.__platmacros_armv5,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    88
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    89
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    90
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    91
		self.ARMV6           = { 'PLATFORM': 'ARMV6',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    92
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    93
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    94
							     'SYSTEMINCLUDE' : str(self.variant_hrh.Dir()),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    95
							     'id': 1,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    96
							     'key': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    97
							     'key_md5': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    98
							     'ISFEATUREVARIANT' : False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    99
							     'PLATMACROS' : self.__platmacros_armv6,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   100
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   101
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   102
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   103
		self.ARMV7           = { 'PLATFORM': 'ARMV7',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   104
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   105
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   106
							     'SYSTEMINCLUDE' : str(self.variant_hrh.Dir()),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   107
							     'id': 1,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   108
							     'key': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   109
							     'key_md5': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   110
							     'ISFEATUREVARIANT' : False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   111
							     'PLATMACROS' : self.__platmacros_armv7,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   112
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   113
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   114
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   115
		self.ARMV7SMP         = { 'PLATFORM': 'ARMV7SMP',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   116
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   117
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   118
							     'SYSTEMINCLUDE' : str(self.variant_hrh.Dir()),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   119
							     'id': 1,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   120
							     'key': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   121
							     'key_md5': '1111111111111111',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   122
							     'ISFEATUREVARIANT' : False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   123
							     'PLATMACROS' : self.__platmacros_armv7,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   124
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   125
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   126
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   127
		self.WINSCW          = { 'PLATFORM': 'WINSCW',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   128
							     'EPOCROOT': self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   129
							     'VARIANT_HRH': self.variant_hrh,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   130
							     'SYSTEMINCLUDE' : '',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   131
							     'id': 2,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   132
							     'key': '2222222222222222',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   133
							     'key_md5': '2222222222222222',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   134
							     'ISFEATUREVARIANT' : False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   135
							     'PLATMACROS' : self.__platmacros_winscw,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   136
								 'SBS_BUILD_DIR' : str(self.__epocroot) + "/epoc32/build",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   137
								 'METADEPS' : [] 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   138
							   }
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   139
				
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   140
		self.testPlats = [self.ARMV5, self.ARMV5SMP, self.ARMV6, self.ARMV7, self.ARMV7SMP, self.WINSCW]
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   141
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   142
		# Get the version of CPP that we are using and hope it's correct
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   143
		# since there is no tool check.
32
fdfc59a2ae7e fix for broken cpp location
Richard Taylor <richard.i.taylor@nokia.com>
parents: 5
diff changeset
   144
		if os.environ.has_key('SBS_GNUCPP'):
fdfc59a2ae7e fix for broken cpp location
Richard Taylor <richard.i.taylor@nokia.com>
parents: 5
diff changeset
   145
			self.__gnucpp = os.environ['SBS_GNUCPP']
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   146
		else: 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   147
			self.__gnucpp = "cpp" 
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   148
	
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   149
	def testPreProcessor(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   150
		# Just test for correct behaviour on failure, other tests excercise correct behaviour on success
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   151
		preProcessor = raptor_meta.PreProcessor('cpp_that_does_not_exist', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   152
											    '-undef -nostdinc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   153
											    '-I', '-D', '-include',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   154
											    self.raptor)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   155
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   156
		try:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   157
			 preProcessor.preprocess()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   158
		except Exception, e:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   159
			self.assertTrue(isinstance(e, raptor_meta.MetaDataError))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   160
			self.assertTrue(re.match('^Preprocessor exception', e.Text))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   161
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   162
	def testConfigParsing(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   163
		# .cfg file specified, but does not exist		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   164
		try:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   165
			configDetails = raptor_meta.getVariantCfgDetail(self.__epocroot, 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   166
														    self.__variant_cfg_root.Append("missing"))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   167
		except Exception, e:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   168
			self.assertTrue(isinstance(e, raptor_meta.MetaDataError))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   169
			self.assertTrue(re.match('^Could not read variant configuration file.*$', e.Text))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   170
			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   171
		# No .hrh file specified
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   172
		try:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   173
			configDetails = raptor_meta.getVariantCfgDetail(self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   174
														    self.__variant_cfg_root.Append("empty_cfg.cfg"))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   175
		except Exception, e:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   176
			self.assertTrue(isinstance(e, raptor_meta.MetaDataError))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   177
			self.assertTrue(re.match('No variant file specified in .*', e.Text))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   178
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   179
		# .hrh file does not exist
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   180
		try:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   181
			configDetails = raptor_meta.getVariantCfgDetail(self.__epocroot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   182
														    self.__variant_cfg_root.Append("invalid_cfg.cfg"))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   183
		except Exception, e:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   184
			self.assertTrue(isinstance(e, raptor_meta.MetaDataError))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   185
			self.assertTrue(re.match('Variant file .* does not exist', e.Text))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   186
				
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   187
		# Valid .cfg file
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   188
		configDetails = raptor_meta.getVariantCfgDetail(self.__epocroot, 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   189
													    self.__variant_cfg)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   190
		self.failUnless(configDetails)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   191
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   192
		found_variant_hrh = str(configDetails.get('VARIANT_HRH'))	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   193
		expected_variant_hrh = str(self.variant_hrh)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   194
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   195
		self.assertEqual(found_variant_hrh, expected_variant_hrh)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   196
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   197
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   198
	def __testBuildPlatforms(self, aRootBldInfLocation, aBldInfFile, 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   199
							 aExpectedBldInfPlatforms, aExpectedBuildablePlatforms):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   200
		bldInfFile = aRootBldInfLocation.Append(aBldInfFile)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   201
		self.failUnless(bldInfFile)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   202
		
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   203
		depfiles=[]
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   204
		bldInfObject = raptor_meta.BldInfFile(bldInfFile, self.__gnucpp, depfiles=depfiles, log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   205
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   206
		bp = bldInfObject.getBuildPlatforms(self.defaultPlatform)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   207
		self.assertEquals(bp, aExpectedBldInfPlatforms)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   208
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   209
		buildableBldInfBuildPlatforms = raptor_meta.getBuildableBldInfBuildPlatforms(bp,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   210
				'ARMV5 ARMV7 WINSCW',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   211
				'ARMV5 ARMV5SMP ARMV7 WINSCW',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   212
				'ARMV5 ARMV7 WINSCW')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   213
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   214
		for expectedBuildablePlatform in aExpectedBuildablePlatforms:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   215
			self.assertTrue(expectedBuildablePlatform in buildableBldInfBuildPlatforms)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   216
			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   217
		self.assertEqual(len(aExpectedBuildablePlatforms),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   218
						 len(buildableBldInfBuildPlatforms))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   219
		return
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   220
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   221
	def testBldInfPlatformDeduction(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   222
		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   223
				
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   224
		self.__testBuildPlatforms(bldInfTestRoot, 'no_prj_platforms.inf', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   225
								  [], ['ARMV7', 'ARMV5', 'WINSCW', 'GCCXML'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   226
		self.__testBuildPlatforms(bldInfTestRoot, 'no_plats.inf', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   227
								  [], ['ARMV7', 'ARMV5', 'WINSCW', 'GCCXML'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   228
		self.__testBuildPlatforms(bldInfTestRoot, 'default_plats.inf', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   229
								  ['DEFAULT'], ['ARMV7', 'ARMV5', 'WINSCW', 'GCCXML'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   230
		self.__testBuildPlatforms(bldInfTestRoot, 'default_plats_minus_plat.inf', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   231
								  ['DEFAULT', '-WINSCW'], ['ARMV7', 'ARMV5', 'GCCXML'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   232
		self.__testBuildPlatforms(bldInfTestRoot, 'single_plat.inf', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   233
								  ['ARMV5'], ['ARMV5', 'GCCXML'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   234
		self.__testBuildPlatforms(bldInfTestRoot, 'multiple_plats.inf', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   235
								  ['ARMV5', 'WINSCW', 'TOOLS'], ['ARMV5', 'WINSCW', 'TOOLS', 'GCCXML'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   236
		return
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   237
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   238
	def __testBldInfTestCode(self, aTestRoot, aBldInf, aActual, aExpected):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   239
		loop_number = 0
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   240
		for actual in aActual:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   241
			self.assertEquals(actual, aExpected[loop_number])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   242
			loop_number += 1
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   243
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   244
	def testBldInfTestType(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   245
		bldInfTestRoot = self.__testRoot.Append('metadata/project/mmps/test_mmps')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   246
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   247
		bldInfFile = bldInfTestRoot.Append('test_mmps.inf')
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   248
		depfiles = []
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   249
		bldInfObject = raptor_meta.BldInfFile(bldInfFile, self.__gnucpp, depfiles=depfiles, log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   250
		testArmv5Platform = self.ARMV5
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   251
		testArmv5Platform["TESTCODE"] = True
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   252
		bldInfObject.getRomTestType(testArmv5Platform)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   253
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   254
		self.__testBldInfTestCode(bldInfTestRoot, 'test_mmps.inf',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   255
				[bldInfObject.testManual, bldInfObject.testAuto], [1, 1])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   256
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   257
	def __testExport(self, aExportObject, aSource, aDestination, aAction):			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   258
		self.assertEquals(aExportObject.getSource(), aSource)
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   259
		self.assertEqualsOrContainsPath(aExportObject.getDestination(), aDestination)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   260
		self.assertEquals(aExportObject.getAction(), aAction)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   261
	
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   262
	def assertEqualsOrContainsPath(self, aRequirement, aCandidate):
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   263
		# If aRequirement is a list, which it might well be, we should
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   264
		# assert that aPathString is contained in it
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   265
		# If aRequirement not a list, it will be a string, and 
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   266
		# we should assert equality of the strings
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   267
		# On windows we shouldn't care about the case of the drive letter.
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   268
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   269
		if isinstance(aRequirement, list):
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   270
			pathsequal = False
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   271
			for r in aRequirement:
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   272
				pathsequal = path_compare_notdrivelettercase(r,aCandidate) or pathsequal
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   273
			self.assertTrue(pathsequal)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   274
		else:
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   275
			self.assertTrue(path_compare_notdrivelettercase(aRequirement,aCandidate))
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   276
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   277
	def testBldInfExports(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   278
		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   279
		bldInfMakefilePathTestRoot = str(self.__makefilePathTestRoot) + '/metadata/project/'
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   280
		
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   281
		depfiles = []
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   282
		bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('exports.inf'), 
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   283
											  self.__gnucpp, depfiles=depfiles, log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   284
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   285
		exports = bldInfObject.getExports(self.defaultPlatform)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   286
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   287
		# export1.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   288
		self.__testExport(exports[0], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   289
						  bldInfMakefilePathTestRoot+'bld.infs/export1.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   290
						  '$(EPOCROOT)/epoc32/include/export1.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   291
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   292
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   293
		# export2.h				export_test\export2.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   294
		self.__testExport(exports[1], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   295
						  bldInfMakefilePathTestRoot+'bld.infs/export2.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   296
						  '$(EPOCROOT)/epoc32/include/export_test/export2.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   297
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   298
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   299
		# export3.h				..\export_test\export3.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   300
		self.__testExport(exports[2], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   301
						  bldInfMakefilePathTestRoot+'bld.infs/export3.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   302
						  '$(EPOCROOT)/epoc32/export_test/export3.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   303
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   304
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   305
		# export4.h				\export_test_abs\export4.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   306
		self.__testExport(exports[3], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   307
						  bldInfMakefilePathTestRoot+'bld.infs/export4.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   308
						  self.__OSRoot+'/export_test_abs/export4.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   309
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   310
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   311
		# export5.h				\epoc32\export_test_abs\export5.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   312
		self.__testExport(exports[4], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   313
						  bldInfMakefilePathTestRoot+'bld.infs/export5.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   314
						  '$(EPOCROOT)/epoc32/export_test_abs/export5.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   315
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   316
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   317
		# export6.h				|..\export_test_rel\export6.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   318
		self.__testExport(exports[5], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   319
						  bldInfMakefilePathTestRoot+'bld.infs/export6.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   320
						  bldInfMakefilePathTestRoot+'export_test_rel/export6.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   321
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   322
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   323
		# export6.h				|\export_test_rel\export7.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   324
		self.__testExport(exports[6], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   325
						  bldInfMakefilePathTestRoot+'bld.infs/export7.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   326
						  bldInfMakefilePathTestRoot+'bld.infs/export_test_rel/export7.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   327
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   328
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   329
		# export7.h				|export_test_rel\export8.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   330
		self.__testExport(exports[7], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   331
						  bldInfMakefilePathTestRoot+'bld.infs/export8.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   332
						  bldInfMakefilePathTestRoot+'bld.infs/export_test_rel/export8.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   333
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   334
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   335
		# :zip export9.zip
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   336
		self.__testExport(exports[8], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   337
						  bldInfMakefilePathTestRoot+'bld.infs/export9.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   338
						  '$(EPOCROOT)', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   339
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   340
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   341
		# :zip export10.zip		export_test
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   342
		self.__testExport(exports[9], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   343
						  bldInfMakefilePathTestRoot+'bld.infs/export10.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   344
						  '$(EPOCROOT)/export_test', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   345
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   346
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   347
		# :zip export11.zip		/export_test
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   348
		self.__testExport(exports[10], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   349
						  bldInfMakefilePathTestRoot+'bld.infs/export11.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   350
						  self.__OSRoot+'/export_test', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   351
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   352
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   353
		# :zip export12.zip		/epoc32/export_test
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   354
		self.__testExport(exports[11], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   355
						  bldInfMakefilePathTestRoot+'bld.infs/export12.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   356
						  '$(EPOCROOT)/epoc32/export_test', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   357
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   358
 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   359
		# export13.rsc			z:/resource/app/export13.rsc
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   360
		# Once for each of the three locations for emulated drives
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   361
		# epoc32/data/z/resource/app/export13.rsc *and* in
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   362
		# epoc32/release/winscw/udeb/z/resource/app/export13.rsc *and* in
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   363
		# epoc32/release/winscw/urel/z/resource/app/export13.rsc
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   364
		self.__testExport(exports[12], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   365
						  bldInfMakefilePathTestRoot+'bld.infs/export13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   366
						  '$(EPOCROOT)/epoc32/data/z/resource/app/export13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   367
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   368
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   369
		self.__testExport(exports[12], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   370
						  bldInfMakefilePathTestRoot+'bld.infs/export13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   371
						  '$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/app/export13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   372
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   373
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   374
		self.__testExport(exports[12], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   375
						  bldInfMakefilePathTestRoot+'bld.infs/export13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   376
						  '$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/app/export13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   377
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   378
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   379
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   380
		testExports = bldInfObject.getTestExports(self.defaultPlatform)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   381
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   382
		# testexport1.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   383
		self.__testExport(testExports[0], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   384
						  bldInfMakefilePathTestRoot+'bld.infs/testexport1.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   385
						  bldInfMakefilePathTestRoot+'bld.infs/testexport1.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   386
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   387
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   388
		# testexport2.h				export_test_rel\testexport2.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   389
		self.__testExport(testExports[1], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   390
						  bldInfMakefilePathTestRoot+'bld.infs/testexport2.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   391
						  bldInfMakefilePathTestRoot+'bld.infs/export_test_rel/testexport2.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   392
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   393
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   394
		# testexport3.h				..\export_test_rel\testexport3.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   395
		self.__testExport(testExports[2], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   396
						  bldInfMakefilePathTestRoot+'bld.infs/testexport3.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   397
						  bldInfMakefilePathTestRoot+'export_test_rel/testexport3.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   398
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   399
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   400
		# testexport4.h				\export_test_abs\testexport4.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   401
		self.__testExport(testExports[3], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   402
						  bldInfMakefilePathTestRoot+'bld.infs/testexport4.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   403
						  self.__OSRoot+'/export_test_abs/testexport4.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   404
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   405
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   406
		# testexport5.h				\epoc32\export_test_abs\testexport5.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   407
		self.__testExport(testExports[4], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   408
						  bldInfMakefilePathTestRoot+'bld.infs/testexport5.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   409
						  '$(EPOCROOT)/epoc32/export_test_abs/testexport5.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   410
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   411
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   412
		# testexport6.h				|..\export_test_rel\testexport6.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   413
		self.__testExport(testExports[5], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   414
						  bldInfMakefilePathTestRoot+'bld.infs/testexport6.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   415
						  bldInfMakefilePathTestRoot+'export_test_rel/testexport6.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   416
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   417
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   418
		# testexport7.h				|\export_test_rel\testexport7.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   419
		self.__testExport(testExports[6], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   420
						  bldInfMakefilePathTestRoot+'bld.infs/testexport7.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   421
						  bldInfMakefilePathTestRoot+'bld.infs/export_test_rel/testexport7.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   422
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   423
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   424
		# testexport8.h				|export_test_rel\testexport8.h
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   425
		self.__testExport(testExports[7], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   426
						  bldInfMakefilePathTestRoot+'bld.infs/testexport8.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   427
						  bldInfMakefilePathTestRoot+'bld.infs/export_test_rel/testexport8.h', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   428
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   429
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   430
		# :zip testexport9.zip
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   431
		self.__testExport(testExports[8], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   432
						  bldInfMakefilePathTestRoot+'bld.infs/testexport9.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   433
						  '$(EPOCROOT)', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   434
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   435
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   436
		# :zip testexport10.zip		export_test
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   437
		self.__testExport(testExports[9], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   438
						  bldInfMakefilePathTestRoot+'bld.infs/testexport10.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   439
						  '$(EPOCROOT)/export_test', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   440
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   441
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   442
		# :zip testexport11.zip		/export_test
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   443
		self.__testExport(testExports[10], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   444
						  bldInfMakefilePathTestRoot+'bld.infs/testexport11.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   445
						  self.__OSRoot+'/export_test', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   446
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   447
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   448
		# :zip testexport12.zip		/epoc32/export_test
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   449
		self.__testExport(testExports[11], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   450
						  bldInfMakefilePathTestRoot+'bld.infs/testexport12.zip', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   451
						  '$(EPOCROOT)/epoc32/export_test', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   452
						  'unzip')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   453
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   454
		# testexport13.rsc		z:/resource/app/testexport13.rsc
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   455
		# Once for each of the three locations for emulated drives
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   456
		# epoc32/data/z/resource/app/testexport13.rsc *and* in
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   457
		# epoc32/release/winscw/udeb/z/resource/app/testexport13.rsc *and* in
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   458
		# epoc32/release/winscw/urel/z/resource/app/testexport13.rsc
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   459
		self.__testExport(testExports[12], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   460
						  bldInfMakefilePathTestRoot+'bld.infs/testexport13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   461
						  '$(EPOCROOT)/epoc32/data/z/resource/app/testexport13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   462
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   463
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   464
		self.__testExport(testExports[12], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   465
						  bldInfMakefilePathTestRoot+'bld.infs/testexport13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   466
						  '$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/app/testexport13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   467
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   468
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   469
		self.__testExport(testExports[12], 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   470
						  bldInfMakefilePathTestRoot+'bld.infs/testexport13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   471
						  '$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/app/testexport13.rsc', 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   472
						  'copy')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   473
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   474
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   475
	def __testExtension(self, aExtensionObject, aMakefile, aTestParameters):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   476
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   477
		templateExtensionRoot = ""
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   478
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   479
		if not aMakefile.startswith("$("):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   480
			templateExtensionRoot = '$(MAKEFILE_TEMPLATES)/'
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   481
			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   482
		self.assertEquals(aExtensionObject.getMakefile(), templateExtensionRoot+aMakefile)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   483
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   484
		testOptions = aExtensionObject.getOptions()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   485
		testVariables = aExtensionObject.getStandardVariables()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   486
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   487
		for testParameter in aTestParameters.keys():
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   488
			if (testParameter.startswith("STDVAR_")):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   489
				stdvar = testParameter.replace("STDVAR_", "")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   490
				stdvalue = aTestParameters.get(testParameter)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   491
				self.assertTrue(testVariables.has_key(stdvar))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   492
				self.assertEquals(testVariables.get(stdvar), aTestParameters.get(testParameter))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   493
			else:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   494
				self.assertTrue(testOptions.has_key(testParameter))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   495
				self.assertEquals(testOptions.get(testParameter), aTestParameters.get(testParameter))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   496
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   497
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   498
	def testBldInfExtensions(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   499
		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   500
		bldInfMakefilePathTestRoot = str(self.__makefilePathTestRoot)+'/metadata/project/bld.infs'			
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   501
		if 'SRCROOT' in os.environ:
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   502
			srcroot = os.environ['SRCROOT']
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   503
		else:
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   504
			srcroot = os.environ['SRCROOT'] = "x:/somesrcroot"
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   505
		
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   506
		depfiles = []
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   507
		bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('extensions.inf'),
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   508
											  self.__gnucpp, depfiles=depfiles, log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   509
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   510
		extensions = bldInfObject.getExtensions(self.ARMV5)
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   511
				
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   512
		self.__testExtension(extensions[0],
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   513
							'test/dummyextension1.mk',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   514
							{'TARGET':'dummyoutput1.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   515
							'SOURCES':'dummysource11.cpp dummysource12.cpp dummysource13.cpp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   516
							'DEPENDENCIES':'dummylib11.lib dummylib12.lib',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   517
							'TOOL':'dummytool1.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   518
							'OPTION11':'option11value',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   519
							'OPTION12':'$(MAKE_VAR)',
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   520
							'STDVAR_TO_ROOT':srcroot,
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   521
							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   522
							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   523
							)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   524
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   525
		self.__testExtension(extensions[1],
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   526
							'test/dummyextension2.mk',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   527
							{'TARGET':'dummyoutput2.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   528
							'SOURCES':'dummysource21.cpp dummysource22.cpp dummysource23.cpp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   529
							'DEPENDENCIES':'dummylib21.lib dummylib22.lib',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   530
							'TOOL':'dummytool2.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   531
							'OPTION21':'option21value',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   532
							'OPTION22':'$(MAKE_VAR)',
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   533
							'STDVAR_TO_ROOT':srcroot,
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   534
							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   535
							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   536
							)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   537
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   538
		self.__testExtension(extensions[2],
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   539
							'$(' + raptor.env + ')/test/dummyextension3.mk',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   540
							{'TARGET':'dummyoutput3.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   541
							'SOURCES':'dummysource31.cpp dummysource32.cpp dummysource33.cpp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   542
							'DEPENDENCIES':'dummylib31.lib dummylib32.lib',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   543
							'TOOL':'dummytool3.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   544
							'OPTION31':'option31value',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   545
							'OPTION32':'$(MAKE_VAR)',
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   546
							'STDVAR_TO_ROOT':srcroot,
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   547
							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   548
							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   549
							)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   550
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   551
		testExtensions = bldInfObject.getTestExtensions(self.ARMV5)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   552
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   553
		self.__testExtension(testExtensions[0],
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   554
							'test/dummytestextension1.mk',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   555
							{'TARGET':'dummytestoutput1.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   556
							'SOURCES':'dummytestsource11.cpp dummytestsource12.cpp dummytestsource13.cpp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   557
							'DEPENDENCIES':'dummytestlib11.lib dummytestlib12.lib',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   558
							'TOOL':'dummytesttool1.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   559
							'OPTIONTEST11':'optiontest11value',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   560
							'OPTIONTEST12':'$(MAKE_VAR)',
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   561
							'STDVAR_TO_ROOT':srcroot,
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   562
							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   563
							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   564
							)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   565
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   566
		self.__testExtension(testExtensions[1],
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   567
							'test/dummytestextension2.mk',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   568
							{'TARGET':'dummytestoutput2.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   569
							'SOURCES':'dummytestsource21.cpp dummytestsource22.cpp dummytestsource23.cpp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   570
							'DEPENDENCIES':'dummytestlib21.lib dummytestlib22.lib',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   571
							'TOOL':'dummytesttool2.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   572
							'OPTIONTEST21':'optiontest21value',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   573
							'OPTIONTEST22':'$(MAKE_VAR)',
570
971d2c670e06 SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
yiluzhu
parents: 458
diff changeset
   574
							'STDVAR_TO_ROOT':srcroot,
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   575
							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   576
							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   577
							)
458
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   578
	
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   579
	def testBadBldInfs(self):
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   580
		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   581
		depfiles=[]
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   582
		
458
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   583
		class BadBldInfLogger(object):
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   584
			"mock logger to capture Error messages from the parser."
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   585
			
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   586
			def __init__(self):
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   587
				self.errors = []
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   588
				self.debugOutput = False
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   589
				
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   590
			def Error(self, format, *extras, **attributes):
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   591
				self.errors.append( ((format % extras), attributes) )
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   592
		
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   593
			def Debug(self, format, *extras, **attributes):
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   594
				pass
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   595
				
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   596
		logger = BadBldInfLogger()
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   597
		
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   598
		# this bld.inf has END lines with no matching START
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   599
		bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('bad_lone_end.inf'),
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   600
											  self.__gnucpp, depfiles=depfiles, 
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   601
											  log=logger)
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   602
		
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   603
		# the PRJ_EXTENSIONS section is bad for ARMV5
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   604
		extensions = bldInfObject.getExtensions(self.ARMV5)
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   605
		#
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   606
		self.assertEquals(len(logger.errors), 1)
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   607
		err = logger.errors[0]
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   608
		self.assertEquals(err[0], "unmatched END statement in PRJ_EXTENSIONS section")
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   609
		self.assertTrue("bldinf" in err[1])
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   610
		self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   611
		
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   612
		# the PRJ_TESTEXTENSIONS section is bad for WINSCW
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   613
		testextensions = bldInfObject.getTestExtensions(self.WINSCW)
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   614
		#
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   615
		self.assertEquals(len(logger.errors), 2)
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   616
		err = logger.errors[1]
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   617
		self.assertEquals(err[0], "unmatched END statement in PRJ_TESTEXTENSIONS section")
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   618
		self.assertTrue("bldinf" in err[1])
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   619
		self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
79718b9711e8 fix for bug 2297 : traceback on unmatched END in a bld.inf
Richard Taylor <richard.i.taylor@nokia.com>
parents: 135
diff changeset
   620
			
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   621
	def testBldInfIncludes(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   622
		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs/includes')
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   623
		depfiles=[]
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   624
		bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('top_level.inf'),
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   625
											  self.__gnucpp, depfiles=depfiles, log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   626
		Root = str(bldInfTestRoot)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   627
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   628
		mmpFiles = bldInfObject.getMMPList(self.ARMV5)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   629
		self.assertEquals(len(mmpFiles['mmpFileList']), 3)	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   630
		self.assertEquals(str(mmpFiles['mmpFileList'][0].filename), Root + "/dir3/down_dir.mmp")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   631
		self.assertEquals(str(mmpFiles['mmpFileList'][1].filename), Root + "/dir1/dir2/up_dir.mmp")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   632
		self.assertEquals(str(mmpFiles['mmpFileList'][2].filename), Root + "/top_level.mmp")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   633
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   634
		exports = bldInfObject.getExports(self.ARMV5)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   635
		self.assertEquals(exports[0].getSource(), Root + "/dir3/down_dir_export_source.h")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   636
		self.assertEquals(exports[1].getSource(), Root + "/dir1/dir2/up_dir_export_source.h")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   637
		self.assertEquals(exports[2].getSource(), Root + "/top_level_export_source.h")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   638
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   639
	def testMmpIncludes(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   640
		mmpTestRoot = self.__testRoot.Append('metadata/project/mmps/includes')
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   641
		mmpMakefilePathTestRoot = str(self.__makefilePathTestRoot)+'/metadata/project/mmps/includes'
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   642
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   643
		depfiles=[]
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   644
		bldInfObject = raptor_meta.BldInfFile(mmpTestRoot.Append('top_level.inf'),
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   645
										 self.__gnucpp, depfiles=depfiles, log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   646
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   647
		mmpFiles = bldInfObject.getMMPList(self.ARMV5)
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   648
		mmpdeps = []
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   649
		mmpFile = raptor_meta.MMPFile(mmpFiles['mmpFileList'][0].filename, 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   650
										   self.__gnucpp,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   651
										   bldInfObject,
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   652
									           depfiles=mmpdeps,
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   653
										   log=self.raptor)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   654
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   655
		self.assertEquals(str(mmpFile.filename), 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   656
						  str(mmpTestRoot.Append("top_level.mmp")))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   657
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   658
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   659
		mmpContent = mmpFile.getContent(self.ARMV5)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   660
		mmpBackend = raptor_meta.MMPRaptorBackend(None, str(mmpFile.filename), str(bldInfObject.filename))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   661
		mmpParser = mmpparser.MMPParser(mmpBackend)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   662
		parseresult = None
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   663
		try:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   664
			parseresult = mmpParser.mmp.parseString(mmpContent)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   665
		except Exception,e:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   666
			pass
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   667
			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   668
		self.assertTrue(parseresult)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   669
		self.assertEquals(parseresult[0],'MMP')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   670
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   671
		mmpBackend.finalise(self.ARMV5)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   672
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   673
		var = mmpBackend.BuildVariant
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   674
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   675
		sources = []
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   676
		for i in var.ops:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   677
			if i.name == "SOURCE":
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   678
				sources.extend(i.value.split(" "))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   679
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   680
		self.assertTrue((mmpMakefilePathTestRoot+'/top_level.cpp') in sources)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   681
		self.assertTrue((mmpMakefilePathTestRoot+'/dir1/dir2/up_dir.cpp') in sources)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   682
		self.assertTrue((mmpMakefilePathTestRoot+'/dir3/down_dir.cpp') in sources)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   683
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   684
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   685
	def testDefFileResolution(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   686
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   687
		class DefFileTest(object):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   688
			""" Test resolveDefFile for a particular set of mmp options """
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   689
			def __init__(self, resolveddeffile, mmpfilename, deffilekeyword, target, nostrictdef, platform):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   690
				self.resolveddeffile = resolveddeffile
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   691
				self.mmpfilename=mmpfilename
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   692
				self.deffilekeyword=deffilekeyword
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   693
				self.target=target
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   694
				self.nostrictdef = nostrictdef
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   695
				self.platform = platform
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   696
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   697
			def test(self, raptor):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   698
				m = raptor_meta.MMPRaptorBackend(raptor, self.mmpfilename, "")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   699
				m.deffile = self.deffilekeyword
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   700
				m.nostrictdef = self.nostrictdef
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   701
				f = m.resolveDefFile(self.target, self.platform)
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   702
				
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   703
				return path_compare_notdrivelettercase(self.resolveddeffile,f)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   704
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   705
		defFileTests = []
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   706
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   707
		for testPlat in self.testPlats:			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   708
			epocroot = str(testPlat['EPOCROOT'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   709
			releaseDir = testPlat['PLATFORM'].lower()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   710
			defFileDir = "eabi"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   711
			if testPlat['PLATFORM'] == "WINSCW":
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   712
				defFileDir = "bwins"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   713
							
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   714
			defFileTests.extend([
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   715
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   716
					self.__OSRoot+'/test/'+defFileDir+'/targetu.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   717
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   718
					'',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   719
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   720
					False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   721
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   722
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   723
					self.__OSRoot+'/test/'+defFileDir+'/target.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   724
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   725
					'',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   726
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   727
					True,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   728
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   729
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   730
					self.__OSRoot+'/test/'+defFileDir+'/targetu.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   731
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   732
					'target.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   733
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   734
					False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   735
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   736
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   737
					self.__OSRoot+'/test/'+defFileDir+'/target2.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   738
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   739
					'target2.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   740
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   741
					True,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   742
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   743
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   744
					self.__OSRoot+'/test/component/target2u.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   745
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   746
					'./target2.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   747
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   748
					False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   749
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   750
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   751
					self.__OSRoot+'/test/component/target2.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   752
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   753
					'./target2.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   754
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   755
					True,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   756
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   757
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   758
					self.__OSRoot+'/test/component/'+defFileDir+'/target3u.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   759
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   760
					'./~/target3.DEF',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   761
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   762
					False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   763
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   764
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   765
					epocroot+'/epoc32/include/def/'+defFileDir+'/targetu.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   766
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   767
					'/epoc32/include/def/~/target.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   768
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   769
					False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   770
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   771
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   772
					epocroot+'/epoc32/release/'+releaseDir+'/target.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   773
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   774
					'/epoc32/release/'+releaseDir+'/target.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   775
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   776
					True,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   777
					testPlat),
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   778
				DefFileTest(
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   779
					self.__OSRoot+'/deffiles/targetu.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   780
					'/test/component/mmpfile.mmp',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   781
					'/deffiles/target.def',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   782
					'target.exe',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   783
					False,
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   784
					testPlat)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   785
				])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   786
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   787
		for t in defFileTests:
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   788
			result = t.test(self.raptor)
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   789
			self.assertEquals(result, True)
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   790
	
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   791
	def dummyMetaReader(self):
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   792
		"make raptor_meta.MetaReader.__init__ into a none operation"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   793
		self.savedInit = raptor_meta.MetaReader.__init__
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   794
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   795
		def DummyMetaReaderInit(self, aRaptor):
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   796
			self._MetaReader__Raptor = aRaptor
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   797
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   798
		raptor_meta.MetaReader.__init__ = DummyMetaReaderInit
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   799
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   800
	def restoreMetaReader(self):
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   801
		"make raptor_meta.MetaReader.__init__ operational again"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   802
		raptor_meta.MetaReader.__init__ = self.savedInit
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   803
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   804
	def testApplyOsVariant(self):
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   805
		self.dummyMetaReader()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   806
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   807
		# Mock output class
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   808
		class OutputMock(object):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   809
			def write(self, text):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   810
				pass
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   811
				
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   812
		bu = raptor_data.BuildUnit("os_variant", [])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   813
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   814
		self.raptor.keepGoing = False
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   815
		
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   816
		metaReader = raptor_meta.MetaReader(self.raptor)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   817
		metaReader.ApplyOSVariant(bu, ".")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   818
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   819
		self.raptor.keepGoing = True
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   820
		self.raptor.out = OutputMock()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   821
		metaReader = raptor_meta.MetaReader(self.raptor)	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   822
		metaReader.ApplyOSVariant(bu, ".")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   823
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   824
		self.restoreMetaReader()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   825
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   826
	def __assertEqualStringList(self, aListOne, aListTwo):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   827
		self.assertEquals(len(aListOne), len(aListTwo))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   828
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   829
		i = 0
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   830
		while i < len(aListOne) :
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   831
			self.assertEquals(aListOne[i], aListTwo[i])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   832
			i = i + 1
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   833
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   834
	def testOptionReplace(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   835
		# Test how we resolve known permutations of values given to the .mmp file OPTION_REPLACE keyword
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   836
		mockBackend = raptor_meta.MMPRaptorBackend(self.raptor, "somefile.mmp", "")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   837
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   838
		results = mockBackend.resolveOptionReplace('--argA')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   839
		self.__assertEqualStringList(results, ['--argA<->'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   840
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   841
		results = mockBackend.resolveOptionReplace('--argB value')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   842
		self.__assertEqualStringList(results, ['--argB%20<->@@', '@@%<->--argB%20value'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   843
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   844
		results = mockBackend.resolveOptionReplace('--argD value1 --argE')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   845
		self.__assertEqualStringList(results, ['--argD%20<->@@', '@@%<->--argD%20value1', '--argE<->'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   846
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   847
		results = mockBackend.resolveOptionReplace('--argF --argG')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   848
		self.__assertEqualStringList(results, ['--argF<->--argG'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   849
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   850
		results = mockBackend.resolveOptionReplace('--argH --argI value')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   851
		self.__assertEqualStringList(results, ['--argH<->--argI%20value'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   852
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   853
		results = mockBackend.resolveOptionReplace('--argJ value1 --argK value2')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   854
		self.__assertEqualStringList(results, ['--argJ%20<->@@', '@@%<->--argJ%20value1', '--argK%20<->@@', '@@%<->--argK%20value2'])		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   855
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   856
		results = mockBackend.resolveOptionReplace('--argL value1 --argM value2 --argN --argO')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   857
		self.__assertEqualStringList(results, ['--argL%20<->@@', '@@%<->--argL%20value1', '--argM%20<->@@', '@@%<->--argM%20value2', '--argN<->--argO'])		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   858
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   859
		results = mockBackend.resolveOptionReplace('--argP value1 value2 --argQ value3 value4')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   860
		self.__assertEqualStringList(results, ['--argP%20<->@@', '@@%<->--argP%20value1', '--argQ%20<->@@', '@@%<->--argQ%20value3'])		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   861
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   862
		results = mockBackend.resolveOptionReplace('value1 value2')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   863
		self.__assertEqualStringList(results, [])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   864
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   865
		results = mockBackend.resolveOptionReplace('value1 --argR')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   866
		self.__assertEqualStringList(results, ['--argR<->'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   867
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   868
		results = mockBackend.resolveOptionReplace('-singleHyphenargS value1 -singleHyphenargT value2')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   869
		self.__assertEqualStringList(results, ['-singleHyphenargS%20<->@@', '@@%<->-singleHyphenargS%20value1', '-singleHyphenargT%20<->@@', '@@%<->-singleHyphenargT%20value2'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   870
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   871
		results = mockBackend.resolveOptionReplace('--assignmentArgU=value1 --assignmentArgV=value2')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   872
		self.__assertEqualStringList(results, ['--assignmentArgU=value1<->--assignmentArgV=value2'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   873
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   874
	def testModuleName(self):
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   875
		self.dummyMetaReader()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   876
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   877
		# Test how we resolve known permutations of values given to the .mmp file OPTION_REPLACE keyword
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   878
		mockBackend = raptor_meta.MetaReader(self.raptor)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   879
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   880
		resultsDictList = [ {"bldinf":"Z:/src/romfile/group/tb92/GROUP/bld.inf", "result":"romfile"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   881
				    {"bldinf":"/src/romfile/group/tb92/GROUP/bld.inf", "result":"romfile"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   882
				    {"bldinf":"Z:/src/romFile/group/tb92/GROUP/another.inf", "result":"romFile"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   883
				    {"bldinf":"X:/src/RoMfile/group/bld.inf", "result":"RoMfile"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   884
				    {"bldinf":"w:/contacts/group/ONgoing/group/bld.inf", "result":"contacts"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   885
				    {"bldinf":"p:/group/bld.inf", "result":"module"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   886
				    {"bldinf":"/group/bld.inf", "result":"module"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   887
				    {"bldinf":"p:/ONGOING/bld.inf", "result":"module"},
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   888
				    {"bldinf":"/ONGOING/bld.inf", "result":"module"}
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   889
				    ]
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   890
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   891
		for result in resultsDictList:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   892
			moduleName = mockBackend.ModuleName(result["bldinf"])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   893
			self.assertEquals(moduleName, result["result"])
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   894
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   895
		self.restoreMetaReader()
135
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   896
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   897
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   898
def path_compare_notdrivelettercase(aRequirement, aCandidate):
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   899
	if sys.platform.startswith("win"):
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   900
		if aRequirement[1] == ":":
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   901
			aRequirement = aRequirement[0].lower() + aRequirement[1:]
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   902
			aCandidate = aCandidate[0].lower() + aCandidate[1:]
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   903
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   904
	return aRequirement == aCandidate
0092642f198e Elimitate those testing messups that result from the case of the drive letter in SBS_HOME or EPOCROOT
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 32
diff changeset
   905
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   906
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   907
# run all the tests
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   908
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   909
from raptor_tests import SmokeTest
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   910
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   911
def run():
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   912
	t = SmokeTest()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   913
	t.id = "999"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   914
	t.name = "raptor_meta_unit"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   915
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   916
	tests = unittest.makeSuite(TestRaptorMeta)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   917
	result = unittest.TextTestRunner(verbosity=2).run(tests)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   918
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   919
	if result.wasSuccessful():
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   920
		t.result = SmokeTest.PASS
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   921
	else:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   922
		t.result = SmokeTest.FAIL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   923
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   924
	return t