merge from team wip wip
authorRichard Taylor <richard.i.taylor@nokia.com>
Tue, 04 May 2010 12:11:13 +0100
branchwip
changeset 508 8ac72bc37dd6
parent 507 54a88b895bcd (diff)
parent 497 5732243e83c1 (current diff)
child 509 a337b022f8a8
merge from team wip
sbsv2/raptor/RELEASE-NOTES.html
--- a/sbsv2/raptor/RELEASE-NOTES.html	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.html	Tue May 04 12:11:13 2010 +0100
@@ -13,6 +13,7 @@
 
 <li><a href="notes/parametric_log_filters.txt">   Pass parameters to log filters from the command line </a></li>
 <li><a href="notes/delete_on_failed_compile.txt"> Work-around for failed RVCT 2.2 compiles             </a></li>
+<li><a href="notes/query_cli.txt">                Obtain configuration data using --query option       </a></li>
 <li>                                              Carbide.xml now contains *_gcce aliases                  </li>
 
 </ul>
--- a/sbsv2/raptor/examples/os_properties.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/examples/os_properties.xml	Tue May 04 12:11:13 2010 +0100
@@ -18,6 +18,7 @@
 		<set name='POSTLINKER_SUPPORTS_WDP' value=''/>
 		<set name='SUPPORTS_STDCPP_NEWLIB' value=''/>
 		<set name='RVCT_PRE_INCLUDE' value='$(EPOCINCLUDE)/rvct2_2/rvct2_2.h'/>
+		<set name="SUPPORTS_ABIV1_IMPLIBS" value='1'/>
 	</var>
 	
 </build>
--- a/sbsv2/raptor/lib/config/arm.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/arm.xml	Tue May 04 12:11:13 2010 +0100
@@ -79,7 +79,6 @@
 		<set name="LINKER_ARCH_OPTION" value="$(LD.ARMV5)"/>
 		<set name="COMPILER_FPU_DEFAULT" value="$(CC.SOFTVFP_MAYBE_VFPV2)"/>
 		<set name="POSTLINKER_FPU_DEFAULT" value="$(PL.SOFTVFP_MAYBE_VFPV2)"/>
-		<set name="GENERATE_ABIV1_IMPLIBS" value="$(SUPPORTS_ABIV1_IMPLIBS)"/>
 	</var>
 	<var name="v6">
 		<set name="TRADITIONAL_PLATFORM" value="ARMV6"/>
@@ -92,6 +91,7 @@
 		<set name="STATIC_RUNTIME_DIR" value="$(EPOCROOT)/epoc32/release/armv5/$(VARIANTTYPE)"/>
 		<set name="COMPILER_FPU_DEFAULT" value="$(CC.SOFTVFP_MAYBE_VFPV2)"/>
 		<set name="POSTLINKER_FPU_DEFAULT" value="$(PL.SOFTVFP_MAYBE_VFPV2)"/>
+		<set name="SUPPORTS_ABIV1_IMPLIBS" value=""/>
 	</var>
 	<var name="v7">
 		<set name="TRADITIONAL_PLATFORM" value="ARMV7"/>
@@ -103,6 +103,7 @@
 		<set name="LINKER_ARCH_OPTION" value="$(LD.ARMV7)"/>
 		<set name="COMPILER_FPU_DEFAULT" value="$(CC.SOFTVFP_MAYBE_VFPV3)"/>
 		<set name="POSTLINKER_FPU_DEFAULT" value="$(PL.SOFTVFP_MAYBE_VFPV3)"/>
+		<set name="SUPPORTS_ABIV1_IMPLIBS" value=""/>
 	</var>
 	<var name="9e" extends="v5">
 		<set name="VARIANTPLATFORM" value="arm9e"/>
--- a/sbsv2/raptor/lib/config/gcc.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/gcc.xml	Tue May 04 12:11:13 2010 +0100
@@ -74,10 +74,11 @@
 		<set name='BLDINF_OUTPUTPATH' value='$(SBS_BUILD_DIR)'/>
 
 		<set name='OUTPUTPATH' value='$(SBS_BUILD_DIR)'/>
-		<set name='RELEASEPATH' value='$(EPOCROOT)/epoc32/release/tools2$$(TOOLPLATFORMDIR)'/>
+		<set name='RELEASEPATH' value='$(EPOCROOT)/epoc32/release/tools2' host='win.*'/>
+		<set name='RELEASEPATH' value='$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)' host='lin.*'/>
 	</var>
 
-	<var name="tools2_deb" extends="tools2_base">
+	<var name="t_deb">
 		<set name='TOOLSPATH' value=''/> <!-- do not install -->
 		<set name='VARIANTTYPE' value='deb'/>
 
@@ -85,8 +86,9 @@
 		<append name='CDEFS' value='_DEBUG'/>
 		<append name='RELEASEPATH' value='/deb' separator=''/>
 	</var>
-
-	<var name="tools2_rel" extends="tools2_base">
+	<alias name="tools2_deb" meaning="tools2_base.t_deb"/>
+	
+	<var name="t_rel">
 		<set name='TOOLSPATH' value='$(EPOCTOOLS)'/> <!-- install -->
 		<set name='VARIANTTYPE' value='rel'/>
 
@@ -94,10 +96,11 @@
 		<append name='CDEFS' value='NDEBUG'/>
 		<append name='RELEASEPATH' value='/rel' separator=''/>
 	</var>
-
+	<alias name="tools2_rel" meaning="tools2_base.t_rel"/>
+	
 	<group name="tools2">
-		<varRef ref='tools2_rel'/>
-		<varRef ref='tools2_deb'/>
+		<aliasRef ref='tools2_rel'/>
+		<aliasRef ref='tools2_deb'/>
 	</group>
 
 </build>
--- a/sbsv2/raptor/lib/config/make.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/make.xml	Tue May 04 12:11:13 2010 +0100
@@ -55,7 +55,7 @@
 		<set name="copylogfromannofile" value="false"/>
 	</var>
 	
