| 151 | return content |
| 152 | |
| 153 | def parse_test_comment(src_spirv_file_name, src_spirv): |
| 154 | src_spirv_lines = src_spirv.splitlines() |
| 155 | comment_line_count = 0 |
| 156 | while comment_line_count < len(src_spirv_lines): |
| 157 | if not src_spirv_lines[comment_line_count].strip().startswith(';;'): |
| 158 | break |
| 159 | comment_line_count += 1 |
| 160 | |
| 161 | if comment_line_count == 0: |
| 162 | print("Expected comment on test file '{}'. See README.md next to this file.".format(src_spirv_file_name)) |
| 163 | sys.exit(1) |
| 164 | |
| 165 | comment_block = src_spirv_lines[:comment_line_count] |
| 166 | spirv_block = src_spirv_lines[comment_line_count:] |
| 167 | |
| 168 | comment_block = ['// ' + line.replace(';;', '').strip() for line in comment_block] |
| 169 | |
| 170 | return '\n'.join(spirv_block), '\n'.join(comment_block) |
| 171 | |
| 172 | def run_diff_tool(diff_tool, src_file, dst_file, variant): |
| 173 | args = [diff_tool] |