def run(): t = SmokeTest() t.description = """talon_test: two part test 1) Test talon's -c option 2) Test talon with a script file that has some blank lines and a single non-blank command line """ # Don't need these as we are not invoking Raptor t.logfileOption = lambda : "" t.makefileOption = lambda : "" # Set up variables for talon bindir = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin") bash = bindir + "/bash" talon = bindir + "/talon" # Adjust if on Windows - three "tries" for Bash on Windows. # 1 Default try if "win" in sys.platform.lower(): bash = ReplaceEnvs("$(SBS_HOME)/win32/cygwin/bin/bash.exe") talon = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin/talon.exe") # 2 Bash from a Cygwin if os.environ.has_key("SBS_CYGWIN"): bash = ReplaceEnvs("$(SBS_CYGWIN)/bin/bash.exe") # 3 Bash from an env. var. if os.environ.has_key("SBS_SHELL"): bash = os.environ["SBS_SHELL"] # Talon's command line commandline="\"|name=commandlinetest;COMPONENT_META=commandline/group/bld.inf;PROJECT_META=commandline.mmp;|echo Command line invocation output\"" # Talon's "shell script" scriptfile=ReplaceEnvs("$(SBS_HOME)/test/smoke_suite/test_resources/talon_test/script") # Environment variables needed by talon - TALON_SHELL must be bash; the other two can be arbitrary. os.environ["TALON_SHELL"]=bash os.environ["TALON_BUILDID"]=str(t.id) os.environ["TALON_RECIPEATTRIBUTES"]="component=talontest" # First part of test - command line t.name = "talon_test command line" t.id = "100a" t.command = "%s -c %s" % (talon, commandline) t.targets = [] t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Command line invocation output" + ".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + ".*<status exit='ok' attempt='1' />.*</recipe>"] t.run() if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL # Second part of test - script file t.name = "talon_test script file" t.id = "100b" t.command = "%s %s" % (talon, scriptfile) t.targets = [] t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Script file output" + ".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + ".*<status exit='ok' attempt='1' />.*</recipe>"] t.run() if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL # Print final result t.name = "talon_test" t.id = "100" t.print_result() # Delete the added environment variables del os.environ["TALON_SHELL"] del os.environ["TALON_BUILDID"] del os.environ["TALON_RECIPEATTRIBUTES"] return t
def run(): result = SmokeTest.PASS t = SmokeTest() t.id = "0057a" t.name = "gccxml" t.usebash = True t.command = "sbs -b smoke_suite/test_resources/simple_gui/bld.inf " + \ "-c gccxml_urel -m ${SBSMAKEFILE} -f ${SBSLOGFILE} && " + \ "grep -o 'gcc.*-fpermissive' ${SBSLOGFILE}" t.targets = [ "$(EPOCROOT)/epoc32/release/gccxml/includeheaders.txt", "$(EPOCROOT)/epoc32/release/gccxml/urel/helloworldexe.gxp" ] t.addbuildtargets('smoke_suite/test_resources/simple_gui/bld.inf', [ "helloworld_exe/gccxml/HelloWorld.mmp.xml", "helloworld_exe/helloworld_HelloWorld.rsc.d", "helloworld_exe/gccxml/HelloWorld.rss.rfi", "helloworld_reg_exe/helloworld_reg_HelloWorld_reg.rsc.d", "helloworld_exe/gccxml/HelloWorld_reg.rss.rfi", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml" ]) t.mustmatch = [ ".*gcc.*-fpermissive.*" ] # Windows-only until formal delivery of a Linux version of gccxml_cc1plus t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL elif t.result == SmokeTest.SKIP: return t t = AntiTargetSmokeTest() t.id = "0057b" t.name = "gccxml_reallyclean" t.command = "sbs -b smoke_suite/test_resources/simple_gui/bld.inf " + \ "-c gccxml_urel REALLYCLEAN" t.antitargets = ["$(EPOCROOT)/epoc32/release/gccxml/urel/helloworldexe.gxp"] t.addbuildantitargets('smoke_suite/test_resources/simple_gui/bld.inf', [ "helloworld_exe/gccxml/HelloWorld.mmp.xml", "helloworld_exe/helloworld_HelloWorld.rsc.d", "helloworld_exe/gccxml/HelloWorld.rss.rfi", "helloworld_reg_exe/helloworld_reg_HelloWorld_reg.rsc.d", "helloworld_exe/gccxml/HelloWorld_reg.rss.rfi", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml" ]) t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t = SmokeTest() t.id = "0057c" t.name = "gccxml_var2" t.command = "sbs -b smoke_suite/test_resources/simple_gui/BldVar2.inf " + \ "-c gccxml_urel -f -" # Don't allow -m or -f to be appended t.logfileOption = lambda :"" t.makefileOption = lambda :"" t.mustmatch = [".*__KERNEL_MODE__.*"] t.errors = 1 # not really VAR2 code, so it wont build cleanly t.returncode = 1 t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t = SmokeTest() t.id = "0057d" t.name = "gccxml_stdcpp" t.command = "sbs -b smoke_suite/test_resources/simple_gui/Bld_stdcpp.inf " + \ "-c gccxml_urel -f -" # Don't allow -m or -f to be appended t.logfileOption = lambda :"" t.makefileOption = lambda :"" t.mustmatch = [".*__SYMBIAN_STDCPP_SUPPORT__.*"] t.errors = 0 # reset after previous run t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t.id = "57" t.name = "gccxml" t.result = result t.print_result() return t
def run(): t = SmokeTest() t.description = "Test the passing of parameters to log filters" command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel --filters=" # no parameters means count all tags t.name = "filter_params_all_tags" t.command = command + "FilterTagCounter" t.mustmatch_singleline = [ "^info \d+ \d+", "^whatlog \d+ \d+", "^clean \d+ \d+" ] t.run() # empty parameter lists are valid t.name = "filter_params_all_tags2" t.command = command + "FilterTagCounter[]" t.run() # parameters mean report only those tags t.name = "filter_params_info" t.command = command + "FilterTagCounter[info]" t.mustmatch_singleline = ["^info \d+ \d+"] t.mustnotmatch_singleline = ["^whatlog \d+ \d+", "^clean \d+ \d+"] t.run() # multiple parameters are valid t.name = "filter_params_info_clean" t.command = command + "FilterTagCounter[info,clean]" t.mustmatch_singleline = ["^info \d+ \d+", "^clean \d+ \d+"] t.mustnotmatch_singleline = ["^whatlog \d+ \d+"] t.run() # using the same filter with different parameters is valid t.name = "filter_params_info_clean2" t.command = command + "FilterTagCounter[info],FilterTagCounter[clean]" t.run() # using the same filter with the same parameters is valid too t.name = "filter_params_info_clean3" t.command = command + "FilterTagCounter[info,clean],FilterTagCounter[info,clean]" t.run() # parameters must work with the sbs_filter script as well command = "sbs_filter --filters={0} < smoke_suite/test_resources/logexamples/filter_component.log" t.logfileOption = lambda: "" t.makefileOption = lambda: "" # should still work with no parameters t.name = "sbs_filter_no_params" t.command = command.format("FilterComp") t.mustmatch_singleline = [] t.mustnotmatch_singleline = [ "[<>]" # no elements should be printed at all as no bld.inf is selected ] t.run() # should work with an empty parameter list t.name = "sbs_filter_no_params2" t.command = command.format("FilterComp[]") t.run() # with a parameter t.name = "sbs_filter_one_param" t.command = command.format("FilterComp[email]") t.stdout = [ "<error bldinf='y:/src/email/bld.inf'>email error #1</error>", "<error bldinf='y:/src/email/bld.inf'>email error #2</error>", "<warning bldinf='y:/src/email/bld.inf'>email warning #1</warning>", "<warning bldinf='y:/src/email/bld.inf'>email warning #2</warning>", "<whatlog bldinf='y:/src/email/bld.inf' config='armv5_urel' mmp='y:/src/email/a.mmp'>", "<build>/epoc32/data/email_1</build>", "<build>/epoc32/data/email_2</build>", "</whatlog>", "<recipe bldinf='y:/src/email/bld.inf' name='dummy'>", "+ make_email", "email was made fine", "<status exit='ok'></status>", "</recipe>", "<fake bldinf='y:src/email/bld.inf'>", " <foo>", " <bar>", " <fb>fb email</fb>", " </bar>", " </foo>", "</fake>" ] t.mustmatch_singleline = [] t.mustnotmatch_singleline = [] t.warnings = 2 t.errors = 2 t.run() # with multiple filters t.name = "sbs_filter_multi" t.command = command.format("FilterComp[txt],FilterTagCounter[file,recipe]") t.stdout = [] t.mustmatch_singleline = ["txt", "^file \d+", "^recipe \d+"] t.mustnotmatch_singleline = ["email"] t.warnings = 2 t.errors = 0 t.run() t.name = "filter_params" t.print_result() return t
def run(): t = SmokeTest() t.description = """ Tests the creation and content of an .iby romfile for the armv5.test configuration. Also tests for creation of relevant test batch files. """ t.usebash = True # Don't allow -m or -f to be appended t.logfileOption = lambda :"" t.makefileOption = lambda :"" t.id = "55a" # Check content of iby file is correct # Check batch files are generated t.name = "romfile_general" t.command = "sbs -b $(EPOCROOT)/src/ongoing/group/romfile/other_name.inf " \ + "-c armv5.test ROMFILE -m ${SBSMAKEFILE} -f ${SBSLOGFILE} " \ + "&& cat $(EPOCROOT)/epoc32/rom/src/ongoing/group/romfile/armv5test.iby" t.targets = [ "$(EPOCROOT)/epoc32/rom/src/ongoing/group/romfile/armv5test.iby", "$(EPOCROOT)/epoc32/data/z/test/src/armv5.auto.bat", "$(EPOCROOT)/epoc32/data/z/test/src/armv5.manual.bat" ] # Check the content of the generated .iby file. t.mustmatch = [ # The comment that is put at the start of the file. r".*// epoc32/rom/src/ongoing/group/romfile/armv5test\.iby\n.*", # The batch files that are added by the build system. r".*\ndata=/epoc32/data/z/test/src/armv5\.auto\.bat test/src\.auto\.bat\n.*", r".*\ndata=/epoc32/data/z/test/src/armv5\.manual\.bat test/src\.manual\.bat\n.*", # Some normal files. r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_rand\.exe\s+sys/bin/t_rand\.exe\n.*", r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_swapfsys\.exe\s+sys/bin/t_swapfsys\.exe\n.*", r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_localtime\.exe\s+sys/bin/t_localtime\.exe\n.*", # Some files where the MMP file has the PAGED or UNPAGED keywords. r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_pagestress\.exe\s+sys/bin/t_pagestress\.exe paged\n.*", r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_fsys\.exe\s+sys/bin/t_fsys\.exe unpaged\n.*", # Some files where the MMP file has the ROMTARGET or RAMTARGET keywords. r".*\ndata=/epoc32/release/##MAIN##/##BUILD##/t_prel\.dll\s+/sys/bin/t_prel\.dll attrib=r\n.*", r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+sys/bin/t_sysbin\.exe\n.*", r".*\ndata=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+/sys/bin/t_sysbin_ram\.exe attrib=r\n.*", r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+/sys/bin/t_sysbina\.exe\n.*", r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+/system/programs/t_sysbinb\.exe\n.*" ] t.mustnotmatch = [ # Try to detect file paths that contain two or more slashes in a row, # without flagging C++ style comments. r"\w//+\w" ] t.warnings = 0 if t.onWindows else 2 t.run() t.id = "55b" # t.targets and t.warnings are the same as above and thus omitted t.name = "romfile_whatlog" t.command = "sbs -b $(EPOCROOT)/src/ongoing/group/romfile/other_name.inf " \ + "-c armv5.test ROMFILE -f -" t.mustmatch = [ # Check whatlog output includes batch files and .iby file r".*/epoc32/rom/src/ongoing/group/romfile/armv5test.iby</build>.*", r".*/epoc32/data/z/test/src/armv5.auto.bat</build>.*", r".*/epoc32/data/z/test/src/armv5.manual.bat</build>.*" ] t.mustnotmatch = [] t.run() t.id = "55c" t.name = "romfile_mmp_include_twice" t.command = "sbs -b $(EPOCROOT)/src/e32test/group/bld.inf " \ + "-b $(EPOCROOT)/src/falcon/test/bld.inf " \ + "-c armv5.test ROMFILE -m ${SBSMAKEFILE} -f ${SBSLOGFILE} " \ + "&& cat $(EPOCROOT)/epoc32/rom/src/e32test/group/armv5test.iby" t.targets = [ "$(EPOCROOT)/epoc32/rom/src/e32test/group/armv5test.iby" ] # Check the content of the generated .iby file t.mustmatch = [ r".*\ndevice\[MAGIC\]=/epoc32/release/##KMAIN##/##BUILD##/d_nanowait\.ldd\s+sys/bin/d_nanowait\.ldd\n.*", r".*\ndevice\[MAGIC\]=/epoc32/release/##KMAIN##/##BUILD##/d_pagingexample_2_post.ldd\s+sys/bin/d_pagingexample_2_post.ldd\n.*", ] t.mustnotmatch = [ # These two files are from two mmp files that included in both bld.inf # They shouldn't be in the ROM r".*/d_medch.ldd\s.*" r".*/d_dma.ldd\s.*" ] t.warnings = 0 t.run() t.id = "55" t.name = "romfile" t.print_result() return t
def run(): result = SmokeTest.PASS t = SmokeTest() # Override logfileoption and makefileoption to stop them adding '-f' and '-m' t.logfileOption = lambda : "" t.makefileOption = lambda : "" t.id = "0083a" t.name = "splitlog_filter" t.description = "Tests scanlog_filter output" t.usebash = True t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5 " + \ "--filters=FilterSplitlog " + \ "-f $(EPOCROOT)/epoc32/build/splitlog.xml " + \ "&& cat $(EPOCROOT)/epoc32/build/splitlog.xml" t.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" ] t.addbuildtargets('smoke_suite/test_resources/simple/bld.inf', [ "test_/armv5/udeb/test.o", "test_/armv5/urel/test.o" ]) t.mustmatch = [ ".*<info.*" ] t.mustnotmatch = [ ".*<clean.*", ".*</clean>.*", ".*<whatlog.*", ".*</whatlog>.*", ".*<recipe.*", ".*</recipe>.*" ] t.run() if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t.id = "0083b" t.name = "splitlog_cleancheck" t.command = "cat $(EPOCROOT)/epoc32/build/splitlog.clean.xml" t.targets = [] t.mustmatch = [ ".*<clean.*", ".*</clean>.*" ] t.mustnotmatch = [ ".*<info.*" ".*<whatlog.*", ".*</whatlog>.*", ".*<recipe.*", ".*</recipe>.*" ] t.run() if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t.id = "0083c" t.name = "splitlog_whatlogcheck" t.command = "cat $(EPOCROOT)/epoc32/build/splitlog.whatlog.xml" t.mustmatch = [ ".*<whatlog.*", ".*</whatlog>.*" ] t.mustnotmatch = [ ".*<info.*", ".*<clean.*", ".*</clean>.*", ".*<recipe.*", ".*</recipe>.*" ] t.run() if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t.id = "0083d" t.name = "splitlog_recipecheck" t.command = "cat $(EPOCROOT)/epoc32/build/splitlog.recipe.xml" t.mustmatch = [ ".*<recipe.*", ".*</recipe>.*" ] t.mustnotmatch = [ ".*<info.*", ".*<clean.*", ".*</clean>.*", ".*<whatlog.*", ".*</whatlog>.*" ] t.run() if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t.id = "83" t.name = "splitlog_filter" t.result = result t.print_result() return t
def run(): t = SmokeTest() t.description = "Test the passing of parameters to log filters" command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel --filters=" # no parameters means count all tags t.name = "filter_params_all_tags" t.command = command + "FilterTagCounter" t.mustmatch_singleline = [ "^info \d+ \d+", "^whatlog \d+ \d+", "^clean \d+ \d+" ] t.run() # empty parameter lists are valid t.name = "filter_params_all_tags2" t.command = command + "FilterTagCounter[]" t.run() # parameters mean report only those tags t.name = "filter_params_info" t.command = command + "FilterTagCounter[info]" t.mustmatch_singleline = [ "^info \d+ \d+" ] t.mustnotmatch_singleline = [ "^whatlog \d+ \d+", "^clean \d+ \d+" ] t.run() # multiple parameters are valid t.name = "filter_params_info_clean" t.command = command + "FilterTagCounter[info,clean]" t.mustmatch_singleline = [ "^info \d+ \d+", "^clean \d+ \d+" ] t.mustnotmatch_singleline = [ "^whatlog \d+ \d+" ] t.run() # using the same filter with different parameters is valid t.name = "filter_params_info_clean2" t.command = command + "FilterTagCounter[info],FilterTagCounter[clean]" t.run() # using the same filter with the same parameters is valid too t.name = "filter_params_info_clean3" t.command = command + "FilterTagCounter[info,clean],FilterTagCounter[info,clean]" t.run() # parameters must work with the sbs_filter script as well command = "sbs_filter --filters=%s < smoke_suite/test_resources/logexamples/filter_component.log" t.logfileOption = lambda :"" t.makefileOption = lambda :"" # should still work with no parameters t.name = "sbs_filter_no_params" t.command = command % "FilterComp" t.mustmatch_singleline = [ ] t.mustnotmatch_singleline = [ "[<>]" # no elements should be printed at all as no bld.inf is selected ] t.run() # should work with an empty parameter list t.name = "sbs_filter_no_params2" t.command = command % "FilterComp[]" t.run() # with a parameter t.name = "sbs_filter_one_param" t.command = command % "FilterComp[email]" t.stdout = [ "<error bldinf='y:/src/email/bld.inf'>email error #1</error>", "<error bldinf='y:/src/email/bld.inf'>email error #2</error>", "<warning bldinf='y:/src/email/bld.inf'>email warning #1</warning>", "<warning bldinf='y:/src/email/bld.inf'>email warning #2</warning>", "<whatlog bldinf='y:/src/email/bld.inf' config='armv5_urel' mmp='y:/src/email/a.mmp'>", "<build>/epoc32/data/email_1</build>", "<build>/epoc32/data/email_2</build>", "</whatlog>", "<recipe bldinf='y:/src/email/bld.inf' name='dummy'>", "+ make_email", "email was made fine", "<status exit='ok'></status>", "</recipe>", "<fake bldinf='y:src/email/bld.inf'>", " <foo>", " <bar>", " <fb>fb email</fb>", " </bar>", " </foo>", "</fake>" ] t.mustmatch_singleline = [] t.mustnotmatch_singleline = [] t.warnings = 2 t.errors = 2 t.run() # with multiple filters t.name = "sbs_filter_multi" t.command = command % "FilterComp[txt],FilterTagCounter[file,recipe]" t.stdout = [] t.mustmatch_singleline = [ "txt", "^file \d+", "^recipe \d+" ] t.mustnotmatch_singleline = [ "email" ] t.warnings = 2 t.errors = 0 t.run() t.name = "filter_params" t.print_result() return t
def run(): t = SmokeTest() t.description = """talon_test: three part test 1) Test talon's -c option 2) Test talon with a script file that has some blank lines and a single non-blank command line 3) Test talon with a command that outputs control characters """ # Don't need these as we are not invoking Raptor t.logfileOption = lambda : "" t.makefileOption = lambda : "" # Set up variables for talon bindir = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin") bash = "/bin/bash" talon = bindir + "/talon" # Adjust if on Windows - three "tries" for Bash on Windows. # 1 Default try if "win" in sys.platform.lower(): bash = ReplaceEnvs("$(SBS_HOME)/win32/cygwin/bin/bash.exe") talon = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin/talon.exe") # 2 Bash from a Cygwin if "SBS_CYGWIN" in os.environ: bash = ReplaceEnvs("$(SBS_CYGWIN)/bin/bash.exe") # 3 Bash from an env. var. if "SBS_SHELL" in os.environ: bash = os.environ["SBS_SHELL"] # Talon's command line commandline="\"|name=commandlinetest;COMPONENT_META=commandline/group/bld.inf;PROJECT_META=commandline.mmp;|echo Command line invocation output\"" # Talon's "shell script" scriptfile=ReplaceEnvs("$(SBS_HOME)/test/smoke_suite/test_resources/talon_test/script") # Environment variables needed by talon - TALON_SHELL must be bash; the other two can be arbitrary. os.environ["TALON_SHELL"]=bash os.environ["TALON_BUILDID"]="{0}_{1}".format("talon_buildid", os.getpid()) os.environ["TALON_RECIPEATTRIBUTES"]="component=talontest" # First part of test - command line t.name = "talon_test_command_line" t.command = "{0} -c {1}".format(talon, commandline) t.targets = [] t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Command line invocation output" + ".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + ".*<status exit='ok' attempt='1' />.*</recipe>"] t.run() # Second part of test - script file t.name = "talon_test_script_file" t.command = "{0} {1}".format(talon, scriptfile) t.targets = [] t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Script file output" + ".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + ".*<status exit='ok' attempt='1' />.*</recipe>"] t.run() # a script which outputs control characters scriptfile=ReplaceEnvs("$(SBS_HOME)/test/smoke_suite/test_resources/talon_test/ctrl.py") t.name = "talon_test_control_chars" t.command = '{0} -c "|name=ctrl;|python {1}"'.format(talon, scriptfile) t.targets = [] # the script writes "AAA", then each char from 0 to 255, then "ZZZ". # 0-31 and 127-255 decimal are not allowed in the output, except for 9, 10 and 13. # check that the non-printable codes are missing and also that CTRL-I, CTRL-J and # CTRL-M are not converted. t.mustnotmatch = [ '[\000-\010\013\014\016-\037\177-\377]', '�[9ad];' ] # do not try and match CTRL-J and CTRL-M explicitly because line ending # conversions between talon and here will mess things up. t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*" + "AAA�\011.*.* !\"#\$%&'()\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿZZZ" + ".*\]\].*</recipe>"] t.run() # Print final result t.name = "talon_test" t.print_result() # Delete the added environment variables del os.environ["TALON_SHELL"] del os.environ["TALON_BUILDID"] del os.environ["TALON_RECIPEATTRIBUTES"] return t
def run(): result = SmokeTest.PASS t = SmokeTest() t.id = "0057a" t.name = "gccxml" t.usebash = True t.command = "sbs -b smoke_suite/test_resources/simple_gui/bld.inf " + \ "-c gccxml_urel -m ${SBSMAKEFILE} -f ${SBSLOGFILE} && " + \ "grep -o 'gcc.*-fpermissive' ${SBSLOGFILE}" t.targets = [ "$(EPOCROOT)/epoc32/release/gccxml/includeheaders.txt", "$(EPOCROOT)/epoc32/release/gccxml/urel/helloworldexe.gxp" ] t.addbuildtargets('smoke_suite/test_resources/simple_gui/bld.inf', [ "helloworld_exe/gccxml/HelloWorld.mmp.xml", "helloworld_exe/helloworld_HelloWorld.rsc.d", "helloworld_exe/gccxml/HelloWorld.rss.rfi", "helloworld_reg_exe/helloworld_reg_HelloWorld_reg.rsc.d", "helloworld_exe/gccxml/HelloWorld_reg.rss.rfi", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml" ]) t.mustmatch = [".*gcc.*-fpermissive.*"] # Windows-only until formal delivery of a Linux version of gccxml_cc1plus t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL elif t.result == SmokeTest.SKIP: return t t = AntiTargetSmokeTest() t.id = "0057b" t.name = "gccxml_reallyclean" t.command = "sbs -b smoke_suite/test_resources/simple_gui/bld.inf " + \ "-c gccxml_urel REALLYCLEAN" t.antitargets = [ "$(EPOCROOT)/epoc32/release/gccxml/urel/helloworldexe.gxp" ] t.addbuildantitargets('smoke_suite/test_resources/simple_gui/bld.inf', [ "helloworld_exe/gccxml/HelloWorld.mmp.xml", "helloworld_exe/helloworld_HelloWorld.rsc.d", "helloworld_exe/gccxml/HelloWorld.rss.rfi", "helloworld_reg_exe/helloworld_reg_HelloWorld_reg.rsc.d", "helloworld_exe/gccxml/HelloWorld_reg.rss.rfi", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Application.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppUi.xml", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_AppView.xml", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Document.xml", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml.d", "helloworld_exe/gccxml/urel/HelloWorld_Main.xml" ]) t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t = SmokeTest() t.id = "0057c" t.name = "gccxml_var2" t.command = "sbs -b smoke_suite/test_resources/simple_gui/BldVar2.inf " + \ "-c gccxml_urel -f -" # Don't allow -m or -f to be appended t.logfileOption = lambda: "" t.makefileOption = lambda: "" t.mustmatch = [".*__KERNEL_MODE__.*"] t.errors = 1 # not really VAR2 code, so it wont build cleanly t.returncode = 1 t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t = SmokeTest() t.id = "0057d" t.name = "gccxml_stdcpp" t.command = "sbs -b smoke_suite/test_resources/simple_gui/Bld_stdcpp.inf " + \ "-c gccxml_urel -f -" # Don't allow -m or -f to be appended t.logfileOption = lambda: "" t.makefileOption = lambda: "" t.mustmatch = [".*__SYMBIAN_STDCPP_SUPPORT__.*"] t.errors = 0 # reset after previous run t.run("windows") if t.result == SmokeTest.FAIL: result = SmokeTest.FAIL t.id = "57" t.name = "gccxml" t.result = result t.print_result() return t