-	<alias name="make" meaning="make_engine"/>
+	<alias name="make" meaning="make_engine" type="engine"/>
 
 	<!-- use the talon shell -->
 	<var name="make_no_talon_engine" extends="make_engine">
@@ -63,7 +63,7 @@
 	        <set name='USE_TALON' value=''/>
 	</var>
 
-	<alias name="make_no_talon" meaning="make_no_talon_engine"/>
+	<alias name="make_no_talon" meaning="make_no_talon_engine" type="engine"/>
 
 	<!-- other derived versions of GNU make -->
 
@@ -79,7 +79,7 @@
 		<set name="copylogfromannofile" value="true"/>
 	</var>
 
-	<alias name="emake" meaning="emake_engine"/>
+	<alias name="emake" meaning="emake_engine" type="engine"/>
 	
 	<!-- use the talon shell -->
 	<var name="emake_no_talon_engine" extends="emake_engine">
@@ -87,7 +87,7 @@
 	        <set name='USE_TALON' value=''/>
 	</var>
 
-	<alias name="emake_no_talon" meaning="emake_no_talon_engine"/>
+	<alias name="emake_no_talon" meaning="emake_no_talon_engine" type="engine"/>
 	
 	<!-- Raptor make engine for PVMgmake -->
 	<var name="pvmgmake_engine" extends="make_engine">
@@ -98,6 +98,6 @@
 		<set name='DELETE_ON_FAILED_COMPILE' value=''/>
 	</var>
 
-	<alias name="pvmgmake" meaning="pvmgmake_engine"/>
+	<alias name="pvmgmake" meaning="pvmgmake_engine" type="engine"/>
 
 </build>
--- a/sbsv2/raptor/lib/config/root.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/root.xml	Tue May 04 12:11:13 2010 +0100
@@ -45,6 +45,7 @@
 		<set name='POSTLINKER_SUPPORTS_WDP' value='1'/>
 		<set name='SUPPORTS_STDCPP_NEWLIB' value='1'/>
 		<set name="RVCT_PRE_INCLUDE" value="$(EPOCINCLUDE)/rvct/rvct.h"/>
+		<set name="SUPPORTS_ABIV1_IMPLIBS" value=''/>
 	</var>
 	
 	<!-- Placeholder for the root.changes variant. This will typically be
--- a/sbsv2/raptor/lib/config/rvct.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/rvct.xml	Tue May 04 12:11:13 2010 +0100
@@ -87,8 +87,7 @@
 		<set name="SO_NAME_OPTION" value="--soname"/>
 		<set name="STATIC_LIBS_PATH" value="$(RVCTLIB)/armlib"/>
 		<set name="STDCPP_INCLUDE" value="$(EPOCINCLUDE)/stdapis"/>
-		<set name="STDLIB_OPTION" value="--no_scanlib"/>
-		<set name="SUPPORTS_ABIV1_IMPLIBS" value="1"/>	
+		<set name="STDLIB_OPTION" value="--no_scanlib"/>	
 		<set name="SYMBIAN_LD_MESSAGE_OPTION" value="$(LD_WARNINGS_CONTROL_OPTION) $(LD_ERRORS_CONTROL_OPTION)"/>
 		<set name="SYMVER_OPTION" value="--symver_soname"/>
 		<set name="TARGET_RELOCATION_OPTION" value=""/>
--- a/sbsv2/raptor/lib/config/variants.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/variants.xml	Tue May 04 12:11:13 2010 +0100
@@ -82,7 +82,7 @@
 		<!-- PLATMACROS.LINUX is set from PLATMACROS.WINDOWS -->
 		<append name="TRADITIONAL_PLATFORM" value='SMP' separator="" />
 		<append name="VARIANTPLATFORM" value="smp" separator=""/>
-		<set name="GENERATE_ABIV1_IMPLIBS" value=""/>
+		<set name="SUPPORTS_ABIV1_IMPLIBS" value=""/>
 	</var>
 
 	<!-- emit formatted releasable information into the logs for post-build parsing -->
--- a/sbsv2/raptor/lib/config/winscw.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/config/winscw.xml	Tue May 04 12:11:13 2010 +0100
@@ -127,7 +127,7 @@
 		<set name="PLATMACROS.LINUX" value="$(PLATMACROS.WINDOWS)"/>
 	</var>
 
-	<var name="winscw_udeb" extends="winscw_base">
+	<var name="winscw_debug">
 		<set name="FULLVARIANTPATH" value="winscw/udeb"/>
 		<set name="VARIANTTYPE" value="udeb"/>
 
@@ -135,17 +135,19 @@
 		<append name="CFLAGS" value="-g -O0 -inline off"/>
 		<append name="LFLAGS" value="-g"/>
 	</var>
-
-	<var name="winscw_urel" extends="winscw_base">
+	<alias name="winscw_udeb" meaning="winscw_base.winscw_debug"/>
+	
+	<var name="winscw_release">
 		<set name="FULLVARIANTPATH" value="winscw/urel"/>
 		<set name="VARIANTTYPE" value="urel"/>
 
 		<append name="CDEFS" value="NDEBUG"/>
 		<append name="CFLAGS" value="-O4,s"/>
 	</var>
-
+	<alias name="winscw_urel" meaning="winscw_base.winscw_release"/>
+	
 	<group name="winscw">
-		<varRef ref="winscw_urel"/>
-		<varRef ref="winscw_udeb"/>
+		<aliasRef ref="winscw_urel"/>
+		<aliasRef ref="winscw_udeb"/>
 	</group>
 </build>
--- a/sbsv2/raptor/lib/flm/e32abiv2.flm	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/flm/e32abiv2.flm	Tue May 04 12:11:13 2010 +0100
@@ -170,13 +170,12 @@
     IMPORTLIBTARGETVERSIONED_DSO:=$(VER_E32IMPORTLIBBASE).dso
   endif
 
