Documentation ¶
Overview ¶
Package compiler contains a test-plan batch compiler. It relies on the existence of a single-binary compiler.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler contains the configuration required to compile the recipes for a single test run.
func New ¶
func New(driver interpreter.Driver, paths SubjectPather, opts ...Option) (*Compiler, error)
New creates a new batch compiler instance using the config c and plan p. It can fail if various safety checks fail on the config, or if there is no obvious machine that the compiler can target.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents the state of a single per-subject instance of the batch compiler.
type Option ¶
Option is the type of options to the compiler sub-stage constructor.
func ObserveWith ¶
ObserveWith adds each observer in obs to the runner's observer list.
func OverrideQuantities ¶
OverrideQuantities overrides this runner's quantities with qs.
type Pathset ¶
type Pathset struct { // DirBins is the directory into which compiled binaries should go. DirBins string // DirLogs is the directory into which compiler logs should go. DirLogs string }
Pathset contains the various directories used by the test compiler.
func NewPathset ¶
NewPathset constructs a new pathset from the directory root.
func (*Pathset) Dirs ¶
Dirs gets all of the directories involved in a pathset over compiler ID set compilers.
Example ¶
ExamplePathset_Dirs is a testable example for Dirs.
package main import ( "fmt" "github.com/c4-project/c4t/internal/stage/mach/compiler" "github.com/c4-project/c4t/internal/id" ) func main() { ps := compiler.Pathset{DirBins: "bins", DirLogs: "logs"} for _, p := range ps.Dirs(id.FromString("foo"), id.FromString("bar.baz")) { fmt.Println(p) } }
Output: bins bins/foo bins/bar/baz logs logs/foo logs/bar/baz
func (*Pathset) Prepare ¶
Prepare prepares this pathset for compilers cs by making its directories. It takes compilers for which directories should be made.
func (*Pathset) SubjectPaths ¶
func (p *Pathset) SubjectPaths(sc compilation.Name) compilation.CompileFileset
SubjectPaths gets the compilation fileset for the subject/compiler pair sc.
type SubjectPather ¶
type SubjectPather interface { // Prepare sets up the directories ready to serve through SubjectPaths. // It takes the compiler IDs that are to be represented in the pathset. Prepare(compilers ...id.ID) error // SubjectPaths gets the filepaths for the compilation with name sc. SubjectPaths(sc compilation.Name) compilation.CompileFileset }
SubjectPather is the interface of types that can produce path sets for compilations.