Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
stats.py
00001 #!/usr/bin/env python 00002 00003 import re 00004 import sys 00005 import subprocess 00006 import os 00007 00008 def main(*args): 00009 with open('main.cpp') as file: 00010 tests = file.read() 00011 00012 cases = [] 00013 with open('template_all_names.txt') as file: 00014 while True: 00015 name = file.readline().strip('\n') 00016 desc = file.readline().strip('\n') 00017 if name == 'test_results': 00018 break 00019 00020 cases.append((name, desc)) 00021 00022 with open('template_wrapper.fmt') as file: 00023 template = file.read() 00024 00025 with open('main.cpp', 'w') as file: 00026 file.write(template.format( 00027 tests=tests, 00028 test_cases='\n'.join( 00029 4*' '+'Case("{desc}", {name}),'.format( 00030 name=name, desc=desc) for name, desc in cases))) 00031 00032 if __name__ == "__main__": 00033 main(*sys.argv[1:])
Generated on Tue Jul 12 2022 13:54:54 by