-  # ABIv1 .lib (for specific builds, toolchains and host OS platforms only)
+  # ABIv1 .lib (for specific kits and toolchains only)
   IMPORTLIBTARGET_LIB:=
   IMPORTLIBTARGETVERSIONED_LIB:=
   BUILDMARKER_IMPORTLIBTARGET_LIB:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).lib
-  # Only for builds that require and support them, and only on windows
-  ifeq ($(OSTYPE),cygwin)
-  ifeq ($(GENERATE_ABIV1_IMPLIBS),1)
+  # Only for kits that require and tools that support them
+  ifneq ($(SUPPORTS_ABIV1_IMPLIBS),)
     WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).lib)
     WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).lib
     ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_LIB)),)
@@ -184,7 +183,6 @@
       IMPORTLIBTARGETVERSIONED_LIB:=$(VER_E32IMPORTLIBBASE).lib
     endif
   endif
-  endif
 endif
 
 # Try to make sure that we get the right linkas name
--- a/sbsv2/raptor/lib/flm/standard.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/lib/flm/standard.xml	Tue May 04 12:11:13 2010 +0100
@@ -122,7 +122,6 @@
 		<param name='FPMODE_OPTION'/>
 		<param name='FROMELF'/>
 		<param name='FULLVARIANTPATH'/>
-		<param name='GENERATE_ABIV1_IMPLIBS' default=''/>		
 		<param name='RVCT3_1' default=''/>
 		<param name='LD'/>
 		<param name='LD_ERRORS_CONTROL_OPTION'/>
@@ -179,6 +178,7 @@
 		<param name='STATIC_LIBS_PATH'/>
 		<param name='STATIC_LIBRARY_DIR'/>
 		<param name='STATIC_RUNTIME_DIR'/>
+		<param name='SUPPORTS_ABIV1_IMPLIBS'/>		
 		<param name='SYMBIAN_CCFLAGS'/>
 		<param name='SYMBIAN_LD_MESSAGE_OPTION'/>
 		<param name='SYMBIAN_LINK_FLAGS'/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/notes/query_cli.txt	Tue May 04 12:11:13 2010 +0100
