Documentation
¶
Overview ¶
Package govmtest is an API for running Go unit tests in the guest and collecting their results and test coverage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run compiles the tests added with WithPackageToTest and runs them in a QEMU VM configured by mods. It collects the test results and provides a pass/fail result of each individual test.
Run runs tests and benchmarks, but not fuzz tests.
The test environment in the VM is very minimal. If a test depends on other binaries or specific files to be present, they must be specified with additional initramfs commands via WithUimage.
All files and directories in the same directory as the test package will be made available to the test in the guest as well (e.g. testdata/ directories).
Coverage from the Go tests is collected if a coverage file name is specified via the VMTEST_GO_PROFILE env var, as well as integration test coverage if VMTEST_GOCOVERDIR is set.
- TODO: specify test, bench, fuzz filter. Flags for fuzzing.
Types ¶
type Modifier ¶
Modifier is a configurator for Options.
func WithGoTestTimeout ¶
WithGoTestTimeout sets a timeout for individual Go test binaries.
func WithPackageToTest ¶
WithPackageToTest adds additional packages to the test.
func WithUimage ¶
WithUimage merges o with already appended initramfs build options.