# HG changeset patch # User Jon Chatten # Date 1270640050 -3600 # Node ID 9bebdb95e0de318059c03ca0aae0c2ef90ee8429 # Parent 6cc6d1d59188f1c74b566e4f4c8a478ba3c1f52a# Parent d8edd94cd8e2f311f32f216c07639e63a2351ec1 merge 2.13.0 (candidate 2) from default diff -r 6cc6d1d59188 -r 9bebdb95e0de .hgtags --- a/.hgtags Tue Apr 06 11:42:16 2010 +0100 +++ b/.hgtags Wed Apr 07 12:34:10 2010 +0100 @@ -3,3 +3,5 @@ 007900c31eef0363e705cf15d131740d4eeb6208 stable 007900c31eef0363e705cf15d131740d4eeb6208 stable 976aca38ffe5ce30d7753ea77a8de44e5cbd0dc8 stable +976aca38ffe5ce30d7753ea77a8de44e5cbd0dc8 stable +7006bcce52990f33d0c20c51bebc2b58ed36db60 stable diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/RELEASE-NOTES.html --- a/sbsv2/raptor/RELEASE-NOTES.html Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/RELEASE-NOTES.html Wed Apr 07 12:34:10 2010 +0100 @@ -33,7 +33,17 @@

Defect Fixes

