Documentation
¶
Overview ¶
Package fixtures enumerates conformance cases the way the gates run them, so the tests and the generated documentation figures share one definition.
Index ¶
- Constants
- Variables
- func CaseName(fileName string) (string, bool)
- func Cases(dir string) ([]string, error)
- func FormatLibraryCensus(census LibraryCensus) ([]byte, error)
- func IsCase(fileName string) bool
- func KnownFailures(dir string) (map[string]bool, error)
- func PolicyFileTag(spelling string) string
- type LibraryCensus
- type LibraryMismatch
- type LibraryPackage
- type LibraryRefusal
- type Trace
Constants ¶
const LibraryCensusPath = "docs/project/analysis-library-census.json"
LibraryCensusPath is the committed measurement of the analysis libraries, written by the runtime test TestAnalysisLibraryCensus and rendered into the compliance map by the doc-counts gate.
const LibraryPrefixSweepPath = "docs/project/library-and-prefix-sweep-outcomes.txt"
LibraryPrefixSweepPath is the committed per-probe outcome of the library and prefix sweep, written by the runtime test TestLibraryAndPrefixSweep.
Variables ¶
var SweepPolicies = []string{"declared", "seed:1"}
SweepPolicies are the non-default schedule policies the whole suite runs under, spelled as the runtime's ParseSchedulePolicy reads them.
Functions ¶
func FormatLibraryCensus ¶
func FormatLibraryCensus(census LibraryCensus) ([]byte, error)
FormatLibraryCensus is the one byte form the census is committed in, so the test that writes it and the guard that reads it agree on every byte.
func IsCase ¶
IsCase tells a case's `.expected.json` from the `.check.expected.json` beside it, which states what a check of every schedule finds.
func KnownFailures ¶
KnownFailures reads dir's known_failures.txt — one case name per line, `#` starting a comment — and returns the set; an absent file is an empty set.
func PolicyFileTag ¶
PolicyFileTag spells a policy as a file-name segment: `seed:1` becomes `seed-1`.
Types ¶
type LibraryCensus ¶
type LibraryCensus struct {
// Command reproduces the measurement.
Command string `json:"command"`
Packages []LibraryPackage `json:"packages"`
}
LibraryCensus is the measurement of every callable declaration the analysis libraries make, as one runtime test observed it.
func ReadLibraryCensus ¶
func ReadLibraryCensus(root string) (LibraryCensus, error)
ReadLibraryCensus reads and validates the committed census.
func (LibraryCensus) Validate ¶
func (c LibraryCensus) Validate() error
Validate holds the census to its own bookkeeping: every declaration has exactly one verdict and every verdict names a declaration.
type LibraryMismatch ¶
type LibraryMismatch struct {
Declaration string `json:"declaration"`
// Mismatch is what the check reported about the value.
Mismatch string `json:"mismatch"`
}
LibraryMismatch is one declaration whose value disagreed with its check.
type LibraryPackage ¶
type LibraryPackage struct {
Name string `json:"name"`
// Path locates the library file in the bundled standard library.
Path string `json:"path"`
// Declarations are the qualified names of every named callable declaration
// the package makes, in declaration order.
Declarations []string `json:"declarations"`
// Evaluated names the declarations whose invocation produced the checked value.
Evaluated []string `json:"evaluated"`
// Refused lists the declarations whose invocation the runtime refused with a typed error.
Refused []LibraryRefusal `json:"refused"`
// Wrong lists the declarations whose invocation produced a value that failed its check.
Wrong []LibraryMismatch `json:"wrong"`
}
LibraryPackage is one library package: the callable declarations it makes and the verdict of the representative invocation of each.
func (LibraryPackage) Counts ¶
func (p LibraryPackage) Counts() (declarations, evaluated, refused, wrong int)
Counts are the per-package figures the table states.
type LibraryRefusal ¶
type LibraryRefusal struct {
Declaration string `json:"declaration"`
// Error is the runtime's sentinel error the refusal is typed by.
Error string `json:"error"`
// Message is the refusal as reported.
Message string `json:"message"`
}
LibraryRefusal is one declaration the runtime refused to run.
type Trace ¶
Trace is a golden trace the trace harness reads: a case's own under the default schedule (Policy "") or one pinning it under a sweep policy.
func Traces ¶
Traces lists the `.trace.golden` files under dir the trace harness reads, in name order. A known failure's are passed over, as the harness skips the case; one no case owns, one under no sweep policy, or a policy golden the harness would not schedule (the case admits one outcome or owns no default golden) is an error, since no gate would read it.