cts: Change uniqueId() parameter to string. Add how-to-contribute to description.

- Update the spec version used to:
  https://www.w3.org/TR/2021/WD-WGSL-20210929/
- replace extra white spaces with "\s" instead of "\n"
- github PR: https://github.com/gpuweb/cts/pull/770

Bug: tint:1189
Change-Id: Ib8d0aaf57eac3fff4fd6943b4a3d2d0a691a9a0d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65740
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
Sarah 2021-10-04 14:54:37 +00:00 committed by Tint LUCI CQ
parent 7f3b68edd5
commit 22daca166b
1 changed files with 9 additions and 6 deletions

View File

@ -48,7 +48,7 @@ import (
const (
toolName = "get-test-plan"
specPath = "https://www.w3.org/TR/WGSL/"
specVersionUsed = "https://www.w3.org/TR/2021/WD-WGSL-20210910/"
specVersionUsed = "https://www.w3.org/TR/2021/WD-WGSL-20210929/"
)
var (
@ -673,7 +673,7 @@ var (
// `float abs:
// T is f32 or vecN<f32> abs(e: T ) -> T Returns the absolute value of e (e.g. e with a positive sign bit). Component-wise when T is a vector. (GLSLstd450Fabs)`
func cleanUpString(in string) string {
out := reCleanUpString.ReplaceAllString(in, "\n")
out := reCleanUpString.ReplaceAllString(in, " ")
out = reSpacePlusTwo.ReplaceAllString(out, " ")
//`§.` is not a valid character for a cts description
// ie. this is invalid: g.test().desc(`§.`)
@ -963,7 +963,7 @@ func isBuiltinFunctionRule(r rule) bool {
func testPlan(r rule) string {
sb := strings.Builder{}
sb.WriteString(fmt.Sprintf(unImplementedTestTemplate, r.TestName,
r.Sha, "`\n"+r.URL+"\n"+r.Description+"\n`"))
r.Sha, "`\n"+r.URL+"\n"+r.Description+"\n"+howToContribute+"`"))
return sb.String()
}
@ -980,17 +980,20 @@ export const g = makeTestGroup(ShaderValidationTest);
executionTestHeader = `export const description = %v;
import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { GPUTest } from '../../../gpu_test.js'
import { GPUTest } from '../../../gpu_test.js';
export const g = makeTestGroup(GPUTest);
`
unImplementedTestTemplate = `g.test('%v')
.uniqueId(0x%v)
.uniqueId('%v')
.desc(
%v
)
.params(u => u.combine('placeHolder1', ['placeHolder2', 'placeHolder3']))
.unimplemented();
`
howToContribute = `
Please read the following guidelines before contributing:
https://github.com/gpuweb/cts/blob/main/docs/plan_autogen.md
`
)