@@ -42,14 +52,15 @@ version 2.12.5 Defect Fixes: -- Fix: Workaround for emake engine log corruption when clockskew errors occur (annofile2log). - +- Fix: Workaround for emake engine log corruption when clockskew errors occur (annofile2log). Allow Raptor to obtain log from emake annotation file where it is uncorrupted. A new - Make engine option "copyannofile2log" enables/disables this mode for emake. If this option is disabled + Make engine option "copylogfromannofile" enables/disables this mode for emake. If this option is disabled or if no annotation file is specified for the build then Raptor reads logs directly as normal. +- SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp - SF Bug 2191 - [Raptor] - When forcesuccess is enabled, exit status for a failed recipe is "retry" but should be "failed" - Fix: extend tracecompiler tests to Linux - Fix: Amendment to SF Bug 1511 fix - removal of blanked DEFFILE keyword from e32abiv2ani.flm +- Fix: improve robustness to bad -c options version 2.12.4 diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/arm.xml --- a/sbsv2/raptor/lib/config/arm.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/arm.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,51 +1,62 @@ - + - - - + + - + + + - - - + - - - + + + + + - - + + + + + + + + + + + + + + - + - + - - @@ -57,16 +68,9 @@ - - - - - - - - - + + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/gcc.xml --- a/sbsv2/raptor/lib/config/gcc.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/gcc.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,33 +1,33 @@ - - + - - + + + + + + + + - - - - + + + + - - - - - - - @@ -58,7 +56,6 @@ - diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/gcce.xml --- a/sbsv2/raptor/lib/config/gcce.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/gcce.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,15 +1,15 @@ - - + + + + - - @@ -123,6 +123,6 @@ - + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/gccxml.xml --- a/sbsv2/raptor/lib/config/gccxml.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/gccxml.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,21 +1,20 @@ - + - + + + + - - + - - + + - - - - + @@ -51,11 +50,13 @@ - + + + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/locations.xml --- a/sbsv2/raptor/lib/config/locations.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/locations.xml Wed Apr 07 12:34:10 2010 +0100 @@ -108,7 +108,7 @@ - + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/msvc.xml --- a/sbsv2/raptor/lib/config/msvc.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/msvc.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,11 +1,11 @@ - + - + @@ -17,8 +17,14 @@ + + + + + + @@ -32,7 +38,6 @@ - @@ -44,7 +49,7 @@ - + @@ -57,9 +62,6 @@ - - - diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/rvct.xml --- a/sbsv2/raptor/lib/config/rvct.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/rvct.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,68 +1,62 @@ - + + + + + + + + + - - - - - + + + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + @@ -71,25 +65,35 @@ + - + - + + + + + + + + + + + + - - + - @@ -97,10 +101,11 @@ + - - + + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/variants.xml --- a/sbsv2/raptor/lib/config/variants.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/variants.xml Wed Apr 07 12:34:10 2010 +0100 @@ -91,37 +91,40 @@ - + + - + + - + + - - - + + + - + @@ -143,13 +146,13 @@ - - - + + + - + @@ -173,13 +176,13 @@ - - - + + + - + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/winscw.xml --- a/sbsv2/raptor/lib/config/winscw.xml Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/config/winscw.xml Wed Apr 07 12:34:10 2010 +0100 @@ -1,24 +1,31 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + @@ -45,97 +52,96 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - + + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/flm/e32abiv2.flm --- a/sbsv2/raptor/lib/flm/e32abiv2.flm Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/flm/e32abiv2.flm Wed Apr 07 12:34:10 2010 +0100 @@ -580,8 +580,7 @@ # Targettype is some type of DLL or EXE (or derivative) ifneq ($(LINK_TARGET),) -escaped_located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(call ruleEscape,$(wildcard $(subst $(CHAR_SPACE),?,$(RVCTLIB)/*/$(L))))) -quoted_located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(call dblquoteitem,$(wildcard $(RVCTLIB)/*/$(L)))) +located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(wildcard $(RVCTLIB)/*/$(L))) located_STATICLIBRARIES:=$(foreach L,$(STATICLIBRARY),$(STATIC_LIBRARY_DIR)/$(L).lib) e32abiv2_LIBS:=$(EXPTARGET) $(LINKER_STUB_LIBRARY) $(if $(STATIC_RUNTIME_LIB),$(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB),) $(located_STATICLIBRARIES) # DLLS and EXEs - These objects are linked by a linker @@ -594,12 +593,10 @@ REDUCED_RUNTIME_LIBS_LIST:=$(subst $(TARGET).dso,,$(RUNTIME_LIBS_LIST)) ifeq ($(VARIANTTYPE),udeb) - e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) + e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) else - e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) + e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) endif -quoted_e32abiv2_LIBS=$(e32abiv2_LIBS) $(quoted_located_ARMLIBS) -escaped_e32abiv2_LIBS=$(e32abiv2_LIBS) $(escaped_located_ARMLIBS) else # NORMAL @@ -612,19 +609,16 @@ ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(NEWLIB)) endif -quoted_e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(call addquotedprefix,$(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(quoted_located_ARMLIBS) -escaped_e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(call ruleEscape,$(STATIC_LIBS_PATH)/),$(STATIC_LIBS_LIST)) $(escaped_located_ARMLIBS) +e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(located_ARMLIBS) endif else # ARM RUNTIME LIBS ifeq ($(VARIANTTYPE),udeb) - e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) + e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(located_ARMLIBS) else - e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) + e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(located_ARMLIBS) endif -quoted_e32abiv2_LIBS=$(e32abiv2_LIBS) $(quoted_located_ARMLIBS) -escaped_e32abiv2_LIBS=$(e32abiv2_LIBS) $(escaped_located_ARMLIBS) endif # NOTE: the groupin10 macro must be used before a call to the "startrule" macro @@ -634,7 +628,7 @@ # outside the relevant tags but it is also unavoidable. define linktarget_func ## The actual link target, dependencies and build step -$(E32TARGET): $(POSTLINKDEFFILE) $(ELF2E32) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(escaped_e32abiv2_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB +$(E32TARGET): $(POSTLINKDEFFILE) $(ELF2E32) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(e32abiv2_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB $(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE); $(call groupin10,$(LINKOBJECTS)) ;) $(call startrule,linkandpostlink) \ @@ -654,7 +648,7 @@ $(if $(MULTIFILE_ENABLED),$(call dblquote,$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS)),$(COMMANDFILE_OPTION)$(call dblquote,$(VIAFILE))) \ $(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ $(if $(LINKER_ADD_STATIC_RUNTIME),$(if $(STATIC_RUNTIME_LIB),$(LINKER_GROUP_START_OPTION) $(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB) $(LINKER_GROUP_END_OPTION),)) \ - $(quoted_e32abiv2_LIBS) $(LINKER_DEFAULT_LIBS) && \ + $(call dblquote,$(e32abiv2_LIBS)) $(LINKER_DEFAULT_LIBS) && \ $(ELF2E32) \ --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ --version=$(VERSION) \ @@ -795,7 +789,7 @@ $(if $(USE_PROFILER_FEEDBACK),--profile=$(call dblquote,$(ARM_PROFILER_FILE)),) \ $(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \ $(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\ - $(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquoteitem,$(RVCTINC)),),) \ + $(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \ $(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$( - diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/flm/resource.flm --- a/sbsv2/raptor/lib/flm/resource.flm Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/lib/flm/resource.flm Wed Apr 07 12:34:10 2010 +0100 @@ -1,4 +1,4 @@ -# 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" @@ -112,7 +112,7 @@ $(call makepath,$(INTERBASE)) # common pre-processor options -CPPOPT:=-nostdinc -undef -D_UNICODE -include $(PRODUCT_INCLUDE)\ +CPPOPT:=-nostdinc -undef -Wno-trigraphs -D_UNICODE -include $(PRODUCT_INCLUDE)\ -I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-I$(I) ) -I- $(foreach J,$(SYSTEMINCLUDE),-I$(J) ) CREATABLEPATHS:=$(RSCDIR) $(RSGDIR) $(OUTPUTPATH) diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/license.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/license.txt Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,8 @@ +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". + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/generic_path.py --- a/sbsv2/raptor/python/generic_path.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/generic_path.py Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2006-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,6 +19,7 @@ import sys import re import types +import ctypes # are we on windows, and if so what is the current drive letter isWin = sys.platform.lower().startswith("win") @@ -265,7 +266,37 @@ return self.path + def GetSpaceSafePath(self): + """Returns a version of the path where spaces don't interfere with shell interpretation. + + This functionality only applies to Windows - paths containing spaces are assumed to be problematic + on non-Windows platforms. + + On Windows, the path is returned in Windows-specific 8.3 short path form - tilde are used to replace + spaces and fit path elements within 8.3 requirements. As 8.3 format paths are not guaranteed to be + supported on all Windows installs, and can only be calculated if they exist, a newly formated path is + only returned if it is returned by the Windows API and tested to exist. + """ + + if not isWin: + return None + + from ctypes.wintypes import DWORD, LPSTR, MAX_PATH + GetShortPathNameA = ctypes.windll.kernel32.GetShortPathNameA + GetShortPathNameA.restype = DWORD + GetShortPathNameA.argtypes = LPSTR, LPSTR, DWORD + + buffer = ctypes.create_string_buffer(MAX_PATH) + GetShortPathNameA(self.path, buffer, MAX_PATH) + + spacesafe = buffer.value + + if not spacesafe or not os.path.exists(spacesafe): + return None + + return spacesafe + # Module functions def Join(*arguments): diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/plugins/filter_terminal.py --- a/sbsv2/raptor/python/plugins/filter_terminal.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/plugins/filter_terminal.py Wed Apr 07 12:34:10 2010 +0100 @@ -161,7 +161,7 @@ # list of strings to catch recipe warnings (must be lowercase) self.recipe_warning_expr = ["warning:"] - + def isMakeWarning(self, text): """A simple test for warnings. Can be extended do to more comprehensive checking.""" @@ -201,6 +201,9 @@ if self.raptor.quiet: self.quiet = True + # the build configurations which were reported + self.built_configs = [] + # keep count of errors and warnings self.err_count = 0 self.warn_count = 0 @@ -393,7 +396,9 @@ self.recipeBody.append(text) else: self.recipelineExceeded += 1 - + elif text.startswith("Buildable configuration '"): + # Buildable configuration 'name' + self.built_configs.append(text[30:-8]) def logit(self): """ log a message """ @@ -432,11 +437,14 @@ if self.warn_count > 0 or self.err_count > 0: sys.stdout.write("\n%s : warnings: %s\n" % (raptor.name, self.warn_count)) - sys.stdout.write("%s : errors: %s\n" % (raptor.name, + sys.stdout.write("%s : errors: %s\n\n" % (raptor.name, self.err_count)) else: - sys.stdout.write("\nno warnings or errors\n") + sys.stdout.write("\nno warnings or errors\n\n") + for bc in self.built_configs: + sys.stdout.write("built " + bc + "\n") + sys.stdout.write("\nRun time %d seconds\n" % self.raptor.runtime); sys.stdout.write("\n") return True diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor.py --- a/sbsv2/raptor/python/raptor.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/raptor.py Wed Apr 07 12:34:10 2010 +0100 @@ -42,7 +42,6 @@ import sys import types import time -import re import traceback import pluginbox from xml.sax.saxutils import escape @@ -232,8 +231,9 @@ def makefile(self, makefilename_base, engine, named = False): """Makefiles for individual mmps not feasible at the moment""" - pass # Cannot, currently, "unfurl an mmp" directly but do want - # to be able to simulate the overall recursive unfurling of a build. + pass + # Cannot, currently, "unfurl an mmp" directly but do want + # to be able to simulate the overall recursive unfurling of a build. class Component(ModelNode): """A group of projects or, in symbian-speak, a bld.inf. @@ -321,7 +321,6 @@ # insert the start time into the Makefile name? - buildconfig = build.GetConfig("build").GenerateBuildUnits(build.cache) self.configs = build.buildUnitsToBuild # Pass certain CLI flags through to the makefile-generating sbs calls @@ -385,8 +384,7 @@ makefile_path = str(build.topMakefile) + "_" + str(loop_number) try: os.unlink(makefile_path) # until we have dependencies working properly - except Exception,e: - # print "couldn't unlink %s: %s" %(componentMakefileName, str(e)) + except Exception: pass # add some basic data in a component-wide variant @@ -859,32 +857,6 @@ self.cache.Load(self.systemFLM) - def GetConfig(self, configname): - names = configname.split(".") - - cache = self.cache - - base = names[0] - mods = names[1:] - - if base in cache.groups: - x = cache.FindNamedGroup(base) - elif base in cache.aliases: - x = cache.FindNamedAlias(base) - elif base in cache.variants: - x = cache.FindNamedVariant(base) - else: - raise Exception("Unknown build configuration '%s'" % configname) - - x.ClearModifiers() - - - try: - for m in mods: x.AddModifier( cache.FindNamedVariant(m) ) - except KeyError: - raise Exception("Unknown build configuration '%s'" % configname) - return x - def GetBuildUnitsToBuild(self, configNames): """Return a list of the configuration objects that correspond to the list of configuration names in the configNames parameter. @@ -900,17 +872,7 @@ else: configNames.append(self.defaultConfig) - buildUnitsToBuild = set() - - - for c in set(configNames): - self.Debug("BuildUnit: %s", c) - try: - x = self.GetConfig(c) - gb = x.GenerateBuildUnits(self.cache) - buildUnitsToBuild.update( gb ) - except Exception, e: - self.FatalError(str(e)) + buildUnitsToBuild = raptor_data.GetBuildUnits(configNames, self.cache, self) for b in buildUnitsToBuild: self.Info("Buildable configuration '%s'", b.name) @@ -1003,7 +965,6 @@ dir = generic_path.Path(aDir) bldInf = dir.Append(self.buildInformation) - componentgroup = [] if bldInf.isFile(): return bldInf @@ -1150,7 +1111,7 @@ self.out.write(raptor_timing.Timing.discovery_string(object_type = object_type, count = count)) except Exception, exception: - Error(exception.Text, function = "InfoDiscoveryTime") + self.Error(exception.Text, function = "InfoDiscoveryTime") def InfoStartTime(self, object_type, task, key): if self.timing: @@ -1158,7 +1119,7 @@ self.out.write(raptor_timing.Timing.start_string(object_type = object_type, task = task, key = key)) except Exception, exception: - Error(exception.Text, function = "InfoStartTime") + self.Error(exception.Text, function = "InfoStartTime") def InfoEndTime(self, object_type, task, key): if self.timing: @@ -1166,7 +1127,7 @@ self.out.write(raptor_timing.Timing.end_string(object_type = object_type, task = task, key = key)) except Exception, exception: - Error(exception.Text, function = "InfoEndTime") + self.Error(exception.Text, function = "InfoEndTime") def Debug(self, format, *extras, **attributes): "Send a debugging message to the configured channel" @@ -1280,6 +1241,9 @@ self.AssertBuildOK() buildUnitsToBuild = self.GetBuildUnitsToBuild(self.configNames) + if len(buildUnitsToBuild) == 0: + raise BuildCannotProgressException("No configurations to build.") + self.buildUnitsToBuild = buildUnitsToBuild # find out what components to build, and in what way diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_cli.py --- a/sbsv2/raptor/python/raptor_cli.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/raptor_cli.py Wed Apr 07 12:34:10 2010 +0100 @@ -34,7 +34,7 @@ # raptor_cli module attributes parser = OptionParser(prog = raptor.name, - usage = """%prog [--help] [options] [variable=value] [target] ... + usage = """%prog [--help] [options] [target] ... Targets: @@ -247,13 +247,8 @@ # the leftover_args are either variable assignments of the form a=b # or target names. - regex = re.compile("^(.+)=(.*)$") for leftover in leftover_args: - assignment = regex.findall(leftover) - if len(assignment) > 0: - Raptor.SetEnv(assignment[0][0],assignment[0][1]) - else: - Raptor.AddTarget(leftover) + Raptor.AddTarget(leftover) # Define the dictionary of functions to be used. # Attributes and function names can be added easily. diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_data.py --- a/sbsv2/raptor/python/raptor_data.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/raptor_data.py Wed Apr 07 12:34:10 2010 +0100 @@ -65,7 +65,7 @@ # Make sure not to start up on an unsupported platform if not HostPlatform.IsKnown(HostPlatform.hostplatform): - raise Exception("raptor_data module loaded on an unrecognised platform '%s'. Expected one of %s" % (hostplatform, str(hostplatforms))) + raise Exception("raptor_data module loaded on an unrecognised platform '%s'. Expected one of %s" % (HostPlatform.hostplatform, str(HostPlatform.hostplatforms))) # raptor_data module classes @@ -139,7 +139,13 @@ raise BadReferenceError() def GetModifiers(self, cache): - return [ cache.FindNamedVariant(m) for m in self.modifiers ] + mods = [] + for m in self.modifiers: + try: + mods.append(cache.FindNamedVariant(m)) + except KeyError: + raise BadReferenceError(m) + return mods def Valid(self): return self.ref @@ -710,7 +716,7 @@ def __str__(self): attributes = "name='" + self.name + "' type='" + self.type + "'" - if default != None: + if self.default != None: attributes += " default='" + self.default + "'" if type == "tool": @@ -724,19 +730,31 @@ value = os.environ[self.name] if value: - # if this value is a "path" or a "tool" then we need to make sure - # it is a proper absolute path in our preferred format. - if self.type == "path" or self.type == "tool": + if self.type in ["path", "tool", "toolchainpath"]: + # if this value is some sort of path or tool then we need to make sure + # it is a proper absolute path in our preferred format. try: path = generic_path.Path(value) value = str(path.Absolute()) except ValueError,e: - raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e))) - # if this value ends in an un-escaped backslash, then it will be treated as a line continuation character - # in makefile parsing - un-escaped backslashes at the end of values are therefore escaped + raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e))) + + if self.type in ["tool", "toolchainpath"]: + # if we're dealing with tool-related values, then make sure that we can get "safe" + # versions if they contain spaces - if we can't, that's an error, as they won't + # survive full usage in the toolcheck or when used and/or referenced in FLMs + if ' ' in value: + path = generic_path.Path(value) + spaceSafeValue = path.GetSpaceSafePath() + + if not spaceSafeValue: + raise BadToolValue("the environment variable %s is incorrect - it is a '%s' type but contains spaces that cannot be neutralised: %s" % (self.name, self.type, value)) + + value = spaceSafeValue elif value.endswith('\\'): - # an odd number of backslashes means there's one to escape - count = len(value) - len(value.rstrip('\\')) + # if this value ends in an un-escaped backslash, then it will be treated as a line continuation character + # in makefile parsing - un-escaped backslashes at the end of values are therefore escaped + count = len(value) - len(value.rstrip('\\')) # an odd number of backslashes means there's one to escape if count % 2: value += '\\' except KeyError: @@ -906,7 +924,6 @@ s += "" return s -import traceback class VariantRef(Reference): def __init__(self, ref=None): @@ -918,7 +935,7 @@ def Resolve(self, cache): try: return cache.FindNamedVariant(self.ref) - except KeyError, e: + except KeyError: raise BadReferenceError(self.ref) class MissingVariantException(Exception): @@ -961,7 +978,7 @@ missing_variants.append(r.ref) if len(missing_variants) > 0: - raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants)) + raise MissingVariantException("Missing variants '%s'" % " ".join(missing_variants)) def GenerateBuildUnits(self, cache): self.Resolve(cache) @@ -1026,25 +1043,27 @@ def GenerateBuildUnits(self, cache): units = [] - + missing_variants = [] for r in self.childRefs: - refMods = r.GetModifiers(cache) - try: obj = r.Resolve(cache=cache) except BadReferenceError: missing_variants.append(r.ref) else: obj.ClearModifiers() + try: + refMods = r.GetModifiers(cache) + except BadReferenceError,e: + missing_variants.append(str(e)) + else: + for m in refMods + self.modifiers: + obj.AddModifier(m) - for m in refMods + self.modifiers: - obj.AddModifier(m) - - units.extend( obj.GenerateBuildUnits(cache) ) + units.extend( obj.GenerateBuildUnits(cache) ) if len(missing_variants) > 0: - raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants)) + raise MissingVariantException("Missing variants '%s'" % " ".join(missing_variants)) return units @@ -1055,7 +1074,7 @@ Reference.__init__(self, ref) def __str__(self): - return "<%s />" % (prefix, self.ref, ".".join(self.modifiers)) + return "" % (self.ref, ".".join(self.modifiers)) def Resolve(self, cache): try: @@ -1063,6 +1082,81 @@ except KeyError: raise BadReferenceError(self.ref) +def GetBuildUnits(configNames, cache, logger): + """expand a list of config strings like "arm.v5.urel" into a list + of BuildUnit objects that can be queried for settings. + + The expansion tries to be tolerant of errors in the XML so that a + typo in one part of a group does not invalidate the whole group. + """ + + # turn dot-separated name strings into Model objects (Group, Alias, Variant) + models = [] + + for c in set(configNames): + ok = True + names = c.split(".") + + base = names[0] + mods = names[1:] + + if base in cache.groups: + x = cache.FindNamedGroup(base) + elif base in cache.aliases: + x = cache.FindNamedAlias(base) + elif base in cache.variants: + x = cache.FindNamedVariant(base) + else: + logger.Error("Unknown build configuration '%s'" % base) + continue + + x.ClearModifiers() + + for m in mods: + if m in cache.variants: + x.AddModifier( cache.FindNamedVariant(m) ) + else: + logger.Error("Unknown build variant '%s'" % m) + ok = False + + if ok: + models.append(copy.copy(x)) + + # turn Model objects into BuildUnit objects + # + # all objects have a GenerateBuildUnits method but don't use + # that for Groups because it is not tolerant of errors (the + # first error raises an exception and the rest of the group is + # abandoned) + units = [] + + while len(models) > 0: + x = models.pop() + try: + if isinstance(x, (Alias, Variant)): + # these we just turn straight into BuildUnits + units.extend(x.GenerateBuildUnits(cache)) + elif isinstance(x, Group): + # deal with each part of the group separately (later) + for child in x.childRefs: + modChild = copy.copy(child) + modChild.modifiers = child.modifiers + [m.name for m in x.modifiers] + models.append(modChild) + elif isinstance(x, Reference): + # resolve references and their modifiers + try: + obj = x.Resolve(cache) + modObj = copy.copy(obj) + modObj.modifiers = x.GetModifiers(cache) + except BadReferenceError,e: + logger.Error("Unknown reference '%s'" % str(e)) + else: + models.append(modObj) + except Exception, e: + logger.Error(str(e)) + + return units + class ToolErrorException(Exception): def __init__(self, s): Exception.__init__(self,s) @@ -1364,6 +1458,9 @@ class UninitialisedVariableException(Exception): pass +class RecursionException(Exception): + pass + class Evaluator(object): """Determine the values of variables under different Configurations. Either of specification and buildUnit may be None.""" @@ -1436,7 +1533,6 @@ for k, v in self.dict.items(): if v.find('$(' + k + ')') != -1: raise RecursionException("Recursion Detected in variable '%s' in configuration '%s' " % (k,configName)) - expanded = "RECURSIVE_INVALID_STRING" else: expanded = self.ExpandAll(v, specName, configName) diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_make.py --- a/sbsv2/raptor/python/raptor_make.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/raptor_make.py Wed Apr 07 12:34:10 2010 +0100 @@ -37,7 +37,19 @@ class BadMakeEngineException(Exception): pass +def string_following(prefix, str): + """If str starts with prefix then return the rest of str, otherwise None""" + if str.startswith(prefix): + return str[len(prefix):] + else: + return None + def XMLEscapeLog(stream): + """ A generator that reads a raptor log from a stream and performs an XML escape + on all text between tags, which is usually make output that could contain + illegal characters that upset XML-based log parsers. + This function yields "xml-safe" output line by line. + """ inRecipe = False for line in stream: @@ -54,22 +66,49 @@ yield escape(line) def AnnoFileParseOutput(annofile): + """ A generator that extracts log output from an emake annotation file, + perform an XML-unescape on it and "yields" it line by line. """ af = open(annofile, "r") inOutput = False - inParseJob = False + + buildid = "" for line in af: line = line.rstrip("\n\r") + if not inOutput: - if line.startswith(""): + o = string_following("", line) + if not o: + o = string_following('', line) + + if o: inOutput = True - yield unescape(line[8:])+'\n' - # This is make output so don't unescape it. - elif line.startswith(''): - line = line[19:] - inOutput = True - yield unescape(line)+'\n' + yield unescape(o)+'\n' + continue + + + o = string_following('', line) + if o: + secs = int(o[:o.find('<')]) + if secs != 0: + duration = "%d:%d" % (secs/60, secs % 60) + else: + duration = "0:0" + continue + + + o = string_following('', line) + if o: + availability = o[:o.find('<')] + continue + else: end_output = line.find("") @@ -77,8 +116,10 @@ line = line[:end_output] inOutput = False - yield unescape(line)+'\n' + if line != "": + yield unescape(line)+'\n' + yield "Finished build: %s Duration: %s (m:s) Cluster availability: %s%%\n" %(buildid,duration,availability) af.close() @@ -146,8 +187,8 @@ if self.copyLogFromAnnoFile: for o in self.raptor.makeOptions: - if o.startswith("--emake-annofile="): - self.annoFileName = o[17:] + self.annoFileName = string_following("--emake-annofile=", o) + if self.annoFileName: self.raptor.Info("annofile: " + o) if not self.annoFileName: diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_meta.py --- a/sbsv2/raptor/python/raptor_meta.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/raptor_meta.py Wed Apr 07 12:34:10 2010 +0100 @@ -1304,16 +1304,15 @@ elif varname == 'PAGED': self.BuildVariant.AddOperation(raptor_data.Set(varname, "1")) self.__debug( "Set switch PAGE ON") + # PAGED is equivalent to PAGEDCODE self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "paged")) self.__debug( "Set switch PAGEDCODE ON") - self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "paged")) - self.__debug( "Set data PAGEDDATA ON") self.__pageConflict.append("PAGEDCODE") - self.__pageConflict.append("PAGEDDATA") elif varname == 'UNPAGED': self.BuildVariant.AddOperation(raptor_data.Set("PAGED", "0")) self.__debug( "Set switch PAGED OFF") + # UNPAGED is equivalent to UNPAGEDCODE *and* UNPAGEDDATA self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged")) self.__debug( "Set switch PAGEDCODE OFF") self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged")) @@ -1335,6 +1334,7 @@ self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged")) self.__debug( "Set switch " + varname + " ON") self.__pageConflict.append(varname) + elif varname == 'UNPAGEDDATA': self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged")) self.__debug( "Set switch " + varname + " ON") @@ -1343,6 +1343,7 @@ elif varname == 'NOLINKTIMECODEGENERATION': self.BuildVariant.AddOperation(raptor_data.Set("LTCG","")) self.__debug( "Set switch " + varname + " OFF") + elif varname == 'NOMULTIFILECOMPILATION': self.BuildVariant.AddOperation(raptor_data.Set("MULTIFILE_ENABLED","")) self.__debug( "Set switch " + varname + " OFF") @@ -1352,21 +1353,19 @@ self.__debuggable = "udeb urel" else: self.__Raptor.Warn("DEBUGGABLE keyword ignored as DEBUGGABLE_UDEBONLY is already specified") + elif varname == 'DEBUGGABLE_UDEBONLY': if self.__debuggable != "": self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set") self.__debuggable = "udeb" + elif varname == 'FEATUREVARIANT': self.BuildVariant.AddOperation(raptor_data.Set(varname,"1")) self.featureVariant = True + elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']: - if self.__compressionKeyword: - self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % (varname, self.__currentMmpFile, self.__compressionKeyword)) - self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword,"")) - self.__debug( "Set switch " + varname + " OFF") - self.BuildVariant.AddOperation(raptor_data.Set(varname,"1")) - self.__debug( "Set switch " + varname + " ON") - self.__compressionKeyword = varname + self.resolveCompressionKeyword(varname) + else: self.__debug( "Set switch "+toks[0]+" ON") self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1")) @@ -1722,7 +1721,7 @@ def getDefaultResourceTargetPath(self, targettype): # the different default TARGETPATH values should come from the # configuration rather than being hard-coded here. - if targettype == "plugin": + if targettype in ["plugin", "plugin3"]: return "resource/plugins" if targettype == "pdl": return "resource/printers" @@ -2247,12 +2246,21 @@ for x in self.__pageConflict: if x == "PAGEDCODE" or x == "UNPAGEDCODE": self.__Raptor.Warn("Both PAGEDCODE and UNPAGEDCODE are specified. The last one %s will take effect" % x) + if x == "PAGEDCODE": + self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET") break + elif "PAGEDCODE" in self.__pageConflict: + self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET") + if "PAGEDDATA" in self.__pageConflict and "UNPAGEDDATA" in self.__pageConflict: for x in self.__pageConflict: if x == "PAGEDDATA" or x == "UNPAGEDDATA": self.__Raptor.Warn("Both PAGEDDATA and UNPAGEDDATA are specified. The last one %s will take effect" % x) + if x == "PAGEDDATA": + self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET") break + elif "PAGEDDATA" in self.__pageConflict: + self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET") # Set Debuggable self.BuildVariant.AddOperation(raptor_data.Set("DEBUGGABLE", self.__debuggable)) @@ -2271,6 +2279,19 @@ """Target type in lower case - the standard format""" return self.__targettype.lower() + def resolveCompressionKeyword(self, aCompressionKeyword): + """If a compression keyword is set more than once either explicitly + or implicitly a warning is given and the last one takes effect + """ + if self.__compressionKeyword and self.__compressionKeyword != aCompressionKeyword: + self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % \ + (aCompressionKeyword, self.__currentMmpFile, self.__compressionKeyword)) + self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword, "")) + self.__debug( "Set switch " + self.__compressionKeyword + " OFF") + self.BuildVariant.AddOperation(raptor_data.Set(aCompressionKeyword,"1")) + self.__debug( "Set switch " + aCompressionKeyword + " ON") + self.__compressionKeyword = aCompressionKeyword + def checkImplibDefFile(self, defFile): """Project with target type implib must have DEFFILE defined explicitly or implicitly, otherwise it is an error diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_version.py --- a/sbsv2/raptor/python/raptor_version.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/python/raptor_version.py Wed Apr 07 12:34:10 2010 +0100 @@ -16,7 +16,7 @@ # replace CHANGESET with the Hg changeset for ANY release -version=(2,12,5,"2010-03-18","symbian build system","CHANGESET") +version=(2,13,0,"2010-03-31","symbian build system","CHANGESET") def numericversion(): """Raptor version string""" diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/common/raptor_tests.py --- a/sbsv2/raptor/test/common/raptor_tests.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/common/raptor_tests.py Wed Apr 07 12:34:10 2010 +0100 @@ -417,22 +417,26 @@ p = subprocess.Popen(args=[BASH, '-c', command], stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + stderr=subprocess.PIPE, env=shellenv, shell=False, universal_newlines=True) - self.output = p.communicate()[0] + (std_out, std_err) = p.communicate() + + self.output = std_out + std_err else: p = subprocess.Popen(command, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + stderr=subprocess.PIPE, env=shellenv, shell=True, universal_newlines=True) - self.output = p.communicate()[0] - + (std_out, std_err) = p.communicate() + + self.output = std_out + std_err + if debug_mode_active: print self.output diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/config/os_properties.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/config/os_properties.xml Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/annofile2log.py --- a/sbsv2/raptor/test/smoke_suite/annofile2log.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/annofile2log.py Wed Apr 07 12:34:10 2010 +0100 @@ -24,16 +24,12 @@ t.usebash = True t.errors = 0 - t.returncode = 1 + t.returncode = 0 t.exceptions = 0 t.command = "cd smoke_suite/test_resources/annofile2log && ( diff -wB <(python testanno2log.py <(bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2)) <(bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2))" t.mustmatch_multiline = [ - ".*1a2.*" + - "Starting build: 488235.{1,3}" + - "14009c12884.{1,4}" + - "---.{1,4}" + - "Finished build: 488235 Duration: 1:15 \(m:s\) Cluster availability: 100%.*" + "^ *.?" ] diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/cli_makevar_override.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/cli_makevar_override.py Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,38 @@ +# +# 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: +# + +# Checks that functionality for overriding makefile varaibles at the command no longer works +# The mechanism for dealing with this was removed as the fix for SF bug 2134 +# On the CLI, "something=something" is now treated as a target rather than a variable assignment + +from raptor_tests import SmokeTest + +def run(): + t = SmokeTest() + t.name = "cli_makevar_overide" + t.id = "0117" + t.description = "Attempt to override a makefile var at the command line." + t.usebash = True + + t.command = "sbs -b smoke_suite/test_resources/basics/helloworld/Bld.inf REALLYCLEAN -m ${SBSMAKEFILE} -f ${SBSLOGFILE} HOSTPLATFORM_DIR=unlikelydir" + + t.mustmatch = ["sbs: warning: CLEAN, CLEANEXPORT and a REALLYCLEAN should not be combined with other targets as the result is unpredictable"] + + t.warnings = 1 + t.run() + + return t + \ No newline at end of file diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/export.py --- a/sbsv2/raptor/test/smoke_suite/export.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/export.py Wed Apr 07 12:34:10 2010 +0100 @@ -73,7 +73,7 @@ t.name = "export" t.usebash = True t.command = "ls -l ${EPOCROOT}/epoc32/include/executable_file" - t.mustmatch = [ "^.rwxrwxr.x .*executable_file.*$" ] + t.mustmatch = [ "^.rwxrwxr.x[\.\+]? .*executable_file.*$" ] t.targets = [] t.run("linux") t.usebash = False diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/keepgoing.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/keepgoing.py Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,106 @@ +# +# 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.description = """Raptor should keep going and build as much as possible with the -k option specified.""" + + command = "sbs -b smoke_suite/test_resources/simple/bld.inf -k" + config = " --configpath=test/smoke_suite/test_resources/keepgoing" + targets = [ + "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe", + "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe.map", + "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", + "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe.map", + "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe.sym", + "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe.sym" + ] + buildtargets = [ + "test_/armv5/udeb/test.o", + "test_/armv5/urel/test.o", + "test_/armv5/udeb/test.o.d", + "test_/armv5/udeb/test3.o.d", + "test_/armv5/udeb/test4.o.d", + "test_/armv5/udeb/test5.o.d", + "test_/armv5/udeb/test1.o.d", + "test_/armv5/udeb/test6.o.d", + "test_/armv5/udeb/test2.o.d", + "test_/armv5/udeb/test3.o", + "test_/armv5/udeb/test4.o", + "test_/armv5/udeb/test5.o", + "test_/armv5/udeb/test1.o", + "test_/armv5/udeb/test6.o", + "test_/armv5/udeb/test2.o", + "test_/armv5/urel/test.o.d", + "test_/armv5/urel/test3.o.d", + "test_/armv5/urel/test4.o.d", + "test_/armv5/urel/test5.o.d", + "test_/armv5/urel/test1.o.d", + "test_/armv5/urel/test6.o.d", + "test_/armv5/urel/test2.o.d", + "test_/armv5/urel/test3.o", + "test_/armv5/urel/test4.o", + "test_/armv5/urel/test5.o", + "test_/armv5/urel/test1.o", + "test_/armv5/urel/test6.o", + "test_/armv5/urel/test2.o", + "test_/armv5/udeb/test_udeb_objects.via", + "test_/armv5/urel/test_urel_objects.via" + ] + + # using a non-existent config with -c should build any independent configs + t.id = "115a" + t.name = "keepgoing_bad_config" + t.command = command + " -c armv5 -c armv5.bogus" + t.targets = targets + t.addbuildtargets("smoke_suite/test_resources/simple/bld.inf", buildtargets) + t.mustmatch = ["sbs: error: Unknown build variant 'bogus'"] + t.warnings = 0 + t.errors = 1 + t.returncode = 1 + t.run() + + # using groups with bad sub-groups should build any independent groups + t.id = "115b" + t.name = "keepgoing_bad_subgroup" + t.command = command + config + " -c lots_of_products" + t.mustmatch = ["Unknown reference 'qwertyuio'", + "Unknown reference 'asdfghjkl'", + "Unknown reference 'zxcvbnm_p'"] + t.warnings = 0 + t.errors = 3 + t.returncode = 1 + t.run() + + # using groups with bad sub-sub-groups should build any independent groups + t.id = "115c" + t.name = "keepgoing_bad_subsubgroup" + t.command = command + config + " -c lots_of_products_2" + t.mustmatch = ["Unknown reference 'qwertyuio'", + "Unknown reference 'asdfghjkl'", + "Unknown reference 'zxcvbnm_p'"] + t.warnings = 0 + t.errors = 3 + t.returncode = 1 + t.run() + + # summarise + t.id = "115" + t.name = "keepgoing" + t.print_result() + return t diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/paging.py --- a/sbsv2/raptor/test/smoke_suite/paging.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/paging.py Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2009-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" @@ -24,61 +24,108 @@ cmd_prefix = "sbs -b smoke_suite/test_resources/simple_paging/bld.inf -c armv5_urel " cmd_suffix = " -m ${SBSMAKEFILE} -f ${SBSLOGFILE} && cat ${SBSLOGFILE} " - result = SmokeTest.PASS - t.id = "0093a" t.name = "paging_default" t.command = cmd_prefix + "-p default.mmp" + cmd_suffix - t.mustmatch = [".*--codepaging=default.*", ".*--datapaging=default.*"] - t.run("windows") # Windows-only until we've updated the Linux version of elf2e32. - if t.result == "skip": - return t - if t.result == SmokeTest.FAIL: - result = SmokeTest.FAIL + t.mustmatch_singleline = [ + "--codepaging=default", + "--datapaging=default" + ] + t.run() t.id = "0093b" t.name = "paging_unpaged" t.command = cmd_prefix + "-p unpaged.mmp" + cmd_suffix - t.mustmatch = [".*--codepaging=unpaged.*", ".*--datapaging=unpaged.*"] + t.mustmatch_singleline = [ + "--codepaging=unpaged", + "--datapaging=unpaged" + ] t.run() - if t.result == SmokeTest.FAIL: - result = SmokeTest.FAIL t.id = "0093c" t.name = "paging_paged" t.command = cmd_prefix + "-p paged.mmp" + cmd_suffix - t.mustmatch = [".*--codepaging=paged.*", ".*--datapaging=paged.*"] + # Either pagedcode or pageddata can imply bytepaircompresstarget + t.mustmatch_singleline = [ + "--codepaging=paged", + "--datapaging=default", + "--compressionmethod=bytepair" + ] t.run() - if t.result == SmokeTest.FAIL: - result = SmokeTest.FAIL t.id = "0093d" t.name = "paging_unpagedcode_pageddata" t.command = cmd_prefix + "-p unpagedcode_pageddata.mmp" + cmd_suffix - t.mustmatch = [".*--codepaging=unpaged.*", ".*--datapaging=paged.*"] + t.mustmatch_singleline = [ + "--codepaging=unpaged", + "--datapaging=paged", + "--compressionmethod=bytepair" + ] t.run() - if t.result == SmokeTest.FAIL: - result = SmokeTest.FAIL t.id = "0093e" t.name = "paging_pagedcode_unpageddata" t.command = cmd_prefix + "-p pagedcode_unpageddata.mmp" + cmd_suffix - t.mustmatch = [".*--codepaging=paged.*", ".*--datapaging=unpaged.*"] + t.mustmatch_singleline = [ + "--codepaging=paged", + "--datapaging=unpaged", + "--compressionmethod=bytepair" + ] t.run() - if t.result == SmokeTest.FAIL: - result = SmokeTest.FAIL t.id = "0093f" t.name = "paging_pagedcode_defaultdata" t.command = cmd_prefix + "-p pagedcode_defaultdata.mmp" + cmd_suffix - t.mustmatch = [".*--codepaging=paged.*", ".*--datapaging=default.*"] + t.mustmatch_singleline = [ + "--codepaging=paged", + "--datapaging=default", + "--compressionmethod=bytepair" + ] + t.run() + + t.id = "0093g" + t.name = "paging_paged_unpaged_no_bytepair" + t.command = cmd_prefix + "-p paged_unpaged.mmp" + cmd_suffix + t.mustmatch_singleline = [ + "--codepaging=unpaged", + "--datapaging=unpaged" + ] + t.mustnotmatch = [ + "--compressionmethod=bytepair" + ] + t.warnings = 2 # 1 in the log and 1 on screen t.run() - if t.result == SmokeTest.FAIL: - result = SmokeTest.FAIL + + # test the pre-WDP paging options --paged and --unpaged + # there is an os_properties.xml file in test/config that + # turns POSTLINKER_SUPPORTS_WDP off + + t.id = "0093g" + t.name = "paging_paged_no_wdp" + t.command = cmd_prefix + "-p paged.mmp --configpath=test/config" + cmd_suffix + t.mustmatch_singleline = [ + "--paged", + "--compressionmethod=bytepair" + ] + t.mustnotmatch = [] + t.warnings = 0 + t.targets = [ "$(EPOCROOT)/epoc32/release/armv5/urel/paged.dll" ] + t.run() + + t.id = "0093h" + t.name = "paging_unpaged_no_wdp" + t.command = cmd_prefix + "-p unpaged.mmp --configpath=test/config" + cmd_suffix + t.mustmatch_singleline = [ + "--unpaged", + ] + t.mustnotmatch = [ + "--compressionmethod=bytepair" + ] + t.targets = [ "$(EPOCROOT)/epoc32/release/armv5/urel/unpaged.dll" ] + t.run() t.id = "0093" t.name = "paging" - t.result = result t.print_result() return t diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/plugin_armv5_winscw_freeze.py --- a/sbsv2/raptor/test/smoke_suite/plugin_armv5_winscw_freeze.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/plugin_armv5_winscw_freeze.py Wed Apr 07 12:34:10 2010 +0100 @@ -24,7 +24,8 @@ the correct FREEZE behaviour in each case. The correct behaviour for a PLUGIN/PLUGIN3 is indicative of all TARGETTYPEs where the build system defines known exports: FREEZE should do nothing unless an explicit DEFFILE statement is present in the .mmp file. - Also confirms default UID2 settings for PLUGIN3 TARGETTYPEs.""" + Also confirms default UID2 settings for PLUGIN3 TARGETTYPEs and default resource generation locations + for both PLUGIN and PLUGIN3.""" t.usebash = True t.command = """ @@ -34,7 +35,13 @@ t.targets = [ "smoke_suite/test_resources/simple_plugin/bwins/plugin2u.def", - "smoke_suite/test_resources/simple_plugin/eabi/plugin2u.def" + "smoke_suite/test_resources/simple_plugin/eabi/plugin2u.def", + "$(EPOCROOT)/epoc32/data/z/resource/plugins/plugin.rsc", + "$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/plugins/plugin.rsc", + "$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/plugins/plugin.rsc", + "$(EPOCROOT)/epoc32/data/z/resource/plugins/plugin3.rsc", + "$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/plugins/plugin3.rsc", + "$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/plugins/plugin3.rsc" ] t.antitargets = [ diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/resource.py --- a/sbsv2/raptor/test/smoke_suite/resource.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/resource.py Wed Apr 07 12:34:10 2010 +0100 @@ -63,5 +63,7 @@ "helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp", "helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d"]) + t.mustnotmatch = ["HelloWorld.rss.* warning: trigraph"] + t.run() return t diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/terminal_filter_tests.py --- a/sbsv2/raptor/test/smoke_suite/terminal_filter_tests.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/terminal_filter_tests.py Wed Apr 07 12:34:10 2010 +0100 @@ -19,10 +19,10 @@ def run(): t = SmokeTest() - t.id = "87" - t.name = "terminal_filter_tests" - t.description = "terminal_filter_tests: Tests the terminal filter against" \ - + " log files to ensure it 'does the right thing'" + t.description = "Tests against log files to ensure it 'does the right thing'" + + t.id = "87a" + t.name = "terminal_filter_tests_log" t.command = "$(SBS_HOME)/test/smoke_suite/test_resources/refilter/testfilterterminal" t.countmatch = [ # One of each type of error occurs early in the 'sbs' call where there @@ -36,4 +36,19 @@ ] t.errors = 4 t.run() + + t.id = "87b" + t.name = "terminal_filter_tests_configs" + t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf" + t.countmatch = [] + t.errors = 0 + t.mustmatch_singleline = ["built 'armv5_urel'", + "built 'armv5_udeb'", + "built 'winscw_urel'", + "built 'winscw_udeb'" ] + t.run() + + t.id = "87" + t.name = "terminal_filter_tests" + t.print_result() return t diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/keepgoing/groups.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/keepgoing/groups.xml Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_gui/HelloWorld.rss --- a/sbsv2/raptor/test/smoke_suite/test_resources/simple_gui/HelloWorld.rss Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_gui/HelloWorld.rss Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-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" @@ -66,6 +66,7 @@ RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; } RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; } RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; } +RESOURCE TBUF r_example_text_Item3 { buf="This string generates a trigraph warning if not suppressed: ID3?????????"; } RESOURCE LOCALISABLE_APP_INFO r_lai { diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_paging/bld.inf --- a/sbsv2/raptor/test/smoke_suite/test_resources/simple_paging/bld.inf Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_paging/bld.inf Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-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" @@ -18,14 +18,17 @@ PRJ_PLATFORMS - ARMV5 +ARMV5 PRJ_MMPFILES - default.mmp - unpaged.mmp - paged.mmp +default.mmp +unpaged.mmp +paged.mmp - unpagedcode_pageddata.mmp - pagedcode_unpageddata.mmp - pagedcode_defaultdata.mmp +unpagedcode_pageddata.mmp +pagedcode_unpageddata.mmp +pagedcode_defaultdata.mmp + +paged_unpaged.mmp + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_paging/paged_unpaged.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_paging/paged_unpaged.mmp Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2000-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: +* In this example "bytepaircompresstarget" should not by implied as +* keyword "unpaged" cancels "paged". +*/ + + +TARGET paged_unpaged.dll +TARGETTYPE dll + +UID 0xE800004C +CAPABILITY All -TCB + +VENDORID 0x70000001 + +SOURCE a.cpp + +LIBRARY euser.lib + +PAGED +UNPAGED + diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin.mmp --- a/sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin.mmp Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin.mmp Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-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" @@ -26,5 +26,9 @@ SOURCEPATH . SOURCE plugin.cpp SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/techview LIBRARY euser.lib apmime.lib efsrv.lib + +START RESOURCE plugin.rss +END diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin.rss Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: +* Dummy ECOM resource file +* +*/ + +NAME PLUG + +#include +#include +#include + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf=""; } +RESOURCE TBUF r_example_text_plug { buf="plug"; } diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin3.mmp --- a/sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin3.mmp Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin3.mmp Wed Apr 07 12:34:10 2010 +0100 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Example ECOMP plugin3 component, with no UID listed +* Example ECOM plugin3 component, with no UID listed * */ @@ -24,6 +24,10 @@ VENDORID 0x70000001 SOURCEPATH . SOURCE plugin.cpp -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/techview LIBRARY euser.lib apmime.lib efsrv.lib + +START RESOURCE plugin3.rss +END diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin3.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_plugin/plugin3.rss Wed Apr 07 12:34:10 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: +* Dummy ECOM resource file +* +*/ + +NAME PLG3 + +#include +#include +#include + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf=""; } +RESOURCE TBUF r_example_text_plug3 { buf="plug3"; } diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/timeout.py --- a/sbsv2/raptor/test/smoke_suite/timeout.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/timeout.py Wed Apr 07 12:34:10 2010 +0100 @@ -26,10 +26,10 @@ t.id = "60a" t.name = "timeout" t.usebash = True - t.command = "sbs -b smoke_suite/test_resources/timeout/bld.inf -f-" + t.command = "sbs -b smoke_suite/test_resources/timeout/bld.inf -f -" - t.mustmatch = [ - "status exit='failed' code='" + exitCode + "' attempt='1' *reason='timeout'", + t.mustmatch_singleline = [ + "status exit='failed' code='" + exitCode + "' attempt='1' reason='timeout'", ] t.errors = -1 t.returncode = 1 @@ -38,12 +38,12 @@ t.id = "60b" t.name = "timeout with retries" t.usebash = True - t.command = "sbs -b smoke_suite/test_resources/timeout/bld.inf -t 3 -f-" + t.command = "sbs -b smoke_suite/test_resources/timeout/bld.inf -t 3 -f -" - t.mustmatch = [ - "status exit='retry' code='" + exitCode + "' attempt='1' *reason='timeout'", - "status exit='retry' code='" + exitCode + "' attempt='2' *reason='timeout'", - "status exit='failed' code='" + exitCode + "' attempt='3' *reason='timeout'", + t.mustmatch_singleline = [ + "status exit='retry' code='" + exitCode + "' attempt='1' reason='timeout'", + "status exit='retry' code='" + exitCode + "' attempt='2' reason='timeout'", + "status exit='failed' code='" + exitCode + "' attempt='3' reason='timeout'", ] t.errors = -1 t.returncode = 1 diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/smoke_suite/tools.py --- a/sbsv2/raptor/test/smoke_suite/tools.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/smoke_suite/tools.py Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2009-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" @@ -20,19 +20,15 @@ t = SmokeTest() t.id = "52" t.name = "tools" - # Do not run with j > 1 because of known issues - t.command = "sbs -b smoke_suite/test_resources/tools/bld.inf -c tools -j1" + t.command = "sbs -b smoke_suite/test_resources/tools/bld.inf -c tools" t.targets = [ "$(EPOCROOT)/epoc32/release/tools/deb/tool_exe.bsc", "$(EPOCROOT)/epoc32/release/tools/deb/tool_exe.exe", "$(EPOCROOT)/epoc32/release/tools/deb/tool_exe.ilk", - "$(EPOCROOT)/epoc32/release/tools/deb/tool_exe.pdb", "$(EPOCROOT)/epoc32/release/tools/deb/tool_lib1.bsc", "$(EPOCROOT)/epoc32/release/tools/deb/tool_lib1.lib", - "$(EPOCROOT)/epoc32/release/tools/deb/tool_lib1.pdb", "$(EPOCROOT)/epoc32/release/tools/deb/tool_lib2.bsc", "$(EPOCROOT)/epoc32/release/tools/deb/tool_lib2.lib", - "$(EPOCROOT)/epoc32/release/tools/deb/tool_lib2.pdb", "$(EPOCROOT)/epoc32/release/tools/rel/tool_exe.exe", "$(EPOCROOT)/epoc32/release/tools/rel/tool_lib1.lib", "$(EPOCROOT)/epoc32/release/tools/rel/tool_lib2.lib", diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/unit_suite/generic_path_unit.py --- a/sbsv2/raptor/test/unit_suite/generic_path_unit.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/unit_suite/generic_path_unit.py Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2009-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" @@ -136,6 +136,21 @@ path6 = generic_path.Path("m:/") self.assertEqual(str(path6), "m:") + # SpaceSafePath + + epocroot = os.path.abspath(os.environ.get('EPOCROOT')).replace('\\','/').rstrip('/') + pathwithspaces = epocroot+"/epoc32/build/Program Files/Some tool installed with spaces/no_spaces/s p c/no_more_spaces" + path7 = generic_path.Path(pathwithspaces) + + # SpaceSafe paths on Windows are 8.3 format, and these can only be deduced if they actually exist. + os.makedirs(pathwithspaces) + spacesafe = path7.GetSpaceSafePath() + self.assertTrue(spacesafe.endswith("PROGRA~1/SOMETO~1/NO_SPA~1/SPC~1/NO_MOR~1")) + + os.removedirs(pathwithspaces) + spacesafe = path7.GetSpaceSafePath() + self.assertEqual(spacesafe, None) + def testClassLinux(self): if self.isWin32(): @@ -173,6 +188,15 @@ path = generic_path.Path("some/thing/") self.assertEqual(str(path), "some/thing") + # SpaceSafePath + + # This doesn't mean much on non-Windows platforms, but we confirm nothing breaks if it is used + pathwithspaces = "/Program Files/Some tool installed with spaces/no_spaces/s p c/no_more_spaces" + path2 = generic_path.Path(pathwithspaces) + + spacesafe = path2.GetSpaceSafePath() + self.assertEqual(spacesafe, None) + # run all the tests diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/test/unit_suite/raptor_data_unit.py --- a/sbsv2/raptor/test/unit_suite/raptor_data_unit.py Tue Apr 06 11:42:16 2010 +0100 +++ b/sbsv2/raptor/test/unit_suite/raptor_data_unit.py Wed Apr 07 12:34:10 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2006-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" @@ -21,6 +21,7 @@ import raptor import raptor_cache import raptor_data +import sys import unittest class TestRaptorData(unittest.TestCase): @@ -35,6 +36,8 @@ self.envStack[name] = os.environ[name] os.environ[name] = value + def isWin(self): + return 'win' in raptor.hostplatform def RestoreEnv(self, name): # put environment back to its state before SetEnv @@ -355,7 +358,9 @@ self.assertEqual(varcfg, "/C/variant/variant.cfg") def testProblematicEnvironment(self): - # ask for environment variable values that will break makefile parsing due to + aRaptor = raptor.Raptor() + + # 1: ask for environment variable values that will break makefile parsing due to # backslashes forming line continuation characters self.SetEnv("ENVVAR_BSLASH_END1", "C:\\test1a\\;C:\\test1b\\") self.SetEnv("ENVVAR_BSLASH_END2", "C:\\test2a\\;C:\\test2b\\\\") @@ -365,7 +370,6 @@ var.AddOperation(raptor_data.Env("ENVVAR_BSLASH_END2")) var.AddOperation(raptor_data.Env("ENVVAR_BSLASH_END3")) - aRaptor = raptor.Raptor() eval = aRaptor.GetEvaluator(None, var.GenerateBuildUnits(aRaptor.cache)[0]) self.RestoreEnv("ENVVAR_BSLASH_END1") self.RestoreEnv("ENVVAR_BSLASH_END2") @@ -379,6 +383,75 @@ value = eval.Get("ENVVAR_BSLASH_END3") self.assertEqual(value, "C:\\test3a\\;C:\\test3b\\\\\\\\") + + # 2: check 'tool' and 'toolchain' type environment variable values for correct behaviour when paths contain spaces + # this is different depending on host OS platform and whether or not the paths/tools actually exist + epocroot = os.path.abspath(os.environ.get('EPOCROOT')).replace('\\','/').rstrip('/') + pathwithspaces = epocroot+"/epoc32/build/Program Files/Some tool installed with spaces/no_spaces/s p c/no_more_spaces" + toolwithspaces = pathwithspaces+"/testtool.exe" + self.SetEnv("ENVVAR_TOOL_WITH_SPACES", toolwithspaces) + self.SetEnv("ENVVAR_TOOLCHAINPATH_WITH_SPACES", pathwithspaces) + toolVar = raptor_data.Variant("tool.var") + toolchainpathVar = raptor_data.Variant("toolchainpath.var") + toolVar.AddOperation(raptor_data.Env("ENVVAR_TOOL_WITH_SPACES", "", "tool")) + toolchainpathVar.AddOperation(raptor_data.Env("ENVVAR_TOOLCHAINPATH_WITH_SPACES", "", "toolchainpath")) + invalidValueException = "the environment variable %s is incorrect - it is a '%s' type but contains spaces that cannot be neutralised:" + + # 2a: paths/tools exist - on Windows we expect 8.3 paths post-evaluation, on all other platforms error exceptions + os.makedirs(pathwithspaces) + testtool = open(toolwithspaces,'wb') + testtool.close() + + exceptionText = "" + value = "" + try: + eval = aRaptor.GetEvaluator(None, toolVar.GenerateBuildUnits(aRaptor.cache)[0]) + value = eval.Get("ENVVAR_TOOL_WITH_SPACES") + except Exception, e: + exceptionText = str(e) + + if self.isWin(): + self.assertTrue(value) + self.assertFalse(' ' in value) + else: + self.assertTrue(exceptionText.startswith(invalidValueException % ("ENVVAR_TOOL_WITH_SPACES", "tool"))) + + exceptionText = "" + value = "" + try: + eval = aRaptor.GetEvaluator(None, toolchainpathVar.GenerateBuildUnits(aRaptor.cache)[0]) + value = eval.Get("ENVVAR_TOOLCHAINPATH_WITH_SPACES") + except Exception, e: + exceptionText = str(e) + + if self.isWin(): + self.assertTrue(value) + self.assertFalse(' ' in value) + else: + self.assertTrue(exceptionText.startswith(invalidValueException % ("ENVVAR_TOOLCHAINPATH_WITH_SPACES", "toolchainpath"))) + + # 2b: paths/tools don't exist - should throw error exceptions on all platforms as 8.3 paths are only available + # for use if a path/tool exists + os.remove(toolwithspaces) + os.removedirs(pathwithspaces) + + exceptionText = "" + try: + eval = aRaptor.GetEvaluator(None, toolVar.GenerateBuildUnits(aRaptor.cache)[0]) + except Exception, e: + exceptionText = str(e) + self.assertTrue(exceptionText.startswith(invalidValueException % ("ENVVAR_TOOL_WITH_SPACES", "tool"))) + + exceptionText = "" + try: + eval = aRaptor.GetEvaluator(None, toolchainpathVar.GenerateBuildUnits(aRaptor.cache)[0]) + except Exception, e: + exceptionText = str(e) + self.assertTrue(exceptionText.startswith(invalidValueException % ("ENVVAR_TOOLCHAINPATH_WITH_SPACES", "toolchainpath"))) + + # clean-up + self.RestoreEnv("ENVVAR_TOOL_WITH_SPACES") + self.RestoreEnv("ENVVAR_TOOLCHAINPATH_WITH_SPACES") def testMissingEnvironment(self): # ask for an environment variable that is not set @@ -430,8 +503,105 @@ self.failUnless(self.checkForParam(p, "D", None)) f = extended.GetFLMIncludePath(cache) self.assertEqual(f.File(), "base.flm") + + def testGetBuildUnits(self): + r = raptor.Raptor() + + # + g1 = raptor_data.Group("g1") + r.cache.AddGroup(g1) + + # + g2a = raptor_data.GroupRef() + g2a.SetProperty("ref", "g2") + g2a.SetProperty("mod", "A.B") + g1.AddChild(g2a) + + # + g2b = raptor_data.GroupRef() + g2b.SetProperty("ref", "g2") + g2b.SetProperty("mod", "C.D") + g1.AddChild(g2b) + + # + g2 = raptor_data.Group("g2") + r.cache.AddGroup(g2) + + # + v2 = raptor_data.VariantRef() + v2.SetProperty("ref", "V") + v2.SetProperty("mod", "E.F") + g2.AddChild(v2) + + # + v3 = raptor_data.VariantRef() + v3.SetProperty("ref", "V") + v3.SetProperty("mod", "G.H") + g2.AddChild(v3) + + # + v4 = raptor_data.AliasRef() + v4.SetProperty("ref", "X") + v4.SetProperty("mod", "I.J") + g2.AddChild(v4) + + # + v5 = raptor_data.AliasRef() + v5.SetProperty("ref", "X") + v5.SetProperty("mod", "K.L") + g2.AddChild(v5) + + r.cache.AddVariant(raptor_data.Variant("A")) + r.cache.AddVariant(raptor_data.Variant("B")) + r.cache.AddVariant(raptor_data.Variant("C")) + r.cache.AddVariant(raptor_data.Variant("D")) + r.cache.AddVariant(raptor_data.Variant("E")) + r.cache.AddVariant(raptor_data.Variant("F")) + r.cache.AddVariant(raptor_data.Variant("G")) + r.cache.AddVariant(raptor_data.Variant("H")) + r.cache.AddVariant(raptor_data.Variant("I")) + r.cache.AddVariant(raptor_data.Variant("J")) + r.cache.AddVariant(raptor_data.Variant("K")) + r.cache.AddVariant(raptor_data.Variant("L")) + + r.cache.AddVariant(raptor_data.Variant("V")) + + # + # g2.A.B + # g2.C.D + # + # + # V.E.F + # V.G.H + # X.I.J + # X.K.L + # + # returncode != 0) { - char *exitstr = force_success ? "failed" : retries > 0 ? "retry" : "failed"; + char *exitstr = (force_success || retries <= 0) ? "failed" : "retry"; snprintf(status, STATUS_STRMAX - 1, "\n", exitstr, p->returncode, attempt, flagsstr, reasonstr ); } else { snprintf(status, STATUS_STRMAX - 1, "\n", attempt, flagsstr, reasonstr );