gccnt

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: 8 Imported by: 0

Documentation

Overview

Package gccnt implements the "GCCn't" wrapper over GCC-style compilers.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAskedTo occurs when gccn't is asked to simulate a compiler failure.
	ErrAskedTo = errors.New("scheduled error")
	// ErrNoBin occurs when a gccn't runs without a binary set.
	ErrNoBin = errors.New("no gcc binary provided")
)

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// Opts is a list of optimisation levels that will trigger this error.
	Opts []string
	// MutPeriod is an integer that, when nonzero, is the period in the mutant number that will trigger this error.
	MutPeriod uint64
}

Condition specifies a condition at which gccn't will fail in some specified way.

type ConditionSet

type ConditionSet struct {
	// Diverge contains the conditions at which gccn't will diverge.
	Diverge Condition

	// Error contains the conditions at which gccn't will error.
	Error Condition

	// MutHitPeriod is an integer that, when nonzero, is the period in the mutant number that will trigger gccn't
	// reporting a mutation hit without an error.
	MutHitPeriod uint64
}

ConditionSet contains the sets of conditions at which gccn't will fail.

type Gccnt

type Gccnt struct {
	// Conds stores the conditions for which gccn't will fail.
	Conds ConditionSet

	// Bin is the name of the 'real' compiler binary to run.
	Bin string

	// In gives the list of filepaths to pass to GCC.
	In []string

	// Out gives the filepath to which GCC is going to output.
	Out string

	// OptLevel contains the raw optimisation level string to run GCC with.
	OptLevel string

	// Mutant is, if nonzero, the current mutant.
	Mutant uint64

	// March specifies whether to pass -march to gcc, and, if so, what value.
	March string

	// Mcpu specifies whether to pass -mcpu to gcc, and, if so, what value.
	Mcpu string

	// Pthread specifies whether to pass -pthread to gcc.
	Pthread bool

	// Std specifies the standard to pass to gcc.
	Std string
}

Gccnt holds all configuration needed to perform a GCCn't run.

func (*Gccnt) DryRun

func (g *Gccnt) DryRun(ctx context.Context, errw io.Writer) error

DryRun works out what GCCn't is going to do, then prints it onto errw.

func (*Gccnt) Run

func (g *Gccnt) Run(ctx context.Context, outw, errw io.Writer) error

Run runs gccn't on the given context, printing stdout onto outw and stderr onto errw.

Jump to

Keyboard shortcuts

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