@@ -0,0 +1,18 @@
+
+A new --query command-line option allows other tools to easily read raptor's
+configuration data without having to understand exactly how raptor config
+files work.
+
+For example, all the valid build aliases which can be used to build with
+the -c option can be obtained using:
+
+sbs --query=aliases
+
+All the known product variants can be obtained using:
+
+sbs --query=products
+
+And the details of a particular configuration can be found using:
+
+sbs --query=config[armv5_urel.n8]
+
--- a/sbsv2/raptor/python/raptor.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/python/raptor.py	Tue May 04 12:11:13 2010 +0100
@@ -448,9 +448,10 @@
 	created by the Main function. When operated by an IDE several Raptor
 	objects may be created and operated at the same time."""
 
-
+	# mission enumeration
 	M_BUILD = 1
-	M_VERSION = 2
+	M_QUERY = 2
+	M_VERSION = 3
 
 	def __init__(self, home = None):
 
@@ -520,7 +521,8 @@
 		self.noDependInclude = False
 		self.noDependGenerate = False
 		self.projects = set()
-
+		self.queries = []
+		
 		self.cache = raptor_cache.Cache(self)
 		self.override = {env: str(self.home)}
 		self.targets = []
@@ -717,6 +719,11 @@
 		self.projects.add(projectName.lower())
 		return True
 
+	def AddQuery(self, q):
+		self.queries.append(q)
+		self.mission = Raptor.M_QUERY
+		return True
+	
 	def FilterList(self, value):
 		self.filterList = value
 		return True
@@ -1219,6 +1226,31 @@
 
 		return layers
 
+	def Query(self):
+		"process command-line queries."
+		
+		if self.mission != Raptor.M_QUERY:
+			return 0
+		
+		# establish an object cache based on the current settings
+		self.LoadCache()
+			
+		# our "self" is a valid object for initialising an API Context
+		import raptor_api
+		api = raptor_api.Context(self)
+		
+		print "<sbs version='%s'>" % raptor_version.numericversion()
+		
+		for q in self.queries:
+			try:
+				print api.stringquery(q)
+				
+			except Exception, e:
+				self.Error("exception '%s' with query '%s'", str(e), q)
+		
+		print "</sbs>"	
+		return self.errorCode
+	
 	def Build(self):
 
 		if self.mission != Raptor.M_BUILD: # help or version requested instead.
@@ -1356,6 +1388,9 @@
 	# object which represents a build
 	b = Raptor.CreateCommandlineBuild(argv)
 
+	if b.mission == Raptor.M_QUERY:
+		return b.Query()
+	
 	return b.Build()
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/python/raptor_api.py	Tue May 04 12:11:13 2010 +0100
@@ -0,0 +1,221 @@
+#
+# 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: 
+#
+# raptor_api module
+#
+# Python API for Raptor. External code should interact with Raptor via this
+# module only, as it is the only programatic interface considered public. The
+# command line --query option is also implemented using this module.
+
+# constants
+ALL = 1
+
+# objects
+
+class Reply(object):
+	"""object to return values from API calls.
+	"""
+	def __init__(self, text=""):
+		self.text = text
+	
+	def __str__(self):
+		name = type(self).__name__.lower()
+		
+		string = "<" + name
+		children = []
+		longend = False
+		
+		for attribute,value in self.__dict__.items():
+			if attribute != "text":
+				if isinstance(value, Reply):
+					children.append(value)
+				else:
+					string += " %s='%s'" % (attribute, value)
+		
+		if children or self.text:
+			string += ">"
+			longend = True
+		
+		if self.text:
+			string += self.text
+		
+		if children:
+			string += "\n"
+				
+		for c in children:
+			string += str(c)
+			
+		if longend:
+			string += "</%s>\n" % name
+		else:	
+			string += "/>\n"
+		
+		return string
+
+class Alias(Reply):
+	def __init__(self, name, meaning):
+		super(Alias,self).__init__()
+		self.name = name
+		self.meaning = meaning
+
+class Config(Reply):
+	def __init__(self, fullname, outputpath):
+		super(Config,self).__init__()
+		self.fullname = fullname
+		self.outputpath = outputpath
+
+class Product(Reply):
+	def __init__(self, name):
+		super(Product,self).__init__()
+		self.name = name
+
+import generic_path
+import raptor
+import raptor_data
+import re
+
+class Context(object):
+	"""object to contain state information for API calls.
+	
+	For example,
+	
+	api = raptor_api.Context()
+	val = api.getaliases("X")
+	"""
+	def __init__(self, initialiser=None):
+		# this object has a private Raptor object that can either be
+		# passed in or created internally.
+		
+		if initialiser == None:
+			self.__raptor = raptor.Raptor()
+		else:
+			self.__raptor = initialiser
+			
+	def stringquery(self, query):
+		"""turn a string into an API call and execute it.
+		
+		This is a convenience method for "lazy" callers.
+		
+		The return value is also converted into a well-formed XML string.
+		"""
+		
+		if query == "aliases":
+			aliases = self.getaliases()
+			return "".join(map(str, aliases)).strip()
+		
+		elif query == "products":
+			variants = self.getproducts()
+			return "".join(map(str, variants)).strip()
+		
+		elif query.startswith("config"):
+			match = re.match("config\[(.*)\]", query)
+			if match:
+				config = self.getconfig(match.group(1))
+				return str(config).strip()
+			else:
+				raise BadQuery("syntax error")
+		
+		raise BadQuery("unknown query")
+
+	def getaliases(self, type=""):
+		"""extract all aliases of a given type.
+		
+		the default type is "".
+		to get all aliases pass type=ALL
+		"""
+		aliases = []
+		
+		for a in self.__raptor.cache.aliases.values():
+			if type == ALL or a.type == type:
+				# copy the members we want to expose
+				aliases.append( Alias(a.name, a.meaning) )
+			
+		return aliases
+	
+	def getconfig(self, name):
+		"""extract the values for a given configuration.
+		
+		'name' should be an alias or variant followed optionally by a
+		dot-separated list of variants. For example "armv5_urel" or
+		"armv5_urel.savespace.vasco".
+		"""
+		names = name.split(".")
+		if names[0] in self.__raptor.cache.aliases:
+			x = self.__raptor.cache.FindNamedAlias(names[0])
+			
+			if len(names) > 1:
+				fullname = x.meaning + "." + ".".join(names[1:])
+			else:
+				fullname = x.meaning
+				
+		elif names[0] in self.__raptor.cache.variants:
+			fullname = name
+			
+		else:
+			raise BadQuery("'%s' is not an alias or a variant" % names[0])
+		
+		# create an evaluator for the named configuration
+		tmp = raptor_data.Alias("tmp")
+		tmp.SetProperty("meaning", fullname)
+		
+		units = tmp.GenerateBuildUnits(self.__raptor.cache)
+		evaluator = self.__raptor.GetEvaluator(None, units[0])
+		
+		# get the outputpath
+		# this is messy as some configs construct the path inside the FLM
+		# rather than talking it from the XML: usually because of some
+		# conditional logic... but maybe some refactoring could avoid that.
+		releasepath = evaluator.Get("RELEASEPATH")
+		if not releasepath:
+			raise BadQuery("could not get RELEASEPATH for config '%s'" % name)
+		
+		variantplatform = evaluator.Get("VARIANTPLATFORM")
+		varianttype = evaluator.Get("VARIANTTYPE")
+		featurevariantname = evaluator.Get("FEATUREVARIANTNAME")
+		
+		platform = evaluator.Get("TRADITIONAL_PLATFORM")
+		
+		if platform == "TOOLS2":
+			outputpath = releasepath
+		else:
+			if not variantplatform:
+				raise BadQuery("could not get VARIANTPLATFORM for config '%s'" % name)
+			
+			if featurevariantname:
+				variantplatform += featurevariantname
+				
+			if not varianttype:
+				raise BadQuery("could not get VARIANTTYPE for config '%s'" % name)
+			
+			outputpath = str(generic_path.Join(releasepath, variantplatform, varianttype))
+		
+		return Config(fullname, outputpath)
+		
+	def getproducts(self):
+		"""extract all product variants."""
+		
+		variants = []
+		
+		for v in self.__raptor.cache.variants.values():
+			if v.type == "product":
+				# copy the members we want to expose
+				variants.append( Product(v.name) )
+			
+		return variants
+	
+class BadQuery(Exception):
+	pass
+
+# end of the raptor_api module
--- a/sbsv2/raptor/python/raptor_cli.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/python/raptor_cli.py	Tue May 04 12:11:13 2010 +0100
@@ -18,13 +18,8 @@
 # by a raptor.Raptor object.
 #
 
-import re
 import types
 import raptor
-import os
-import sys
-import tempfile
-from raptor_utilities import getOSPlatform
 
 from optparse import OptionParser # for parsing command line parameters
 
@@ -132,6 +127,18 @@
 parser.add_option("-q","--quiet",action="store_true",dest="quiet",
 				help="Run quietly, not generating output messages.")
 
+parser.add_option("--query",action="append",dest="query",
+				help="""Access various build settings and options using a basic API. The current options are:
+				
+				* aliases - return all the values that can be sensibly used with the sbs -c option.
+				
+				* products - return all the values that can be "." appended to an alias to specialise it for a product build.
+				
+				* config[x] - return a set of values that represent the build configuration "x". Typically "x" will be an alias name or an alias followed by "." followed by a product.
+				
+				Multiple --query options can be given.
+				""")
+
 parser.add_option("-s","--sysdef",action="store",dest="sys_def_file",
 				help="System Definition XML filename.")
 
@@ -245,8 +252,7 @@
 	# parse the full set of arguments
 	(options, leftover_args) = parser.parse_args(expanded_args)
 
-	# the leftover_args are either variable assignments of the form a=b
-	# or target names.
+	# the leftover_args are target names.
 	for leftover in leftover_args:
 		Raptor.AddTarget(leftover)
 
@@ -275,6 +281,7 @@
 				 'noDependGenerate': Raptor.SetNoDependGenerate,
 				 'number_of_jobs': Raptor.SetJobs,
 				 'project_name' :  Raptor.AddProject,
+				 'query' : Raptor.AddQuery,
 				 'filter_list' : Raptor.FilterList,
 				 'ignore_os_detection': Raptor.IgnoreOsDetection,
 				 'check' :  Raptor.SetCheck,
--- a/sbsv2/raptor/python/raptor_data.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/python/raptor_data.py	Tue May 04 12:11:13 2010 +0100
@@ -829,12 +829,13 @@
 
 class Variant(Model, Config):
 
-	__slots__ = ('cache','name','host','extends','ops','variantRefs','allOperations')
+	__slots__ = ('cache','name','type','host','extends','ops','variantRefs','allOperations')
 
 	def __init__(self, name = ""):
 		Model.__init__(self)
 		Config.__init__(self)
 		self.name = name
+		self.type = ""
 
 		# Operations defined inside this variant.
 		self.ops = []
@@ -855,6 +856,8 @@
 				self.host = value
 		elif name == "extends":
 			self.extends = value
+		elif name == "type":
+			self.type = value
 		else:
 			raise InvalidPropertyError()
 
@@ -948,6 +951,7 @@
 		Config.__init__(self)
 		self.name = name
 		self.meaning = ""
+		self.type = ""
 		self.varRefs = []
 		self.variants = []
 
@@ -962,6 +966,8 @@
 
 			for u in val.split("."):
 				self.varRefs.append( VariantRef(ref = u) )
+		elif key == "type":
+			self.type = val
 		else:
 			raise InvalidPropertyError()
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/config/abiv1kit/os_properties.xml	Tue May 04 12:11:13 2010 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<build xmlns="http://symbian.com/xml/build"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://symbian.com/xml/build build/2_0.xsd">
+
+  <!-- This variant modifies the root variant for this particular kit. -->
+  <var name="root.changes">
+
+    <!-- ask for ABIv1 import libraries
+    --> 
+    <set name='SUPPORTS_ABIV1_IMPLIBS' value='1'/>
+  </var>
+  
+</build>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/config/api.xml	Tue May 04 12:11:13 2010 +0100
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<build xmlns="http://symbian.com/xml/build"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://symbian.com/xml/build build/2_0.xsd">
+
+	<!-- test data for raptor_api_unit -->
+
+	<alias meaning="a" name="alias_A"/>
+	<alias meaning="a.b" name="alias_B"/>
+	<alias meaning="a.b.c" name="alias_C" type="O"/>
+	<alias meaning="a.b.c.d" name="alias_D" type="X"/>
+ 
+ 	<var name="product_A" type="product"/>
+ 	<var name="product_B"/>
+ 	<var name="product_C" type="product"/>
+ 	<var name="product_D"/>
+ 	
+ 	<var name="buildme">
+ 		<set name="RELEASEPATH" value="/home/raptor" host="lin.*"/>
+ 		<set name="RELEASEPATH" value="C:/home/raptor" host="win.*"/>
+ 		<set name="VARIANTPLATFORM" value="foo"/>
+ 		<set name="VARIANTTYPE" value="bar"/>
+ 	</var>
+ 	
+ 	<var name="foo"/>
+ 	<var name="bar"/>
+ 	
+ 	<alias name="s1" meaning="buildme.foo"/>
+ 	<alias name="s2" meaning="buildme.foo.bar"/>
+ 	
+</build>
--- a/sbsv2/raptor/test/smoke_suite/dll_armv5.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/dll_armv5.py	Tue May 04 12:11:13 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# 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"
@@ -19,7 +19,6 @@
 def run():
 	t = AntiTargetSmokeTest()
 	t.usebash = True
-	result = AntiTargetSmokeTest.PASS
 	
 	command = "sbs -b smoke_suite/test_resources/simple_dll/bld.inf -c %s -f-"
 	maintargets = [
@@ -47,7 +46,7 @@
 		]
 	
 	# Note that ABIv1 import libraries are only generated for RVCT-based armv5
-	# builds on Windows
+	# builds on Windows if the kit asks for it (off by default)
 	
 	t.id = "0009a"
 	t.name = "dll_armv5_rvct"
@@ -56,24 +55,23 @@
 	t.addbuildtargets('smoke_suite/test_resources/simple_dll/bld.inf', buildtargets)
 	t.mustmatch = mustmatch
 	t.mustnotmatch = mustnotmatch
-	t.run("linux")
-	if t.result == AntiTargetSmokeTest.SKIP:
-		t.targets.extend(abiv1libtargets)
-		t.run("windows")
-	if t.result == AntiTargetSmokeTest.FAIL:
-		result = AntiTargetSmokeTest.FAIL
+	t.run()
+	
+	t.id = "0009b"
+	t.name = "dll_armv5_rvct_abiv1"
+	t.command += " --configpath=test/config/abiv1kit"
+	t.targets.extend(abiv1libtargets)
+	t.run("windows")
 		
-	t.id = "0009b"
+	t.id = "0009c"
 	t.name = "dll_armv5_clean"
 	t.command = "sbs -b smoke_suite/test_resources/simple_dll/bld.inf -c armv5 clean"
 	t.targets = []
 	t.mustmatch = []
 	t.mustnotmatch = []
 	t.run()	
-	if t.result == AntiTargetSmokeTest.FAIL:
-		result = AntiTargetSmokeTest.FAIL		
 		
-	t.id = "0009c"
+	t.id = "0009d"
 	t.name = "dll_armv5_gcce"
 	t.command = command % "gcce_armv5"
 	t.targets = maintargets
@@ -82,11 +80,8 @@
 	t.mustmatch = mustmatch
 	t.mustnotmatch = mustnotmatch
 	t.run()	
-	if t.result == AntiTargetSmokeTest.FAIL:
-		result = AntiTargetSmokeTest.FAIL
 	
 	t.id = "9"
 	t.name = "dll_armv5"
-	t.result = result
 	t.print_result()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/implib_armv5.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/implib_armv5.py	Tue May 04 12:11:13 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# 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"
@@ -22,7 +22,6 @@
 	t.name = "implib_armv5"
 	t.command = "sbs -b smoke_suite/test_resources/simple_implib/bld.inf" \
 		+ " -c armv5 LIBRARY"
-	# ABIv1 .lib files are not generated on Linux
 	t.targets = [
 		"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.dso",
 		"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.dso"
@@ -31,13 +30,7 @@
 		['simple_implib_lib/armv5/udeb/simple_implib.prep',
                  'simple_implib_lib/armv5/urel/simple_implib.prep']
 	])
-	t.run("linux")
-	# Run test on Windows if that is the current OS
-	if t.result == SmokeTest.SKIP:
-		t.targets.extend([
-			"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.lib",
-			"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.lib"
-		])
-		t.run("windows")
-		
+	t.run()
+	
+	t.print_result()	
 	return t
--- a/sbsv2/raptor/test/smoke_suite/implib_armv5_smp.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/implib_armv5_smp.py	Tue May 04 12:11:13 2010 +0100
@@ -27,12 +27,7 @@
 		"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.dso",
 		"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.dso"
 		]
-	t.run("linux")
-	if t.result == AntiTargetSmokeTest.SKIP:
-		t.antitargets = [
-			'$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.lib',
-			'$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.lib'
-		]
-		t.run("windows")
-		
+	t.run()
+	
+	t.print_result()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/implib_armv5_what.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/implib_armv5_what.py	Tue May 04 12:11:13 2010 +0100
@@ -22,18 +22,11 @@
 	t.name = "implib_armv5_what"
 	t.command = "sbs -b smoke_suite/test_resources/simple_implib/bld.inf -c " + \
 			"armv5 --what LIBRARY"
-	# ABIv1 .lib files are not generated on Linux
 	t.stdout = [
 		'$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.dso',
 		'$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.dso'
 	]
-	t.run("linux")
-	# Run test on Windows if that is the current OS
-	if t.result == CheckWhatSmokeTest.SKIP:
-		t.stdout.extend([
-			'$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.lib',
-			'$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.lib'
-		])
-		t.run("windows")
+	t.run()
 	
+	t.print_result()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/implib_armv5_with_armv5_smp.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/implib_armv5_with_armv5_smp.py	Tue May 04 12:11:13 2010 +0100
@@ -27,12 +27,7 @@
 		"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.dso",
 		"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.dso"
 		]
-	t.run("linux")
-	if t.result == SmokeTest.SKIP:
-		t.targets.extend([
-			"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.lib",
-			"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.lib"
-		])
-		t.run("windows")
-		
+	t.run()
+	
+	t.print_result()	
 	return t
--- a/sbsv2/raptor/test/smoke_suite/implib_nodef.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/implib_nodef.py	Tue May 04 12:11:13 2010 +0100
@@ -28,13 +28,7 @@
 		"$(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.run()
 
 	t.id = "71b"
 	t.name = "implib_no_def"
--- a/sbsv2/raptor/test/smoke_suite/implib_whatlog.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/implib_whatlog.py	Tue May 04 12:11:13 2010 +0100
@@ -45,16 +45,7 @@
 		"<build>$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.dso</build>",
 		"<build>$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.dso</build>"
 	]
-	t.run("linux")
-	if t.result == CheckWhatSmokeTest.SKIP:
-		t.targets.extend([
-			"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.lib",
-			"$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.lib"
-		])
-		t.stdout.extend([
-			"<build>$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib.lib</build>",
-			"<build>$(EPOCROOT)/epoc32/release/armv5/lib/simple_implib{000a0000}.lib</build>"
-		])
-		t.run("windows")
-		
+	t.run()
+	
+	t.print_result()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/lib_versioned.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/lib_versioned.py	Tue May 04 12:11:13 2010 +0100
@@ -49,22 +49,7 @@
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/versionedlib.02.lib",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/versionedlib01.lib"
 		]
-
-	if sys.platform.lower().startswith("win"):
-		t.targets.extend (	
-		[
-		"$(EPOCROOT)/epoc32/release/armv5/lib/testver.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/versionedlib01.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/versioned.lib.03.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/versionedlib.02.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/testver{00020000}.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/testver{00030000}.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/versioned.lib{000a0000}.03.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/version.ed.lib.04.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/version.ed.lib{000a0000}.04.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/versionedlib01{000a0000}.lib",
-		"$(EPOCROOT)/epoc32/release/armv5/lib/versionedlib{000a0000}.02.lib"
-		] )
-		
 	t.run()
+	
+	t.print_result()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/pdll_arm.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/pdll_arm.py	Tue May 04 12:11:13 2010 +0100
@@ -31,10 +31,6 @@
 		"$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll.dso",
 		"$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll{000a0000}.dso"
 		]
-	abiv1libtargets = [
-		"$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll.lib",
-		"$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll{000a0000}.lib"
-		]
 	buildtargets =  [
 		"createstaticpdll_dll/%s/udeb/CreateStaticDLL.o",
 		"createstaticpdll_dll/%s/urel/CreateStaticDLL.o"
@@ -47,9 +43,6 @@
 		".*ksrt.*"
 		]
 	
-	# Note that ABIv1 import libraries are only generated for RVCT-based armv5
-	# builds on Windows
-	
 	t.id = "0109a"
 	t.name = "pdll_armv5_rvct"
 	t.command = command % "armv5"
@@ -57,10 +50,7 @@
 	t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv5", buildtargets))
 	t.mustmatch = mustmatch
 	t.mustnotmatch = mustnotmatch
-	t.run("linux")
-	if t.result == AntiTargetSmokeTest.SKIP:
-		t.targets.extend(map(lambda x: x % "armv5", abiv1libtargets))
-		t.run("windows")
+	t.run()
 		
 	t.id = "0109b"
 	t.name = "pdll_armv5_clean"
@@ -74,7 +64,6 @@
 	t.name = "pdll_armv5_gcce"
 	t.command = command % "gcce_armv5"
 	t.targets = map(lambda p: p % "armv5", maintargets + armv5targets)
-	t.antitargets = map(lambda p: p % "armv5", abiv1libtargets)
 	t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv5", buildtargets))
 	t.mustmatch = mustmatch
 	t.mustnotmatch = mustnotmatch
@@ -109,7 +98,6 @@
 	t.name = "pdll_armv7_gcce"
 	t.command = command % "arm.v7.udeb.gcce4_3_2 -c arm.v7.urel.gcce4_3_2"
 	t.targets = map(lambda p: p % "armv7", maintargets)
-	t.antitargets = map(lambda p: p % "armv7", abiv1libtargets)
 	t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv7", buildtargets))
 	t.mustmatch = mustmatch
 	t.mustnotmatch = mustnotmatch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/query_cli.py	Tue May 04 12:11:13 2010 +0100
@@ -0,0 +1,110 @@
+#
+# 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: 
+#
+
+import raptor_tests
+
+def run():
+	
+	t = raptor_tests.SmokeTest()
+	t.description = "Test the --query command-line option"
+
+	t.name = "query_cli_alias"
+	t.command = "sbs --query=aliases"
+	t.mustmatch_singleline = [
+		"<sbs version='2\.\d+\.\d+'>",
+		"<alias.*name='armv5_urel'.*/>",
+		"<alias.*name='armv5_udeb'.*/>",
+		"<alias.*name='winscw_urel'.*/>",
+		"<alias.*name='winscw_udeb'.*/>",
+		"<alias.*name='tools2_rel'.*/>",
+		"<alias.*name='tools2_deb'.*/>",
+		"</sbs>"
+		]
+	t.mustnotmatch_singleline = [
+		"<alias.*name='make'.*/>",
+		"<alias.*name='emake'.*/>"
+		]
+	t.run()
+	
+	t.name = "query_cli_product"
+	t.command = "sbs --query=products --configpath=test/smoke_suite/test_resources/bv"
+	t.mustmatch_singleline = [
+		"<sbs version='2\.\d+\.\d+'>",
+		"<product.*name='test_bv_1'.*/>",
+		"<product.*name='test_bv_2'.*/>",
+		"<product.*name='test_bv_3'.*/>",
+		"</sbs>"
+		]
+	t.mustnotmatch_singleline = [
+		"<product.*name='arm'.*/>",
+		"<product.*name='root'.*/>"
+		]
+	t.run()
+	
+	t.name = "query_cli_config"
+	t.command = "sbs --query=config[armv5_urel]"
+	t.mustmatch_singleline = [
+		"<sbs version='2\.\d+\.\d+'>",
+		"fullname='arm\.v5\.urel\.rvct.*'",
+		"outputpath='.*/epoc32/release/armv5/urel'",
+		"</sbs>"
+		]
+	t.mustnotmatch_singleline = []
+	t.run()
+	
+	t.name = "query_cli_config_bv"
+	t.command = "sbs --query=config[armv5_urel.test_bv_1] --configpath=test/smoke_suite/test_resources/bv"
+	t.mustmatch_singleline = [
+		"<sbs version='2\.\d+\.\d+'>",
+		"fullname='arm\.v5\.urel\.rvct._.\.test_bv_1'",
+		"outputpath='.*/epoc32/release/armv5\.one/urel'",
+		"</sbs>"
+		]
+	t.mustnotmatch_singleline = []
+	t.run()
+	
+	t.name = "query_cli_config_others"
+	t.command = "sbs --query=config[winscw_urel] --query=config[tools2_rel]"
+	
+	if t.onWindows:
+		t2 = "tools2"
+	else:
+		t2 = raptor_tests.ReplaceEnvs("tools2/$(HOSTPLATFORM_DIR)")
+		
+	t.mustmatch_singleline = [
+		"<sbs version='2\.\d+\.\d+'>",
+		"outputpath='.*/epoc32/release/winscw/urel'",
+		"outputpath='.*/epoc32/release/%s/rel'" % t2,
+		"</sbs>"
+		]
+	t.mustnotmatch_singleline = []
+	t.run()
+	
+	t.name = "query_cli_bad"
+	t.command = "sbs --query=nonsense"
+	t.mustmatch_singleline = [
+		"<sbs version='2\.\d+\.\d+'>",
+		"exception 'unknown query' with query 'nonsense'",
+		"</sbs>"
+		]
+	t.mustnotmatch_singleline = []
+	t.errors = 1
+	t.returncode = 1
+	t.run()
+	
+	t.name = "query_cli"
+	t.print_result()
+	return t
--- a/sbsv2/raptor/test/smoke_suite/test_resources/bv/config/variants/bv_test.xml	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/bv/config/variants/bv_test.xml	Tue May 04 12:11:13 2010 +0100
@@ -5,7 +5,7 @@
 			xsi:schemaLocation="http://symbian.com/xml/build build/2_0.xsd">
 
 		<!-- test feature variants -->
-		<var name="test_bv_1">
+		<var name="test_bv_1" type="product">
 			<set name='FEATUREVARIANTNAME' value='.one' />
 			<set name='FEATURELISTFILES'
 					value='$(SBS_HOME)/test/smoke_suite/test_resources/bv/listA.txt
@@ -16,7 +16,7 @@
 					value='$(SBS_HOME)/test/smoke_suite/test_resources/bv/var1
 					$(SBS_HOME)/test/smoke_suite/test_resources/bv/hrh' />   
   		</var>
-		<var name="test_bv_2">
+		<var name="test_bv_2" type="product">
 			<set name='FEATUREVARIANTNAME' value='.two' />
 			<set name='FEATURELISTFILES'
 					value='$(SBS_HOME)/test/smoke_suite/test_resources/bv/listA.txt
@@ -27,7 +27,7 @@
 					value='$(SBS_HOME)/test/smoke_suite/test_resources/bv/var2
 					$(SBS_HOME)/test/smoke_suite/test_resources/bv/hrh' />
 		</var>
-		<var name="test_bv_3">
+		<var name="test_bv_3" type="product">
 			<set name='FEATUREVARIANTNAME' value='.three' />
 			<set name='FEATURELISTFILES'
 					value='$(SBS_HOME)/test/smoke_suite/test_resources/bv/listA.txt
--- a/sbsv2/raptor/test/smoke_suite/unfrozen.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/unfrozen.py	Tue May 04 12:11:13 2010 +0100
@@ -156,14 +156,7 @@
 				]
 	t.warnings = 8
 	# ABIv1 .lib files are not generated on Linux
-	t.run("linux")
-	if t.result == SmokeTest.SKIP:
-		t.targets.extend([
-			"$(EPOCROOT)/epoc32/release/armv5/lib/unfrozensymbols.lib",
-			"$(EPOCROOT)/epoc32/release/armv5/lib/unfrozensymbols{000a0000}.lib",
-			"$(EPOCROOT)/epoc32/release/armv5/lib/unfrozensymbols2.lib",
-			"$(EPOCROOT)/epoc32/release/armv5/lib/unfrozensymbols2{000a0000}.lib"
-			])
-		t.run("windows")
+	t.run()
 	
+	t.print_result()
 	return t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/unit_suite/raptor_api_unit.py	Tue May 04 12:11:13 2010 +0100
@@ -0,0 +1,104 @@
+#
+# 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: 
+# raptor_api_unit module
+
+import generic_path
+import raptor
+import raptor_api
+import unittest
+
+class TestRaptorApi(unittest.TestCase):
+			
+	def testContext(self):
+		api = raptor_api.Context()
+		
+	def testContextInitialiser(self):
+		r = raptor.Raptor()
+		api = raptor_api.Context(r)
+		
+	def testAliases(self):
+		r = raptor.Raptor()
+		r.cache.Load( generic_path.Join(r.home, "test", "config", "api.xml") )
+
+		api = raptor_api.Context(r)
+	
+		aliases = api.getaliases() # type == ""
+		self.failUnlessEqual(len(aliases), 4)
+		self.failUnlessEqual(set(["alias_A","alias_B","s1","s2"]),
+							 set(a.name for a in aliases))
+		
+		aliases = api.getaliases(raptor_api.ALL) # ignore type
+		self.failUnlessEqual(len(aliases), 6)
+		
+		aliases = api.getaliases("X") # type == "X"
+		self.failUnlessEqual(len(aliases), 1)
+		self.failUnlessEqual(aliases[0].name, "alias_D")
+		self.failUnlessEqual(aliases[0].meaning, "a.b.c.d")
+	
+	def testConfig(self):
+		r = raptor.Raptor()
+		r.cache.Load( generic_path.Join(r.home, "test", "config", "api.xml") )
+
+		api = raptor_api.Context(r)
+		
+		if r.filesystem == "unix":
+			path = "/home/raptor/foo/bar"
+		else:
+			path = "C:/home/raptor/foo/bar"
+			
+		config = api.getconfig("buildme")
+		self.failUnlessEqual(config.fullname, "buildme")
+		self.failUnlessEqual(config.outputpath, path)
+		
+		config = api.getconfig("buildme.foo")
+		self.failUnlessEqual(config.fullname, "buildme.foo")
+		self.failUnlessEqual(config.outputpath, path)
+		
+		config = api.getconfig("s1")
+		self.failUnlessEqual(config.fullname, "buildme.foo")
+		self.failUnlessEqual(config.outputpath, path)
+		
+		config = api.getconfig("s2.product_A")
+		self.failUnlessEqual(config.fullname, "buildme.foo.bar.product_A")
+		self.failUnlessEqual(config.outputpath, path)
+		
+	def testProducts(self):
+		r = raptor.Raptor()
+		r.cache.Load( generic_path.Join(r.home, "test", "config", "api.xml") )
+
+		api = raptor_api.Context(r)
+		
+		products = api.getproducts() # type == "product"
+		self.failUnlessEqual(len(products), 2)
+		self.failUnlessEqual(set(["product_A","product_C"]),
+							 set(p.name for p in products))
+		
+# run all the tests
+
+from raptor_tests import SmokeTest
+
+def run():
+	t = SmokeTest()
+	t.name = "raptor_api_unit"
+
+	tests = unittest.makeSuite(TestRaptorApi)
+	result = unittest.TextTestRunner(verbosity=2).run(tests)
+
+	if result.wasSuccessful():
+		t.result = SmokeTest.PASS
+	else:
+		t.result = SmokeTest.FAIL
+
+	return t
--- a/sbsv2/raptor/test/unit_suite/raptor_cli_unit.py	Fri Apr 30 16:56:53 2010 +0100
+++ b/sbsv2/raptor/test/unit_suite/raptor_cli_unit.py	Tue May 04 12:11:13 2010 +0100
@@ -153,6 +153,9 @@
 	def AddProject(self, project):
 		return True
 
+	def AddQuery(self, query):
+		return True
+	
 	def PrintVersion(self):
 		return True