fixtures

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
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

View Source
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 CaseName

func CaseName(fileName string) (string, bool)

CaseName returns the case whose expectation fileName is, if it is one.

func Cases

func Cases(dir string) ([]string, error)

Cases lists the conformance case names under dir in name order.

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

func IsCase(fileName string) bool

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

func KnownFailures(dir string) (map[string]bool, error)

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

func PolicyFileTag(spelling string) string

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

type Trace struct {
	Case   string
	Policy string
}

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

func Traces(dir string) ([]Trace, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL