mtest

package
v0.0.0-...-c20f884 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mtest implements functionality useful for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Component

func Component() *mcmp.Component

Component creates and returns a root Component suitable for testing.

func Env

func Env(cmp *mcmp.Component, key, val string)

Env sets the given environment variable on the given Component, such that it will be used as if it was a real environment variable when the Run function from this package is called.

This function will panic if not called on the root Component.

func Run

func Run(cmp *mcmp.Component, t *testing.T, body func())

Run performs the following using the given Component:

- Calls mrun.Init, which calls mcfg.Populate using any variables set by Env.

- Calls the passed in body callback.

- Calls mrun.Shutdown

The intention is that Run is used within a test on a Component created via this package's Component function, after any instantiation functions have been called (e.g. mnet.InstListener).

Types

This section is empty.

Directories

Path Synopsis
Package massert implements an assertion framework which is useful in tests.
Package massert implements an assertion framework which is useful in tests.
Package mchk implements a framework for writing property checker tests, where test cases are generated randomly and performed, and failing test cases are output in a way so as to easily be able to rerun them.
Package mchk implements a framework for writing property checker tests, where test cases are generated randomly and performed, and failing test cases are output in a way so as to easily be able to rerun them.

Jump to

Keyboard shortcuts

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