本文整理汇总了Python中teamcity.messages.TeamcityServiceMessages.buildProblem方法的典型用法代码示例。如果您正苦于以下问题:Python TeamcityServiceMessages.buildProblem方法的具体用法?Python TeamcityServiceMessages.buildProblem怎么用?Python TeamcityServiceMessages.buildProblem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teamcity.messages.TeamcityServiceMessages
的用法示例。
在下文中一共展示了TeamcityServiceMessages.buildProblem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from teamcity.messages import TeamcityServiceMessages [as 别名]
# 或者: from teamcity.messages.TeamcityServiceMessages import buildProblem [as 别名]
def main():
parser = argparse.ArgumentParser(description='run_memory_map')
parser.add_argument('--toolchain', type=str, help='GCC toolchain path', default='')
parser.add_argument('--binutils_prefix', type=str, help='GNU binutils prefix', default='')
parser.add_argument('--file', type=str, help='Binary file')
parser.add_argument('--key_name', type=str, help='TeamCity buildStatisticValue key name suffix', default='none')
args = parser.parse_args()
tsm = TeamcityServiceMessages()
sections = parse_size(args.toolchain, args.binutils_prefix, args.file)
if sections:
flash_size = 0
ram_size = 0
other_size = 0
for section in sections:
if section.name in ['.text', '.ARM.exidx', '.relocate']:
flash_size += section.size
elif section.name in ['.bss', '.stack']:
ram_size += section.size
else:
other_size += section.size
tsm.message('buildStatisticValue', key='FLASH ({0})'.format(args.key_name), value=str(flash_size))
tsm.message('buildStatisticValue', key='RAM ({0})'.format(args.key_name), value=str(ram_size))
# tsm.message('buildStatisticValue', key='OTHER ({0})'.format(args.key_name), value=str(other_size))
else:
tsm.buildProblem('Unable to detect sections', '')
示例2: test_build_problem
# 需要导入模块: from teamcity.messages import TeamcityServiceMessages [as 别名]
# 或者: from teamcity.messages.TeamcityServiceMessages import buildProblem [as 别名]
def test_build_problem():
stream = StreamStub()
messages = TeamcityServiceMessages(output=stream, now=lambda: fixed_date)
messages.buildProblem(description='something is wrong', identity='me')
assert stream.observed_output.strip() == textwrap.dedent("""\
##teamcity[buildProblem timestamp='2000-11-02T10:23:01.556' description='something is wrong' identity='me']
""").strip().encode('utf-8')