[test/subset] Don't hash files without reason
Fixes https://github.com/harfbuzz/harfbuzz/issues/3118#issuecomment-894021518
This commit is contained in:
parent
42b119edb5
commit
b3f8288cca
|
@ -11,7 +11,6 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
import io
|
import io
|
||||||
import hashlib
|
|
||||||
|
|
||||||
from subset_test_suite import SubsetTestSuite
|
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 ())
|
expected_file = os.path.join (test_suite.get_output_directory (), test.get_font_name ())
|
||||||
with open (expected_file, "rb") as fp:
|
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:
|
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:
|
if should_check_ots:
|
||||||
print ("Checking output with ots-sanitize.")
|
print ("Checking output with ots-sanitize.")
|
||||||
if not check_ots (out_file):
|
if not check_ots (out_file):
|
||||||
|
|
Loading…
Reference in New Issue