MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / run_diff_tool

Function run_diff_tool

test/diff/diff_files/generate_tests.py:172–202  ·  view source on GitHub ↗
(diff_tool, src_file, dst_file, variant)

Source from the content-addressed store, hash-verified

170 return '\n'.join(spirv_block), '\n'.join(comment_block)
171
172def 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
204def 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)

Callers 2

generate_extra_testFunction · 0.85
generate_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected