compilation

package
Version: v0.0.0-...-0d16973 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package compilation contains types and functions for dealing with 'compilations': subject/compiler products.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCompilerLog occurs when we ask for the compiler log of a subject that doesn't have one.
	ErrNoCompilerLog = errors.New("compiler result has no log file")
)

Functions

This section is empty.

Types

type Compilation

type Compilation struct {
	// Compile contains any information about the compile phase of this compilation.
	Compile *CompileResult `json:"compile,omitempty"`
	// Run contains any information about the run phase of this compilation.
	Run *RunResult `json:"run,omitempty"`
}

Compilation holds information about one testcase-compiler pairing.

type CompileFileset

type CompileFileset struct {
	// Bin is the slashpath to this subject's compiled binary file.
	Bin string `toml:"bin,omitempty" json:"bin,omitempty"`
	// Log is the slashpath to this subject's compiler stderr log file.
	Log string `toml:"log,omitempty" json:"log,omitempty"`
}

CompileFileset is the set of file paths associated with a compiler output.

func (*CompileFileset) ReadLog

func (c *CompileFileset) ReadLog(root string) ([]byte, error)

ReadLog tries to read in the log for compiler, taking paths relative to root. If the compiler log doesn't exist relative to root, and its path is of the form FOO/BAR, we assume that it is in a saved tarball called FOO.tar.gz (as file BAR) in root, and attempt to extract it.

func (CompileFileset) StripMissing

func (c CompileFileset) StripMissing() CompileFileset

StripMissing removes referenced files in sp that don't exist on the filesystem.

type CompileResult

type CompileResult struct {
	Result

	// RecipeID is the ID of the recipe that was used to perform this compilation.
	RecipeID id.ID `json:"recipe_id"`

	// Files contains paths to the files generated by the compilation.
	Files CompileFileset `toml:"files" json:"files"`
}

CompileResult is a record about an attempt to compile a subject.

type Map

type Map map[id.ID]Compilation

Map is shorthand for a map from compiler IDs to compilations.

type Name

type Name struct {
	// SubjectName is the name of the subject.
	SubjectName string

	// CompilerID is the ID of the compiler.
	CompilerID id.ID
}

Name describes the unique name of a particular instance of the batch compiler.

func (Name) Path

func (n Name) Path() string

Path gets a slashpath fragment that can be used to locate this compilation unambiguously in a directory tree.

func (Name) String

func (n Name) String() string

String gets a stringified version of the name.

type Result

type Result struct {
	// Timespan embeds a timespan for this Result.
	Timespan timing.Span `json:"time_span,omitempty"`

	// Status is the status of the process.
	Status status.Status `json:"status"`
}

Result is the base structure for things that represent the result of an external process.

type RunResult

type RunResult struct {
	Result

	// Obs is this run's processed observation, if any.
	Obs *obs.Obs `toml:"obs,omitempty" json:"obs,omitempty"`
}

RunResult represents information about a single run of a subject.

Jump to

Keyboard shortcuts

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