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 <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton 2021-06-04 21:58:07 +00:00 committed by Tint LUCI CQ
parent 93e8f527ee
commit 3db1820f0b
1 changed files with 5 additions and 1 deletions

View File

@ -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
}