Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
Benchmarks map[string]func(*testing.B)
BuildOutput string
CompilerFlags []string
}
Context is an internal subset of lem.Context. Please refer to lem.Context for additional information.
type Int64Range ¶
Int64Range is an inclusive range of int64 values.
func (Int64Range) Eq ¶
func (i Int64Range) Eq(a int64) bool
Eq returns true when (Min==Max && a==Min) || (a>=Min && a<=Max).
func (Int64Range) String ¶
func (i Int64Range) String() string
String returns the string version of this value.
type LineMatcher ¶ added in v0.1.1
type LineMatcher struct {
// Regexp is matched against the build optimization output.
Regexp *regexp.Regexp
// Source is the line of source code for which this matcher was built.
Source string
}
LineMatcher is a regular expression used to patch an expected expression from build optimization output for a line in a Go source file.
type TestCase ¶
type TestCase struct {
// ID maps to lem.<ID>.
ID string
// Name maps to lem.<ID>.name=<NAME>.
// Please see the lem package documentation for more information.
Name string
// AllocOp maps to lem.<ID>.alloc=\d+(-\d+)? and is the expected number
// of allocations per operation.
AllocOp Int64Range
// BytesOp maps to lem.<ID>.bytes=\d+(-\d+)? and is the expected number
// of bytes per per operation.
BytesOp Int64Range
// Matches maps to lem.<ID>.m= and is a list of patterns that must appear
// in the optimization output.
Matches []LineMatcher
// Natches maps to lem.<ID>.m!= and is a list of patterns that must appear
// in the optimization output.
Natches []LineMatcher
}
TestCase is a test case parsed from the lem comments in a source file.
func GetTestCases ¶
GetTestCases parses the provided Go source files & returns a TestCase slice.
Click to show internal directories.
Click to hide internal directories.