本文整理汇总了Python中sandbox.Sandbox.set_last_test_date方法的典型用法代码示例。如果您正苦于以下问题:Python Sandbox.set_last_test_date方法的具体用法?Python Sandbox.set_last_test_date怎么用?Python Sandbox.set_last_test_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sandbox.Sandbox
的用法示例。
在下文中一共展示了Sandbox.set_last_test_date方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: executeTests
# 需要导入模块: from sandbox import Sandbox [as 别名]
# 或者: from sandbox.Sandbox import set_last_test_date [as 别名]
def executeTests(self, commandLine):
log.debug("JUnitTestLoader.executeTests() with commandLine=%s", commandLine)
# Initialize our state.
start = time.time()
sb = Sandbox(SBROOT)
sb.set_last_test_date(start)
global _timeout_monitor
_timeout_monitor = None
testOutput = ""
err = 0
try:
# Start up a thread that will force us to exit if we hang.
pabrt = _ProcAbort()
_timeout_monitor = timeout_monitor.start(sb.get_test_timeout_seconds(), killfunc=pabrt)
# Always run tests in alphabetical order, for predictability
# and ease of explanation.
proc = subprocess.Popen(commandLine,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
_timeout_monitor.last_status = time.time()
pabrt.proc = proc
testOutput, stderr = proc.communicate()
err = proc.returncode
except Exception as e:
log.debug("JUnitTestLoader.executeTests(): Got exception: %s", str(e))
err = 1
finally:
if _timeout_monitor:
_timeout_monitor.stop()
if "[junit] '-classpath" in testOutput and 'BUILD FAILED' in testOutput:
err = 0
log.debug("JUnitTestLoader.executeTests(): Actually it's JUnit test failed, all is fine.")
if err != 0:
raise Exception("Building compiled test suite failed!")
return testOutput