2 # -*- coding: utf-8 -*-
6 from datetime import datetime
9 from matrix_runner import main, matrix_axis, matrix_action, matrix_command, matrix_filter, \
10 FileReport, JUnitReport
13 @matrix_axis("device", "d", "Device(s) to be considered.")
14 class DeviceAxis(Enum):
15 CM0 = ('Cortex-M0', 'CM0')
16 CM0plus = ('Cortex-M0plus', 'CM0plus')
17 CM3 = ('Cortex-M3', 'CM3')
18 CM4 = ('Cortex-M4', 'CM4')
19 CM4FP = ('Cortex-M4FP', 'CM4FP')
20 CM7 = ('Cortex-M7', 'CM7')
21 CM7SP = ('Cortex-M7SP', 'CM7SP')
22 CM7DP = ('Cortex-M7DP', 'CM7DP')
23 CM23 = ('Cortex-M23', 'CM23')
24 CM23S = ('Cortex-M23S', 'CM23S')
25 CM23NS = ('Cortex-M23NS', 'CM23NS')
26 CM33 = ('Cortex-M33', 'CM33')
27 CM33S = ('Cortex-M33S', 'CM33S')
28 CM33NS = ('Cortex-M33NS', 'CM33NS')
29 CM35P = ('Cortex-M35P', 'CM35P')
30 CM35PS = ('Cortex-M35PS', 'CM35PS')
31 CM35PNS = ('Cortex-M35PNS', 'CM35PNS')
32 CM55 = ('Cortex-M55', 'CM55')
33 CM55S = ('Cortex-M55S', 'CM55S')
34 CM55NS = ('Cortex-M55NS', 'CM55NS')
35 CM85 = ('Cortex-M85', 'CM85')
36 CM85S = ('Cortex-M85S', 'CM85S')
37 CM85NS = ('Cortex-M85NS', 'CM85NS')
38 CA5 = ('Cortex-A5', 'CA5')
39 CA7 = ('Cortex-A7', 'CA7')
40 CA9 = ('Cortex-A9', 'CA9')
41 CA5NEON = ('Cortex-A5neon', 'CA5neon')
42 CA7NEON = ('Cortex-A7neon', 'CA7neon')
43 CA9NEON = ('Cortex-A9neon', 'CA9neon')
46 @matrix_axis("compiler", "c", "Compiler(s) to be considered.")
47 class CompilerAxis(Enum):
53 @matrix_axis("optimize", "o", "Optimization level(s) to be considered.")
54 class OptimizationAxis(Enum):
56 BALANCED = ('balanced')
63 """Run tests for the selected configurations using llvm's lit."""
64 yield run_lit(config.compiler[0], config.device[1], config.optimize[0])
68 return datetime.now().strftime('%Y%m%d%H%M%S')
71 def run_lit(toolchain, device, optimize):
72 return ["lit", "--xunit-xml-output", f"lit-{toolchain}-{optimize}-{device}.xunit", "-D", f"toolchain={toolchain}", "-D", f"device={device}", "-D", f"optimize={optimize}", "." ]
75 def filter_iar(config):
76 return config.compiler == CompilerAxis.IAR
79 def filter_gcc_cm85(config):
80 return config.compiler == CompilerAxis.GCC and config.device.match('CM85*')
83 #def filter_clang_cortex_a(config):
84 # return config.compiler == CompilerAxis.CLANG and config.device.match('CA*')
87 if __name__ == "__main__":