[test/subset] Don't hash files without reason

Fixes https://github.com/harfbuzz/harfbuzz/issues/3118#issuecomment-894021518
This commit is contained in:
Behdad Esfahbod 2022-02-12 14:52:42 -06:00
parent 42b119edb5
commit b3f8288cca
1 changed files with 3 additions and 4 deletions

View File

@ -11,7 +11,6 @@ import sys
import tempfile
import shutil
import io
import hashlib
from subset_test_suite import SubsetTestSuite
@ -63,11 +62,11 @@ def run_test (test, should_check_ots):
expected_file = os.path.join (test_suite.get_output_directory (), test.get_font_name ())
with open (expected_file, "rb") as fp:
expected_hash = hashlib.sha224(fp.read()).hexdigest()
expected_contents = fp.read()
with open (out_file, "rb") as fp:
actual_hash = hashlib.sha224(fp.read()).hexdigest()
actual_contents = fp.read()
if expected_hash == actual_hash:
if expected_contents == actual_contents:
if should_check_ots:
print ("Checking output with ots-sanitize.")
if not check_ots (out_file):