do not write flip gifs, it's handled by web stuff now

This commit is contained in:
Ivan Avdeev 2025-02-06 14:02:48 -05:00
parent c7970f9952
commit 9d4dfa472a

@ -127,7 +127,7 @@ def render():
'+exec', 'rendertest.script'], '+exec', 'rendertest.script'],
env=env, check=True) env=env, check=True)
def compare_one(test: str, channel: str, image_base: str, image_gold: str, image_test: str, image_diff: str, image_flip: str): def compare_one(test: str, channel: str, image_base: str, image_gold: str, image_test: str, image_diff: str):
result = subprocess.run([imagecompare, image_gold, image_test, image_diff], text=True, capture_output=True) result = subprocess.run([imagecompare, image_gold, image_test, image_diff], text=True, capture_output=True)
match result.returncode: match result.returncode:
case 0: case 0:
@ -144,7 +144,6 @@ def compare_one(test: str, channel: str, image_base: str, image_gold: str, image
ret['image_gold'] = os.path.relpath(image_gold, REPORT_ROOT) ret['image_gold'] = os.path.relpath(image_gold, REPORT_ROOT)
ret['image_test'] = os.path.relpath(image_test, REPORT_ROOT) ret['image_test'] = os.path.relpath(image_test, REPORT_ROOT)
ret['image_diff'] = os.path.relpath(image_diff, REPORT_ROOT) ret['image_diff'] = os.path.relpath(image_diff, REPORT_ROOT)
ret['image_flip'] = os.path.relpath(image_flip, REPORT_ROOT)
return ret return ret
def compare(): def compare():
@ -157,19 +156,11 @@ def compare():
for test in args.tests: for test in args.tests:
for channel, _ in channels.items(): for channel, _ in channels.items():
image_base = f'{test}_{channel}' image_base = f'{test}_{channel}'
#image_test = f'{screenshot_base}/{image_base}.tga'
image_test = f'{ROOT}/work/gold/{image_base}.png' image_test = f'{ROOT}/work/gold/{image_base}.png'
image_gold = f'{ROOT}/gold/{image_base}.png' image_gold = f'{ROOT}/gold/{image_base}.png'
image_diff = f'{WORKDIR}/{image_base}_diff.png' image_diff = f'{WORKDIR}/{image_base}_diff.png'
image_flip = f'{WORKDIR}/{image_base}_flip.gif'
diffs.append(executor.submit(compare_one, test, channel, image_base, image_gold, image_test, image_diff, image_flip)) diffs.append(executor.submit(compare_one, test, channel, image_base, image_gold, image_test, image_diff))
# legacy
#executor.submit(subprocess.run, [convert,
# '(', image_gold, '-bordercolor', 'gold', '-border', '2x2', '-gravity', 'SouthWest', '-font', 'Impact', '-pointsize', '24', '-fill', 'gold', '-stroke', 'black', '-annotate', '0', 'GOLD', ')',
# '(', image_test, '-bordercolor', 'white', '-border', '2x2', '-fill', 'white', '-annotate', '0', 'TEST', ')',
# '-loop', '0', '-set', 'delay', '100', image_flip], check=True)
results = [diff.result() for diff in diffs] results = [diff.result() for diff in diffs]
# json.dump(results, open(f'{WORKDIR}/data.json', 'w')) # json.dump(results, open(f'{WORKDIR}/data.json', 'w'))