Documentation ¶
Index ¶
- Variables
- func Check(keys []Key, deps Dependencies, finder runfiles.RunfilesFinder) (bool, error)
- func ClangVersion(path string) (*semver.Version, error)
- func Error() error
- func OverwriteGetVersionWith0(dep *Dependency) *semver.Version
- func OverwriteInstalledWithFalse(dep *Dependency)
- func ResetDefaultsForTestsOnly()
- type Dependencies
- type Dependency
- type Key
Constants ¶
This section is empty.
Variables ¶
View Source
var All = Dependencies{ CLANG: { Key: CLANG, MinVersion: *semver.MustParse("11.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { return clangVersion(dep, clangCheck) }, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.ClangPath) }, }, CMAKE: { Key: CMAKE, MinVersion: *semver.MustParse("3.16.0"), GetVersion: cmakeVersion, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.CMakePath) }, }, LLVM_COV: { Key: LLVM_COV, MinVersion: *semver.MustParse("11.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { path, err := dep.finder.LLVMCovPath() if err != nil { return nil, err } version, err := llvmVersion(path, dep) if err != nil { return nil, err } log.Debugf("Found llvm-cov version %s in PATH: %s", version, path) return version, nil }, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.LLVMCovPath) }, }, LLVM_PROFDATA: { Key: LLVM_PROFDATA, MinVersion: *semver.MustParse("0.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { return semver.NewVersion("0.0.0") }, Installed: func(dep *Dependency) bool { path, err := dep.finder.LLVMProfDataPath() if err != nil { return false } log.Debugf("Found llvm-profdata in PATH: %s", path) return true }, }, LLVM_SYMBOLIZER: { Key: LLVM_SYMBOLIZER, MinVersion: *semver.MustParse("11.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { path, err := dep.finder.LLVMSymbolizerPath() if err != nil { return nil, err } version, err := llvmVersion(path, dep) if err != nil { return nil, err } log.Debugf("Found llvm-symbolizer version %s in PATH: %s", version, path) return version, nil }, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.LLVMSymbolizerPath) }, }, GENHTML: { Key: GENHTML, MinVersion: *semver.MustParse("0.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { return semver.NewVersion("0.0.0") }, Installed: func(dep *Dependency) bool { path, err := dep.finder.GenHTMLPath() if err != nil { return false } log.Debugf("Found genhtml in PATH: %s", path) return true }, }, JAVA: { Key: JAVA, MinVersion: *semver.MustParse("8.0.0"), GetVersion: javaVersion, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.JavaHomePath) }, }, MAVEN: { Key: MAVEN, MinVersion: *semver.MustParse("0.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { return semver.NewVersion("0.0.0") }, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.MavenPath) }, }, GRADLE: { Key: GRADLE, MinVersion: *semver.MustParse("0.0.0"), GetVersion: func(dep *Dependency) (*semver.Version, error) { return semver.NewVersion("0.0.0") }, Installed: func(dep *Dependency) bool { return dep.checkFinder(dep.finder.GradlePath) }, }, }
List of All known dependencies
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 ClangVersion ¶ added in v0.5.0
ClangVersion returns the version of the clang/clang++ executable at the given path.
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 CMakeDeps Dependencies
var GradleDeps Dependencies
var MavenDeps 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
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" GENHTML Key = "genhtml" JAVA Key = "java" MAVEN Key = "mvn" GRADLE Key = "gradle" MESSAGE_VERSION = "cifuzz requires %s %s or higher, have %s" MESSAGE_MISSING = "cifuzz requires %s, but it is not installed" )
Click to show internal directories.
Click to hide internal directories.