(self)
| 45 | |
| 46 | @unittest.skip("Skip bin to elf conversion test") |
| 47 | def test_bin_to_elf_conversion(self) -> None: |
| 48 | if DISABLED: |
| 49 | return |
| 50 | tools: Tools |
| 51 | try: |
| 52 | tools = load_tools(BUILD_INFO_PATH) |
| 53 | except FileNotFoundError as e: |
| 54 | warnings.warn(f"Error while loading tools: {e}") |
| 55 | tools = load_tools(BUILD_INFO_PATH2) |
| 56 | bin_file = UNO / "firmware.hex" |
| 57 | map_file = UNO / "firmware.map" |
| 58 | output_elf = OUTPUT / "output.elf" |
| 59 | try: |
| 60 | bin_to_elf( |
| 61 | bin_file, |
| 62 | map_file, |
| 63 | tools.as_path, |
| 64 | tools.ld_path, |
| 65 | tools.objcopy_path, |
| 66 | output_elf, |
| 67 | ) |
| 68 | stdout = dump_symbol_sizes(tools.nm_path, tools.cpp_filt_path, output_elf) |
| 69 | print(stdout) |
| 70 | except KeyboardInterrupt as ki: |
| 71 | handle_keyboard_interrupt(ki) |
| 72 | raise |
| 73 | except Exception as e: |
| 74 | warnings.warn(f"Error while converting binary to ELF: {e}") |
| 75 | |
| 76 | |
| 77 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected