dependencies

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(keys []Key, deps Dependencies, finder runfiles.RunfilesFinder) (bool, error)

Iterates of a list of dependencies and checks if they are fulfilled

func Error

func Error() error

func OverwriteGetVersionWith0

func OverwriteGetVersionWith0(dep *Dependency) *semver.Version

Replaces the `GetVersion` function with one that returns version 0.0.0

func OverwriteInstalledWithFalse

func OverwriteInstalledWithFalse(dep *Dependency)

Replaces the `Installed` function with one that returns false

func ResetDefaultsForTestsOnly

func ResetDefaultsForTestsOnly()

Types

type Dependencies

type Dependencies map[Key]*Dependency
var Default Dependencies

func CreateTestDeps

func CreateTestDeps(t *testing.T, keys []Key) Dependencies

Creates a set of dependency mocks all dependcies are marked as "installed" and are present in just the right version by default

func Define

func Define(keys []Key) (Dependencies, error)

Defines a set of dependencies

type Dependency

type Dependency struct {
	Key        Key
	MinVersion semver.Version
	// these fields are used to implement custom logic to
	// retrieve version or installation information for the
	// specific dependency
	GetVersion func(*Dependency) (*semver.Version, error)
	Installed  func(*Dependency) bool
	// contains filtered or unexported fields
}

Dependency represents a single dependency

func (*Dependency) CheckVersion

func (dep *Dependency) CheckVersion() bool

Compares MinVersion against GetVersion

func (*Dependency) Ok

func (dep *Dependency) Ok() bool

type Key

type Key string
const (
	CLANG           Key = "clang"
	CMAKE           Key = "cmake"
	LLVM_COV        Key = "llvm-cov"
	LLVM_SYMBOLIZER Key = "llvm-symbolizer"
	LLVM_PROFDATA   Key = "llvm-profdata"

	MESSAGE_VERSION = "cifuzz requires %s %s or higher, have %s"
	MESSAGE_MISSING = "cifuzz requires %s, but it is not installed"
)

Jump to

Keyboard shortcuts

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