times.go: Add test query filter

Usage: `./tools/run cts time -query QUERY ...`

Change-Id: Ifac16ee2405d1b5d03d246bf1556245e2dafe8c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93304
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Austin Eng
2022-06-10 17:24:23 +00:00
committed by Dawn LUCI CQ
parent 09b79e8950
commit 737ff5b482
2 changed files with 16 additions and 0 deletions

View File

@@ -270,6 +270,13 @@ func (l List) FilterByVariant(tags Tags) List {
})
}
/// FilterByQuery returns the results that match the given query
func (l List) FilterByQuery(q query.Query) List {
return l.Filter(func(r Result) bool {
return q.Contains(r.Query)
})
}
// Statuses is a set of Status
type Statuses = container.Set[Status]