当前位置: 首页>>代码示例>>Python>>正文


Python SmokeTest.logfileOption方法代码示例

本文整理汇总了Python中raptor_tests.SmokeTest.logfileOption方法的典型用法代码示例。如果您正苦于以下问题:Python SmokeTest.logfileOption方法的具体用法?Python SmokeTest.logfileOption怎么用?Python SmokeTest.logfileOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在raptor_tests.SmokeTest的用法示例。


在下文中一共展示了SmokeTest.logfileOption方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
def run():
	t = SmokeTest()
	t.id = "29"
	t.name = "armv7_testcode"
	t.command = "sbs -b smoke_suite/test_resources/simple_test/bld.inf -c " + \
			"armv7.test -f - "
	
	# Don't allow -f to be appended
	t.logfileOption = lambda :""
	t.targets = [
		"$(EPOCROOT)/epoc32/release/armv7/urel/simple_test_auto.exe",
		"$(EPOCROOT)/epoc32/release/armv7/urel/simple_test_manual.exe",
		"$(EPOCROOT)/epoc32/release/armv7/udeb/simple_test_auto.exe",
		"$(EPOCROOT)/epoc32/release/armv7/udeb/simple_test_manual.exe",
		"$(EPOCROOT)/epoc32/include/testexportheader.h",
		"$(EPOCROOT)/epoc32/data/z/test/simple_test/armv7.auto.bat",
		"$(EPOCROOT)/epoc32/data/z/test/simple_test/armv7.manual.bat"
		]
	t.mustmatch = [".*/epoc32/data/z/test/simple_test/armv7.auto.bat</build>.*"]
	t.run()
	return t
开发者ID:fedor4ever,项目名称:linux_build,代码行数:23,代码来源:armv7_testcode.py

示例2: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
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
开发者ID:fedor4ever,项目名称:linux_build,代码行数:81,代码来源:talon_test.py

示例3: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
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
#.........这里部分代码省略.........
开发者ID:RomanSaveljev,项目名称:raptor,代码行数:103,代码来源:gccxml.py

示例4: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
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()
#.........这里部分代码省略.........
开发者ID:fedor4ever,项目名称:linux_build,代码行数:103,代码来源:romfile.py

示例5: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
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"
#.........这里部分代码省略.........
开发者ID:fedor4ever,项目名称:linux_build,代码行数:103,代码来源:splitlog_filter.py

示例6: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
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>",
#.........这里部分代码省略.........
开发者ID:fedor4ever,项目名称:linux_build,代码行数:103,代码来源:filter_params.py

示例7: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
def run():
	t = SmokeTest()
	t.logfileOption = lambda :""
	t.id = "0074a"
	t.name = "configpath"
	t.description = """Test --configpath option for sbs. Specify two remote
			locations and use the variants in those folders along with ones in
			each of the default folders."""

	# the variants here affect compile steps so we only need to see a single compile
	# to know whether the variant is doing its thing or not.
	t.addbuildtargets("smoke_suite/test_resources/simple/bld.inf",
	                  ["test_/armv5/udeb/test.o"])

	result = SmokeTest.PASS

	# the extra config folders are
	# smoke_suite/test_resources/configpathtest/v{2,3}
	sbshome = os.environ["SBS_HOME"].replace("\\","/")

	aFolder = sbshome + "/test/smoke_suite/test_resources/configpathtest/v2"
	bFolder = sbshome + "/test/smoke_suite/test_resources/configpathtest/v3"

	common = "sbs -b smoke_suite/test_resources/simple/bld.inf " + \
			"-c armv5.configpathtest1.configpathtest2.configpathtest3"

	# run the command using the built-in default systemConfig
	t.command = common + " --configpath=" + aFolder + os.pathsep + bFolder + \
			" -f -"

	t.mustmatch = [
		".*armv5_udeb.configpathtest1.configpathtest2.configpathtest3.*",
		".*armv5_urel.configpathtest1.configpathtest2.configpathtest3.*",
		".*Duplicate variant 'configpathtest3'.*",
		".*-DTESTPASSED.*",
		".*-DOSVARIANT95WASAPPLIED.*"
		]
	t.mustnotmatch = [
		".*sbs: error: Unknown variant.*",
		".*-DTESTFAILED.*"
		]
	# Duplicate variant is Info not Warn
	t.warnings = 0
	t.run()

	if t.result == SmokeTest.FAIL:
		result = SmokeTest.FAIL

	# run the command again using a systemConfig from $HOME/.sbs_init.xml
	# and the configpath as two separate options.
	t.usebash = True
	homedir = sbshome + "/test/smoke_suite/test_resources/configpathtest/home"
	t.command = "export HOME=" + homedir + "; " + common + \
			" --configpath=" + aFolder + " --configpath=" + bFolder + " -f -"
	t.id = "0074b"
	t.mustmatch = [
		".*armv5_udeb.configpathtest1.configpathtest2.configpathtest3.*",
		".*armv5_urel.configpathtest1.configpathtest2.configpathtest3.*",
		".*Duplicate variant 'configpathtest3'.*"
		]
	t.mustnotmatch = [
		".*sbs: error: Unknown variant.*"
		]
	t.run()

	if t.result == SmokeTest.FAIL:
		result = SmokeTest.FAIL
	
	# Clean
	t.mustmatch = []
	t.targets = []
	t.id = "0074c"
	t.name = "CLEAN"
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5 " + \
			"REALLYCLEAN"
	t.run() # Does not contribute to results

	t.id = "74"
	t.name = "configpath"
	t.result = result
	t.print_result()
	return t
