Documentation ¶
Overview ¶
Package test provides utilities for trunnel testing.
Index ¶
- func AssertFileContentsEqual(t *testing.T, a, b string)
- func Build(srcs [][]byte) ([]byte, error)
- func FileContentsEqual(a, b string) (bool, error)
- func FileExists(filename string) bool
- func Glob(t *testing.T, pattern string, f func(*testing.T, string))
- func LoadFileGroups(dir string) ([][]string, error)
- func TempDir(t *testing.T) (string, func())
- func TrunnelFiles(dir string) ([]string, error)
- type Dependencies
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFileContentsEqual ¶
AssertFileContentsEqual asserts that files a and b have the same contents.
func Build ¶
Build checks whether Go source code src builds correctly. Returns the output of "go build" and an error, if any.
func FileContentsEqual ¶
FileContentsEqual determines whether a and b have the same contents.
func LoadFileGroups ¶
LoadFileGroups looks for trunnel files in a directory and returns groups of files that can be "compiled" together (accounting for extern struct declarations). Dependencies can be recorded in a deps.yaml file in the directory.
func TempDir ¶
TempDir creates a temp directory. Returns the path to the directory and a cleanup function.
func TrunnelFiles ¶
TrunnelFiles returns all the trunnel files in the given directory.
Types ¶
type Dependencies ¶
Dependencies records dependencies between trunnel files.
func LoadDependenciesDir ¶
func LoadDependenciesDir(dir string) (*Dependencies, error)
LoadDependenciesDir looks for "deps.yml" in the directory and loads it if it exists. If the file is not found, it loads an empty set of dependencies.
func LoadDependenciesFile ¶
func LoadDependenciesFile(filename string) (*Dependencies, error)
LoadDependenciesFile loads Dependencies from a YAML file.