(self, real: bool = True)
| 107 | return self.output_dir / "build.log" |
| 108 | |
| 109 | def parse(self, real: bool = True) -> Tuple[Dict, Dict, Dict, Dict]: |
| 110 | with open(self.build_log_path) as f: |
| 111 | lines = f.read().replace("\\\n", "").split("\n") |
| 112 | |
| 113 | compiles, links, assems = [], [], [] |
| 114 | for line in lines: |
| 115 | if not line: |
| 116 | continue |
| 117 | command = self.parse_command(line) |
| 118 | if command.is_link(): |
| 119 | links.append(command) |
| 120 | else: |
| 121 | compiles.append(command) |
| 122 | if command.is_assemble(): |
| 123 | assems.append(command) |
| 124 | |
| 125 | srcs = dict() |
| 126 | for cmd in compiles: |
| 127 | for src in cmd.sources(True): |
| 128 | srcs[src] = cmd |
| 129 | |
| 130 | compiles = { |
| 131 | compile_cmd.output(real): compile_cmd for compile_cmd in compiles |
| 132 | } |
| 133 | links = {link_cmd.output(real): link_cmd for link_cmd in links} |
| 134 | assems = {assem_cmd.output(real): assem_cmd for assem_cmd in assems} |
| 135 | |
| 136 | return srcs, compiles, links, assems |
| 137 | |
| 138 | def parse_command(self, captured_command: str) -> CMD: |
| 139 | tokens = [ |
no test coverage detected