开发者ID:fedor4ever,项目名称:linux_build,代码行数:84,代码来源:configpath.py

示例8: run

# 需要导入模块: from raptor_tests import SmokeTest [as 别名]
# 或者: from raptor_tests.SmokeTest import logfileOption [as 别名]
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]', '&#x0[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&#x00;&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;&#x08;\011.*&#x0b;&#x0c;.*&#x0e;&#x0f;&#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;&#x18;&#x19;&#x1a;&#x1b;&#x1c;&#x1d;&#x1e;&#x1f; !\"#\$%&'()\*\+,-\./0123456789:;<=>\[email protected]\[\\\]\^_`abcdefghijklmnopqrstuvwxyz{|}~&#x7f;&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;&#x88;&#x89;&#x8a;&#x8b;&#x8c;&#x8d;&#x8e;&#x8f;&#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;&#x98;&#x99;&#x9a;&#x9b;&#x9c;&#x9d;&#x9e;&#x9f;&#xa0;&#xa1;&#xa2;&#xa3;&#xa4;&#xa5;&#xa6;&#xa7;&#xa8;&#xa9;&#xaa;&#xab;&#xac;&#xad;&#xae;&#xaf;&#xb0;&#xb1;&#xb2;&#xb3;&#xb4;&#xb5;&#xb6;&#xb7;&#xb8;&#xb9;&#xba;&#xbb;&#xbc;&#xbd;&#xbe;&#xbf;&#xc0;&#xc1;&#xc2;&#xc3;&#xc4;&#xc5;&#xc6;&#xc7;&#xc8;&#xc9;&#xca;&#xcb;&#xcc;&#xcd;&#xce;&#xcf;&#xd0;&#xd1;&#xd2;&#xd3;&#xd4;&#xd5;&#xd6;&#xd7;&#xd8;&#xd9;&#xda;&#xdb;&#xdc;&#xdd;&#xde;&#xdf;&#xe0;&#xe1;&#xe2;&#xe3;&#xe4;&#xe5;&#xe6;&#xe7;&#xe8;&#xe9;&#xea;&#xeb;&#xec;&#xed;&#xee;&#xef;&#xf0;&#xf1;&#xf2;&#xf3;&#xf4;&#xf5;&#xf6;&#xf7;&#xf8;&#xf9;&#xfa;&#xfb;&#xfc;&#xfd;&#xfe;&#xff;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
开发者ID:RomanSaveljev,项目名称:raptor,代码行数:93,代码来源:talon_test.py


注:本文中的raptor_tests.SmokeTest.logfileOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。