lifter

package
v0.0.0-...-1dd1f65 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package lifter contains the part of the tester framework that lifts litmus tests to compilable C.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDriverNil occurs when a lifter runs without a SingleLifter set.
	ErrDriverNil = errors.New("driver nil")

	// ErrNoBackend occurs when backend information is missing.
	ErrNoBackend = errors.New("no backend provided")
)
View Source
var (
	// ErrObserverNil occurs when we try to pass a nil observer as an option.
	ErrObserverNil = errors.New("observer nil")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	// ServiceName is a guess at the name of the service.
	ServiceName string

	// Subject is, if non-nil, the name of the subject being lifted.
	Subject *subject.Named

	// Job is the job that was being processed when the error occurred.
	Job backend.LiftJob
	// Spec is
	// Inner is the inner error.
	Inner error
}

Error contains an error that occurred while lifting, as well as context.

func (*Error) Error

func (e *Error) Error() string

Error gets the error string for this error.

func (*Error) SubjectName

func (e *Error) SubjectName() string

SubjectName gets any subject name for this error.

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Instance

type Instance struct {
	// Arches is the list of architectures for which this job is responsible.
	Arches []id.ID

	// Driver is the single-lift driver for this job.
	Driver backend.SingleLifter

	// Paths is the path resolver for this job.
	Paths Pather

	// Runner is the runner on which the lifter should be run.
	Runner service.Runner

	// Subject is the subject that we are trying to lift.
	Subject subject.Named

	// ResCh is the channel onto which each fuzzed subject should be sent.
	ResCh chan<- builder.Request
}

Instance is the type of per-subject lifter jobs.

func (*Instance) Lift

func (j *Instance) Lift(ctx context.Context) error

Lift performs this lifting job.

type Lifter

type Lifter struct {
	// contains filtered or unexported fields
}

Lifter holds the main configuration for the lifter part of the tester framework.

func New

func New(r backend.Resolver, p Pather, os ...Option) (*Lifter, error)

New constructs a new Lifter given backend resolver r, path resolver p, and options os.

func (*Lifter) Close

func (*Lifter) Close() error

Close does nothing.

func (*Lifter) Run

func (l *Lifter) Run(ctx context.Context, p *plan.Plan) (*plan.Plan, error)

Run runs a lifting job: taking every test subject in p and using a backend to lift each to a compilable recipe.

func (*Lifter) Stage

func (*Lifter) Stage() stage.Stage

Stage gets the stage for this Lifter.

type Option

type Option func(*Lifter) error

Option is the type of options to pass to New.

func ObserveWith

func ObserveWith(obs ...builder.Observer) Option

ObserveWith adds each observer in obs to the lifter's observer list.

func Options

func Options(os ...Option) Option

Options bundles up each option in os into a single option.

func SendStderrTo

func SendStderrTo(w io.Writer) Option

SendStderrTo makes the lifter send any stderr output from its driver to w.

type Pather

type Pather interface {
	// Prepare sets up a pathset to deal with the architecture IDs arches and subject names subjects.
	Prepare(arches []id.ID, subjects []string) error

	// Path gets the path to the directory prepared for arch and subject.
	// It fails if no such directory has been prepared.
	Path(arch id.ID, subject string) (string, error)
}

Pather abstracts over the path resolution for a lifter.

type Pathset

type Pathset struct {
	// contains filtered or unexported fields
}

Pathset contains the paths for a lifter.

func NewPathset

func NewPathset(root string) *Pathset

NewPathset makes a pathset under root.

func (*Pathset) Path

func (p *Pathset) Path(arch id.ID, subject string) (string, error)

Path gets the path to the directory prepared for arch and subject. It fails if no such directory has been prepared.

func (*Pathset) Prepare

func (p *Pathset) Prepare(arches []id.ID, subjects []string) error

Prepare sets up a pathset to deal with the architecture IDs arches and subject names subjects.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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