Documentation ¶
Overview ¶
Package project collects information about test suite organisation by implementing various heuristics.
Index ¶
- Constants
- func ContainsFile(p Interface, path string) bool
- func Discover(path string) []string
- func ExpandVar(s string, vars map[string]string) (string, error)
- func Files(p Interface) ([]string, error)
- func FindAllFiles(p Interface) []string
- func Fingerprint(p Interface) string
- func GetVar(name string, vars map[string]string) (string, error)
- func Variables(vars map[string]string) ([]string, error)
- type Interface
- type Manifest
- type NoSuchVariableError
- type Project
- func (p *Project) Environ() ([]string, error)
- func (p *Project) Expand(v string) (string, error)
- func (p *Project) FindModule(name string) (string, error)
- func (p *Project) Getenv(v string) (string, error)
- func (p *Project) Imports() ([]string, error)
- func (p *Project) Root() string
- func (p *Project) Sources() ([]string, error)
- func (p *Project) String() string
Constants ¶
const ManifestFile = "package.yml"
Variables ¶
This section is empty.
Functions ¶
func ContainsFile ¶
ContainsFile returns true, when path is managed by Interface.
func Discover ¶
Discover walks towards the file system root and collects known test suite layouts.
This initial version of Discover returns a string slice, but this may change in future releases.
func ExpandVar ¶
ExpandVar expands variables references inside a string using environment variables first and then a provided variables map second. If a reference could not expanded, the variable reference will stay inside the string and an an error will be returned.
func Files ¶
Files returns all .ttcn3 available. It will not return generated .ttcn3 files. On error Files will return an error.
func FindAllFiles ¶
FindAllFiles returns all .ttcn3 files including auxiliary files from k3 installation
func Fingerprint ¶
Fingerprint calculates a sum to identify a test suite based on its modules.
Types ¶
type Interface ¶
type Interface interface { // Root is the test suite root folder. It is usually the folder where the manifest is. Root() string // Sources returns a slice of files and directories containing TTCN-3 source files. Sources() ([]string, error) // Imports returns a slice of additional directories required to build a test executable. // Codecs, adapters and libraries are specified by Imports, typically. Imports() ([]string, error) }
Interface describes a TTCN-3 project.
type Manifest ¶
type Manifest struct { // Static configuration Name string Sources []string Imports []string Variables map[string]string // Runtime configuration TestHook string `yaml:"test_hook"` // Path for test hook. ParametersFile string `yaml:"parameters_file"` // Path for module parameters file. ParametersDir string `yaml:"parameters_dir"` // Optional path for parameters_file. Timeout float64 `yaml:"timeout"` // Global timeout for tests. }
type NoSuchVariableError ¶
type NoSuchVariableError struct {
Name string
}
func (*NoSuchVariableError) Error ¶
func (e *NoSuchVariableError) Error() string
type Project ¶
type Project struct { Manifest Manifest // contains filtered or unexported fields }
A Project provides meta information about a TTCN-3 test suite. Meta information like: Location of configuration and source files, dependency list, default values, ...
func (*Project) Environ ¶
Environ returns a copy of strings representing the environment, in the form "key=value".
func (*Project) FindModule ¶
FindModule tries to find a .ttcn3 based on its module name.