本文整理汇总了Python中server.Server.find_exe方法的典型用法代码示例。如果您正苦于以下问题:Python Server.find_exe方法的具体用法?Python Server.find_exe怎么用?Python Server.find_exe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server.Server
的用法示例。
在下文中一共展示了Server.find_exe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_all
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import find_exe [as 别名]
def run_all(self):
"""For each file in the test suite, run client program
assuming each file represents an individual test."""
try:
server = Server(self.ini["core"], self.ini["module"])
except Exception as e:
print e
raise RuntimeError("Unknown server: core = {0}, module = {1}".format(
self.ini["core"], self.ini["module"]))
if len(self.tests) == 0:
# noting to test, exit
return 0
server.deploy(self.ini["config"],
server.find_exe(self.args.builddir, silent=False),
self.args.vardir, self.args.mem, self.args.start_and_exit,
self.args.gdb, self.args.valgrind,
init_lua=self.ini["init_lua"], silent=False)
if self.args.start_and_exit:
print " Start and exit requested, exiting..."
exit(0)
longsep = "=============================================================================="
shortsep = "------------------------------------------------------------"
print longsep
print string.ljust("TEST", 48), "RESULT"
print shortsep
failed_tests = []
self.ini["server"] = server
for test in self.tests:
sys.stdout.write(string.ljust(test.name, 48))
# for better diagnostics in case of a long-running test
sys.stdout.flush()
test_name = os.path.basename(test.name)
if test_name in self.ini["disabled"]:
print "[ skip ]"
elif not server.debug and test_name in self.ini["release_disabled"]:
print "[ skip ]"
elif self.args.valgrind and test_name in self.ini["valgrind_disabled"]:
print "[ skip ]"
else:
test.run(server)
if not test.passed():
failed_tests.append(test.name)
print shortsep
if len(failed_tests):
print "Failed {0} tests: {1}.".format(len(failed_tests),
", ".join(failed_tests))
server.stop(silent=False)
server.cleanup()
if self.args.valgrind and check_valgrind_log(server.valgrind_log):
print " Error! There were warnings/errors in valgrind log file:"
print_tail_n(server.valgrind_log, 20)
return 1
return len(failed_tests)
示例2: find_exe
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import find_exe [as 别名]
def find_exe(self, builddir, silent=True):
return Server.find_exe(self, "{0}/mod/{1}".format(builddir, self.module), silent)