Validate that [ Slow ] is not used in expectations.txt
Bug: dawn:1832 Change-Id: Ic4b5f752aab7e4c26808703ffeb89545200204e6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/134102 Commit-Queue: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
817c076eb8
commit
1fbf40857c
|
@ -51,6 +51,15 @@ func (c Content) Validate() Diagnostics {
|
|||
var out Diagnostics
|
||||
for _, chunk := range c.Chunks {
|
||||
for _, ex := range chunk.Expectations {
|
||||
for _, status := range ex.Status {
|
||||
if status == "Slow" {
|
||||
out = append(out, Diagnostic{
|
||||
Severity: Error,
|
||||
Line: ex.Line,
|
||||
Message: fmt.Sprintf("\"Slow\" expectation is not valid here. Use slow_tests.txt instead."),
|
||||
})
|
||||
}
|
||||
}
|
||||
glob, err := tree.Glob(query.Parse(ex.Query))
|
||||
if err != nil {
|
||||
out = append(out, Diagnostic{
|
||||
|
|
|
@ -116,6 +116,19 @@ crbug.com/a/123 [ os-a ] a:b,c:d,* [ Failure ]
|
|||
},
|
||||
},
|
||||
},
|
||||
{ //////////////////////////////////////////////////////////////////////
|
||||
name: "slow invalid",
|
||||
expectations: `
|
||||
crbug.com/a/123 a:b,c:d,* [ Slow ]
|
||||
`,
|
||||
diagnostics: expectations.Diagnostics{
|
||||
{
|
||||
Line: 8,
|
||||
Severity: expectations.Error,
|
||||
Message: "\"Slow\" expectation is not valid here. Use slow_tests.txt instead.",
|
||||
},
|
||||
},
|
||||
},
|
||||
} {
|
||||
ex, err := expectations.Parse("expectations.txt", header+test.expectations)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue