merge 2.13.0 from default fix
authorJon Chatten
Wed, 14 Apr 2010 14:36:58 +0100
branchfix
changeset 460 1f5ab557c1d0
parent 459 75b84584242b (diff)
parent 433 5698eefedfc8 (current diff)
child 489 4d8a8d0b17c0
merge 2.13.0 from default
sbsv2/raptor/RELEASE-NOTES.html
sbsv2/raptor/python/raptor_meta.py
--- a/sbsv2/raptor/RELEASE-NOTES.html	Wed Apr 14 14:26:41 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.html	Wed Apr 14 14:36:58 2010 +0100
@@ -6,6 +6,15 @@
 
 <h1>Release Notes for Symbian Build System v2</h1>
 
+<h2>next version</h2>
+
+<h3>Defect Fixes</h3>
+<ul>
+
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2297"> SF Bug 2297 </a> Python exception in raptor_meta.py when processing bld.inf file </li>
+
+</ul>
+
 <h2>version 2.13.0</h2>
 
 <h3>New Features</h3>
--- a/sbsv2/raptor/python/raptor_meta.py	Wed Apr 14 14:26:41 2010 +0100
+++ b/sbsv2/raptor/python/raptor_meta.py	Wed Apr 14 14:36:58 2010 +0100
@@ -1071,9 +1071,12 @@
 			if (re.search(r'^\s*START ',extensionLine, re.I)):
 				start = extensionLine
 			elif re.search(r'^\s*END\s*$',extensionLine, re.I):
-				extensionObjects.append(Extension(self.filename, start, options, aBuildPlatform, self.__Raptor))
-				start = ""
-				options = []
+				if start == "":
+					self.log.Error("unmatched END statement in %s section", aType, bldinf=str(self.filename))
+				else:
+					extensionObjects.append(Extension(self.filename, start, options, aBuildPlatform, self.__Raptor))
+					start = ""
+					options = []
 			elif re.search(r'^\s*$',extensionLine, re.I):
 				continue
 			elif start:
@@ -3296,7 +3299,7 @@
 					self.__Raptor.Debug("Skipping %s", str(m.getMakefileName()))
 					continue
 				elif projectname in self.projectList:
-					projectList.remove(projectname)
+					self.projectList.remove(projectname)
 
 			self.__Raptor.Debug("%i makefile extension makefiles for %s",
 						len(makefileList), str(componentNode.component.bldinf.filename))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/metadata/project/bld.infs/bad_lone_end.inf	Wed Apr 14 14:36:58 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+// test for failure in PRJ_EXTENSIONS by processing for ARMV5 and
+// test for failure in PRJ_TESTEXTENSIONS by processing for WINSCW
+
+#ifdef EABI
+
+PRJ_EXTENSIONS
+// an END without a START
+END
+
+#else
+
+PRJ_TESTEXTENSIONS
+// an END without a START
+END
+
+#endif
--- a/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py	Wed Apr 14 14:26:41 2010 +0100
+++ b/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py	Wed Apr 14 14:36:58 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -569,7 +569,49 @@
 							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
 							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}		
 							)
+	
+	def testBadBldInfs(self):
+		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
+		depfiles=[]
 		
+		class BadBldInfLogger(object):
+			"mock logger to capture Error messages from the parser."
+			
+			def __init__(self):
+				self.errors = []
+				self.debugOutput = False
+				
+			def Error(self, format, *extras, **attributes):
+				self.errors.append( ((format % extras), attributes) )
+		
+			def Debug(self, format, *extras, **attributes):
+				pass
+				
+		logger = BadBldInfLogger()
+		
+		# this bld.inf has END lines with no matching START
+		bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('bad_lone_end.inf'),
+											  self.__gnucpp, depfiles=depfiles, 
+											  log=logger)
+		
+		# the PRJ_EXTENSIONS section is bad for ARMV5
+		extensions = bldInfObject.getExtensions(self.ARMV5)
+		#
+		self.assertEquals(len(logger.errors), 1)
+		err = logger.errors[0]
+		self.assertEquals(err[0], "unmatched END statement in PRJ_EXTENSIONS section")
+		self.assertTrue("bldinf" in err[1])
+		self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
+		
+		# the PRJ_TESTEXTENSIONS section is bad for WINSCW
+		testextensions = bldInfObject.getTestExtensions(self.WINSCW)
+		#
+		self.assertEquals(len(logger.errors), 2)
+		err = logger.errors[1]
+		self.assertEquals(err[0], "unmatched END statement in PRJ_TESTEXTENSIONS section")
+		self.assertTrue("bldinf" in err[1])
+		self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
+			
 	def testBldInfIncludes(self):
 		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs/includes')
 		depfiles=[]