From 3db1820f0b743078a7df1ff3284dadf1a4b2621d Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 4 Jun 2021 21:58:07 +0000 Subject: [PATCH] test-runner: Don't overwrite SKIPs with --generate-expected Unless the test also passed validation. Prevents clobbering expected validation failures when you've only checked tint didn't error. Change-Id: I44be0c8b1f9ef1a0df51bba81f5ad694715204b8 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53383 Kokoro: Kokoro Commit-Queue: Ben Clayton Reviewed-by: James Price Reviewed-by: Antonio Maiorano --- tools/src/cmd/test-runner/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/src/cmd/test-runner/main.go b/tools/src/cmd/test-runner/main.go index 63d6f592d1..1c72eacdf1 100644 --- a/tools/src/cmd/test-runner/main.go +++ b/tools/src/cmd/test-runner/main.go @@ -381,16 +381,20 @@ func (j job) run(wd, exe, dxcPath, xcrunPath string, generateExpected, generateS } // Can we validate? + validate := false switch j.format { case spvasm: args = append(args, "--validate") // spirv-val is statically linked, always available + validate = true case hlsl: if dxcPath != "" { args = append(args, "--dxc", dxcPath) + validate = true } case msl: if xcrunPath != "" { args = append(args, "--xcrun", xcrunPath) + validate = true } } @@ -399,7 +403,7 @@ func (j job) run(wd, exe, dxcPath, xcrunPath string, generateExpected, generateS out = strings.ReplaceAll(out, "\r\n", "\n") matched := expected == "" || expected == out - if ok && generateExpected { + if ok && generateExpected && (validate || !skipped) { saveExpectedFile(j.file, j.format, out) matched = true }