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>
diff --git a/tools/src/cmd/test-runner/main.go b/tools/src/cmd/test-runner/main.go
index 63d6f59..1c72eac 100644
--- a/tools/src/cmd/test-runner/main.go
+++ b/tools/src/cmd/test-runner/main.go
@@ -381,16 +381,20 @@
 	}
 
 	// 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 @@
 	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
 	}