Reland various cleanups to SkSLMain.
These cleanups were reverted, as they were part of the CL that added
`--` delimiters to skslc. This CL reinstates the cleanups, but does not
reinstate `--` delimited multiple-command-line support in skslc.
Change-Id: Id70ed87aa239b46d232492fc48791158b35512f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336677
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/gn/compile_sksl_tests.py b/gn/compile_sksl_tests.py
index 6cfe442..a87cf99 100755
--- a/gn/compile_sksl_tests.py
+++ b/gn/compile_sksl_tests.py
@@ -63,10 +63,12 @@
worklist.close()
try:
output = subprocess.check_output([skslc, worklist.name], stderr=subprocess.STDOUT)
-
except subprocess.CalledProcessError as err:
- print("### skslc error:\n")
- print("\n".join(err.output.splitlines()))
+ if err.returncode != 1:
+ print("### skslc error:\n")
+ print("\n".join(err.output.splitlines()))
+ sys.exit(err.returncode)
+ pass # Compile errors (exit code 1) are expected and normal in test code
os.remove(worklist.name)