Avoid hard failure when invalid UTF8 is returned.

We want to run all the tests even if skslc returns a goofy character.

Change-Id: I0ee96ba28fb63204b69b4e01caa069e9ce7cc93e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534672
Reviewed-by: George Wright <wrightgeorge@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2022-04-27 15:06:46 -04:00 committed by SkCQ
parent 3e35228b40
commit c8830b9f4c

View File

@ -29,11 +29,11 @@ def executeWorklist(input, worklist):
worklist.close()
try:
output = subprocess.check_output([
skslc, worklist.name], stderr=subprocess.STDOUT).decode('utf-8')
skslc, worklist.name], stderr=subprocess.STDOUT).decode('utf-8', errors='ignore')
except subprocess.CalledProcessError as err:
if err.returncode != 1:
print("### " + input + " skslc error:\n")
print("\n".join(err.output.decode('utf-8').splitlines()))
print("\n".join(err.output.decode('utf-8', errors='ignore').splitlines()))
sys.exit(err.returncode)
pass # Compile errors (exit code 1) are expected and normal in test code