From 886b9d477c2ae9ba224b55b7a6ad1e2dbb96cc85 Mon Sep 17 00:00:00 2001 From: John Stiles Date: Tue, 15 Sep 2020 11:16:10 -0400 Subject: [PATCH] Create blank SkSL test files for Ninja's benefit. GN lists both the .cpp and the .h as generated outputs, so if they don't exist, Ninja assumes we need to rebuild the tests every time we compile. Change-Id: I37b8b3d9e7aef1b0cb8d5c70530c2542a6c0087a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317108 Commit-Queue: John Stiles Commit-Queue: Brian Osman Auto-Submit: John Stiles Reviewed-by: Brian Osman --- gn/compile_sksl_tests.py | 14 +++++++------- .../golden/GrBothExplicitReturnAndSkOutColor.h | 0 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 tests/sksl/errors/golden/GrBothExplicitReturnAndSkOutColor.h diff --git a/gn/compile_sksl_tests.py b/gn/compile_sksl_tests.py index e6307572d8..5406f88cf6 100755 --- a/gn/compile_sksl_tests.py +++ b/gn/compile_sksl_tests.py @@ -9,9 +9,9 @@ import os import subprocess import sys -def unlinkIfExists(path): +def makeEmptyFile(path): try: - os.unlink(path) + open(path, 'wb').close() except OSError: pass @@ -47,12 +47,12 @@ for input in inputs: continue else: # The header generated an error; this counts as an overall failure for this test. - # Remove the passing CPP output since it's not relevant in a failure case. - unlinkIfExists(target + ".cpp") + # Blank out the passing CPP output since it's not relevant in a failure case. + makeEmptyFile(target + ".cpp") else: - # The CPP generated an error. We didn't actually generate a header, but there might be - # one from prior runs. Let's remove it for clarity. - unlinkIfExists(target + ".h") + # The CPP generated an error. We didn't actually generate a header at all, but Ninja + # expects an output file to exist or it won't reach steady-state. + makeEmptyFile(target + ".h") elif ext == ".sksl" or ext == ".vert": compile(skslc, input, target, ".glsl") else: diff --git a/tests/sksl/errors/golden/GrBothExplicitReturnAndSkOutColor.h b/tests/sksl/errors/golden/GrBothExplicitReturnAndSkOutColor.h new file mode 100644 index 0000000000..e69de29bb2