(diff_tool, src_file, dst_file, variant)
| 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] |
| 174 | |
| 175 | if variant == VARIANT_IGNORE_SET_BINDING or variant == VARIANT_IGNORE_DECORATIONS: |
| 176 | args.append('--ignore-set-binding') |
| 177 | |
| 178 | if variant == VARIANT_IGNORE_LOCATION or variant == VARIANT_IGNORE_DECORATIONS: |
| 179 | args.append('--ignore-location') |
| 180 | |
| 181 | if variant == VARIANT_DUMP_IDS: |
| 182 | args.append('--with-id-map') |
| 183 | |
| 184 | args.append('--no-color') |
| 185 | args.append('--no-indent') |
| 186 | |
| 187 | args.append(src_file) |
| 188 | args.append(dst_file) |
| 189 | |
| 190 | success = True |
| 191 | print(' '.join(args)) |
| 192 | process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) |
| 193 | out, err = process.communicate() |
| 194 | |
| 195 | if process.returncode != 0: |
| 196 | print(err) |
| 197 | sys.exit(process.returncode) |
| 198 | |
| 199 | # Use unix line endings. |
| 200 | out = out.replace('\r\n', '\n') |
| 201 | |
| 202 | return out |
| 203 | |
| 204 | def generate_extra_test(diff_tool, src_file, dst_file, variant, test_name_camel_case, test_tag, test_options): |
| 205 | diff = run_diff_tool(diff_tool, src_file, dst_file, variant) |
no outgoing calls
no test coverage detected