shared

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLinesToFileAtBreakPoint

func AddLinesToFileAtBreakPoint(t *testing.T, filePath string, linesToAdd []string, breakPoint string, addAfterBreakpoint bool)

AddLinesToFileAtBreakPoint adds the given lines before or after the breakpoint to the file at the given path.

func AppendLines

func AppendLines(t *testing.T, filePath string, linesToAdd []string)

func CopyTestdataDir

func CopyTestdataDir(t *testing.T, name string) string

CopyTestdataDir copies the "testdata" folder in the current working directory to a temporary directory called "cifuzz-<name>-testdata" and returns the path.

func GetFindings

func GetFindings(t *testing.T, cifuzz string, dir string) []*finding.Finding

func InstallCIFuzzInTemp

func InstallCIFuzzInTemp(t *testing.T) string

InstallCIFuzzInTemp creates an installation builder and installs cifuzz in a temp folder and returns its path.

func ModifyFuzzTestToCallFunction

func ModifyFuzzTestToCallFunction(t *testing.T, fuzzTestPath string)

func TerminateOnSignal added in v0.11.0

func TerminateOnSignal(t *testing.T, cmd *executil.Cmd)

func TestBundle

func TestBundle(t *testing.T, dir string, cifuzz string, args ...string)

func TestRemoteRun

func TestRemoteRun(t *testing.T, dir string, cifuzz string, args ...string)

Types

type CIFuzzRunner

type CIFuzzRunner struct {
	CIFuzzPath      string
	DefaultWorkDir  string
	DefaultFuzzTest string
}

func (*CIFuzzRunner) Command

func (r *CIFuzzRunner) Command(t *testing.T, command string, opts *CommandOptions) []string

Command runs "cifuzz <command> <args>" and returns any indented lines which the command prints to stdout (which we expect to be lines which should be added to some source or config file).

func (*CIFuzzRunner) Run

func (r *CIFuzzRunner) Run(t *testing.T, opts *RunOptions)

type CommandOptions

type CommandOptions struct {
	WorkDir string
	Env     []string
	Args    []string
}

type MockServer

type MockServer struct {
	Address           string
	ArtifactsUploaded bool
	RunStarted        bool
}

func StartMockServer

func StartMockServer(t *testing.T, projectName, artifactsName string) *MockServer

type RunOptions

type RunOptions struct {
	FuzzTest string
	WorkDir  string
	Env      []string
	Args     []string

	ExpectedOutputs              []*regexp.Regexp
	TerminateAfterExpectedOutput bool
	ExpectError                  bool
}

Jump to

Keyboard shortcuts

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