Bug 1571: Raptor cannot report error or warning message in wrong implib project fix
authoryiluzhu
Fri, 19 Feb 2010 15:26:40 +0000
branchfix
changeset 245 cbc11ebd788f
parent 232 4b2787756a35
child 246 b9b473d0d6df
Bug 1571: Raptor cannot report error or warning message in wrong implib project
sbsv2/raptor/python/raptor_meta.py
sbsv2/raptor/test/smoke_suite/implib_nodef.py
sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/bwins/implib_implicit_def.def
sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/eabi/implib_implicit_def.def
sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/group/bld.inf
sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/group/implib_implicit_def.mmp
sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/group/implib_no_def.mmp
--- a/sbsv2/raptor/python/raptor_meta.py	Wed Feb 17 16:53:22 2010 +0000
+++ b/sbsv2/raptor/python/raptor_meta.py	Fri Feb 19 15:26:40 2010 +0000
@@ -2177,6 +2177,9 @@
 		self.BuildVariant.AddOperation(raptor_data.Set("DEFFILEKEYWORD", deffile_keyword))
 		self.__debug("Set DEFFILEKEYWORD to '%s'",deffile_keyword)
 
+		# If target type is "implib" it must have a def file
+		self.checkImplibDefFile(resolvedDefFile)
+
 		# if this target type has a default TARGETPATH other than "" for
 		# resources then we need to add that default to all resources which
 		# do not explicitly set the TARGETPATH themselves.
@@ -2268,6 +2271,13 @@
 		"""Target type in lower case - the standard format"""
 		return self.__targettype.lower()
 
+	def checkImplibDefFile(self, defFile):
+		"""Project with target type implib must have DEFFILE defined 
+		explicitly or implicitly, otherwise it is an error
+		""" 
+		if self.getTargetType() == 'implib' and defFile == '':
+			self.__Raptor.Error("No DEF File for IMPLIB target type in " + self.__currentMmpFile)
+
 	def resolveDefFile(self, aTARGET, aBuildPlatform):
 		"""Returns a fully resolved DEFFILE entry depending on .mmp file location and TARGET, DEFFILE and NOSTRICTDEF
 		entries in the .mmp file itself (where appropriate).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/implib_nodef.py	Fri Feb 19 15:26:40 2010 +0000
@@ -0,0 +1,55 @@
+#
+# 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: 
+#
+
+from raptor_tests import SmokeTest
+
+def run():
+	t = SmokeTest()
+	
+	t.id = "71a"
+	t.name = "implib_implicit_def"
+	t.command = "sbs -b smoke_suite/test_resources/simple_implib/nodef/group/bld.inf" \
+			+ " -p implib_implicit_def.mmp"
+	t.targets = [
+		"$(EPOCROOT)/epoc32/release/armv5/lib/implib_implicit_def.dso",
+		"$(EPOCROOT)/epoc32/release/armv5/lib/implib_implicit_def{000a0000}.dso",
+		"$(EPOCROOT)/epoc32/release/winscw/udeb/implib_implicit_def.lib"
+		]
+	t.run("linux")
+	if t.result == SmokeTest.SKIP:
+		t.targets.extend([
+			"$(EPOCROOT)/epoc32/release/armv5/lib/implib_implicit_def.lib",
+			"$(EPOCROOT)/epoc32/release/armv5/lib/implib_implicit_def{000a0000}.lib"
+			])
+		t.run("windows")
+
+	t.id = "71b"
+	t.name = "implib_no_def"
+	t.command = "sbs -b smoke_suite/test_resources/simple_implib/nodef/group/bld.inf" \
+			+ " -p implib_no_def.mmp"
+	t.targets = []
+	t.mustmatch = [
+		"No DEF File for IMPLIB target type in"	
+		]
+	t.errors = 2 # 1 for winscw and 1 for armv5
+	t.returncode = 1
+	t.run()
+
+	t.id = "71"
+	t.name = "implib_nodef"
+	t.print_result()
+
+	return t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/bwins/implib_implicit_def.def	Fri Feb 19 15:26:40 2010 +0000
@@ -0,0 +1,5 @@
+EXPORTS
+; NEW:
+	?NewLC@CMessenger@@SAPAV1@AAVCConsoleBase@@ABVTDesC16@@@Z @ 1 NONAME ; public: static class CMessenger * __cdecl CMessenger::NewLC(class CConsoleBase &,class TDesC16 const &)
+	?ShowMessage@CMessenger@@QAEXXZ @ 2 NONAME ; public: void __thiscall CMessenger::ShowMessage(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/eabi/implib_implicit_def.def	Fri Feb 19 15:26:40 2010 +0000
@@ -0,0 +1,6 @@
+EXPORTS
+	_ZN10CMessenger11ShowMessageEv @ 1 NONAME
+	_ZN10CMessenger5NewLCER12CConsoleBaseRK7TDesC16 @ 2 NONAME
+	_ZTI10CMessenger @ 3 NONAME ; #<TI>#
+	_ZTV10CMessenger @ 4 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/group/bld.inf	Fri Feb 19 15:26:40 2010 +0000
@@ -0,0 +1,24 @@
+/*
+* 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: 
+*
+*/
+
+
+PRJ_PLATFORMS
+WINSCW ARMV5 ARMV5SMP
+
+PRJ_MMPFILES
+implib_no_def.mmp
+implib_implicit_def.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/group/implib_implicit_def.mmp	Fri Feb 19 15:26:40 2010 +0000
@@ -0,0 +1,23 @@
+/*
+* 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: 
+*
+*/
+
+
+TARGET        implib_implicit_def.lib
+TARGETTYPE    implib
+  
+NOSTRICTDEF
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_implib/nodef/group/implib_no_def.mmp	Fri Feb 19 15:26:40 2010 +0000
@@ -0,0 +1,23 @@
+/*
+* 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: 
+*
+*/
+
+
+TARGET        implib_no_def.lib
+TARGETTYPE    implib
+
+NOSTRICTDEF
+