algorithms

package
v0.0.0-...-e3128f7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDependencyDetectorNotExisting = errors.New("the dependency detection strategy does not exist")

Functions

This section is empty.

Types

type DependencyDetector

type DependencyDetector func([]string, *runner.RunnerSet) (DependencyGraph, error)

type DependencyGraph

type DependencyGraph map[string]map[string]struct{}

DependencyGraph represents the graph encoding the dependencies between the tests of a test suite. In the graph, each node is a test of the test suite and each edge represents the dependency relationship between the tests.

func DependencyGraphFromJson

func DependencyGraphFromJson(fileName string) (DependencyGraph, error)

DependencyGraphFromJson returns a DependencyGraph form a JSON file. If there is any error it is returned.

func MEMFAST

func MEMFAST(tests []string, r *runner.RunnerSet) (DependencyGraph, error)

func NewDependencyGraph

func NewDependencyGraph(nodes []string) DependencyGraph

NewDependencyGraph returns a DependencyGraph without any edges from a list of tests.

func PFAST

func PFAST(tests []string, r *runner.RunnerSet) (DependencyGraph, error)

func PraDet

func PraDet(tests []string, oracle *runner.RunnerSet) (DependencyGraph, error)

func (DependencyGraph) AddDependency

func (d DependencyGraph) AddDependency(from, to string)

AddDependency adds a dependency relationship between two tests of a test suite.

func (DependencyGraph) Equal

func (d DependencyGraph) Equal(other DependencyGraph) bool

func (DependencyGraph) GetDependencies

func (d DependencyGraph) GetDependencies(test string) map[string]struct{}

GetDependencies returns all the dependencies of a given test.

func (DependencyGraph) GetSchedules

func (d DependencyGraph) GetSchedules(tests []string) [][]string

GetSchedules returns the schedules needed to cover all the provided tests based on the dependencies into the dependency graph.

func (DependencyGraph) InvertDependency

func (d DependencyGraph) InvertDependency(from, to string)

InvertDependency inverts a dependency relationship between two tests of a test suite.

func (DependencyGraph) RemoveDependency

func (d DependencyGraph) RemoveDependency(from, to string)

RemoveDependency removes a dependency relationship between two tests of a test suite.

func (DependencyGraph) ToDOT

func (d DependencyGraph) ToDOT(w io.Writer)

ToDOT returns a DOT representation of the dependencies relationship between tests of a test suite.

func (DependencyGraph) ToJSON

func (d DependencyGraph) ToJSON(w io.Writer)

ToJSON returns a JSON representation of the dependencies relationship between tests of a test suite.

func (DependencyGraph) TransitiveReduction

func (d DependencyGraph) TransitiveReduction()

TransitiveReduction computes the transitive reduction of a dependency graph.

Jump to

Keyboard shortcuts

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