Documentation ¶
Overview ¶
Package dep deals with dependencies of tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct { Test string Var []string Software map[string]SoftwareDeps Hardware map[string]HardwareDeps }
Deps contains all information about dependencies tests have.
type HardwareCondition ¶
type HardwareCondition struct { // Satisfied is a pointer to a function which checks if the given HardwareFeatures satisfies // the condition. Satisfied func(f *protocol.HardwareFeatures) (satisfied bool, reason string, err error) // Err is an error to be reported on Test registration // if instantiation of HardwareCondition fails. Err error }
HardwareCondition is exported as go.chromium.org/tast/core/testing/hwdep.Condition. Please find its document for details. Either Satisfied or Err should be nil exclusively.
type HardwareDeps ¶
type HardwareDeps struct {
// contains filtered or unexported fields
}
HardwareDeps is exported as go.chromium.org/tast/core/testing/hwdep.Deps. Please find its document for details.
func MergeHardwareDeps ¶
func MergeHardwareDeps(d1, d2 HardwareDeps) HardwareDeps
MergeHardwareDeps merges two HardwareDeps instance into one HardwareDeps instance. The returned HardwareDeps is satisfied iff all conditions in d1 and ones in d2 are satisfied.
func NewHardwareDeps ¶
func NewHardwareDeps(conds ...HardwareCondition) HardwareDeps
NewHardwareDeps creates a HardwareDeps from a set of HWConditions.
func (*HardwareDeps) Satisfied ¶
func (d *HardwareDeps) Satisfied(f *protocol.HardwareFeatures) (UnsatisfiedReasons, error)
Satisfied returns whether the condition is satisfied. UnsatisfiedReasons is empty if the given device.Config satisfies the dependencies. i.e., the test can run on the current device setup. A non-nil error is returned when failed to evaluate the condition. Otherwise, the UnsatisfiedReasons instance contains a collection of reasons why any of the condition was not satisfied.
func (*HardwareDeps) Validate ¶
func (d *HardwareDeps) Validate() error
Validate returns error if one of the conditions failed to be instantiated.
type SoftwareDeps ¶
type SoftwareDeps = []string
SoftwareDeps represents dependencies to software features.
type UnsatisfiedReasons ¶
type UnsatisfiedReasons []string
UnsatisfiedReasons contain the detailed reasons why Satisfied failed. An empty list means success.