Documentation
¶
Index ¶
- Variables
- func LoadBuilderConfigs(c context.Context) (map[string]*BuilderConfig, error)
- type BuilderConfig
- type ExpectationStatement
- func (es *ExpectationStatement) Applies(testName, configuration string) bool
- func (es *ExpectationStatement) ExpandModifiers() []string
- func (es *ExpectationStatement) IsDir() bool
- func (es *ExpectationStatement) ModifierMatch(mod string) bool
- func (es *ExpectationStatement) NameMatch(testName string) bool
- func (es *ExpectationStatement) Overrides(other *ExpectationStatement) bool
- func (e *ExpectationStatement) String() string
- type File
- type FileSet
- type Parser
Constants ¶
This section is empty.
Variables ¶
var ( // LayoutTestExpectations is a map of expectation file locations, relative to repo+branch. LayoutTestExpectations = map[string]string{ "TestExpectations": "third_party/blink/web_tests/TestExpectations", "ASANExpectations": "third_party/blink/web_tests/ASANExpectations", "LeakExpectations": "third_party/blink/web_tests/LeakExpectations", "MSANExpectations": "third_party/blink/web_tests/MSANExpectations", "NeverFixTests": "third_party/blink/web_tests/NeverFixTests", "SlowTests": "third_party/blink/web_tests/SlowTests", "SmokeTests": "third_party/blink/web_tests/SmokeTests", "StaleTestExpectations": "third_party/blink/web_tests/StaleTestExpectations", "W3CImportExpectations": "third_party/blink/web_tests/W3CImportExpectations", } )
Functions ¶
func LoadBuilderConfigs ¶
func LoadBuilderConfigs(c context.Context) (map[string]*BuilderConfig, error)
LoadBuilderConfigs loads bulders.json from gitiles.
Types ¶
type BuilderConfig ¶
type BuilderConfig struct { // PortName is the name of the OS port. PortName string `json:"port_name"` // Specifiers modify the conditions of the expectations. Specifiers []string `json:"specifiers"` // IsTryBuilder is true if the builder is a trybot. IsTryBuilder bool `json:"is_try_builder"` }
BuilderConfig represents the expectation settings for a builder.
type ExpectationStatement ¶
type ExpectationStatement struct { // LineNumber from the original input file. LineNumber int // Comment, if any. Comment string // Bugs associated with the test expectation. Bugs []string // Modifiers (optional) for the test expectation/ Modifiers []string // TestName identifies the test file or test directory. TestName string // Expectations is a list of expected test results. Expectations []string // Original line content. Original string // Dirty indicates that fields have changed since Original was parsed. Dirty bool }
ExpectationStatement represents a statement (one line) from a layout test expectation file.
func (*ExpectationStatement) Applies ¶
func (es *ExpectationStatement) Applies(testName, configuration string) bool
Applies returns true if the statement applies to the given test, configuration.
func (*ExpectationStatement) ExpandModifiers ¶
func (es *ExpectationStatement) ExpandModifiers() []string
ExpandModifiers returns the list of all modifiers that the rule should match.
func (*ExpectationStatement) IsDir ¶
func (es *ExpectationStatement) IsDir() bool
IsDir returns true if the statement's test name is actually a file path to a directory rather than an individual test.
func (*ExpectationStatement) ModifierMatch ¶
func (es *ExpectationStatement) ModifierMatch(mod string) bool
ModifierMatch returns true if the given modifier matches the statement's modifier or any of its expanded modifiers.
func (*ExpectationStatement) NameMatch ¶
func (es *ExpectationStatement) NameMatch(testName string) bool
NameMatch returns true if the extatement matches testName.
func (*ExpectationStatement) Overrides ¶
func (es *ExpectationStatement) Overrides(other *ExpectationStatement) bool
Overrides returns true if the receiver should override other when evaluating statement matches for a given test, configuration. This establishes an ordering on the expectation statements so they can be sorted by precedence.
func (*ExpectationStatement) String ¶
func (e *ExpectationStatement) String() string
type File ¶
type File struct { Path string Expectations []*ExpectationStatement }
File is an expectation file.
type FileSet ¶
type FileSet struct {
Files []*File
}
FileSet is a set of expectation files.
func (*FileSet) ForTest ¶
func (fs *FileSet) ForTest(testName string, config *BuilderConfig) []*ExpectationStatement
ForTest returns a list of ExpectationStatement, sorted in decreasing order of precedence, that match the given test and configuration.
func (*FileSet) UpdateExpectation ¶
func (fs *FileSet) UpdateExpectation(es *ExpectationStatement) error
UpdateExpectation updates a test expectation within a FileSet.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses layout test expectation files.
func NewStringParser ¶
NewStringParser returns a new instance of Parser for string input.
func (*Parser) Parse ¶
func (p *Parser) Parse() (*ExpectationStatement, error)
Parse parses a *line* of input to produce an ExpectationStatement, or error.