Documentation ¶
Index ¶
- func GolangTest(t *testing.T, pkgs []string, o *Options)
- func JSONLessTestLineWriter(tb testing.TB, prefix string) io.WriteCloser
- func QEMU(o *Options) (*qemu.Options, string, error)
- func QEMUTest(t *testing.T, o *Options) (*qemu.VM, func())
- func SkipWithoutQEMU(t *testing.T)
- func TestArch() string
- func TestLineWriter(tb testing.TB, prefix string) io.WriteCloser
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GolangTest ¶
GolangTest compiles the unit tests found in pkgs and runs them in a QEMU VM.
func JSONLessTestLineWriter ¶
func JSONLessTestLineWriter(tb testing.TB, prefix string) io.WriteCloser
func QEMU ¶
QEMU builds the u-root environment and prepares QEMU options given the test options and environment variables.
QEMU will augment o.BuildOpts and o.QEMUOpts with configuration that the caller either requested (through the Options.Uinit field, for example) or that the caller did not set.
QEMU returns the QEMU launch options, the temporary directory exposed to the QEMU VM, or an error.
func SkipWithoutQEMU ¶
SkipWithoutQEMU skips the test when the QEMU environment variables are not set. This is already called by QEMUTest(), so use if some expensive operations are performed before calling QEMUTest().
func TestArch ¶
func TestArch() string
TestArch returns the architecture under test. Pass this as GOARCH when building Go programs to be run in the QEMU environment.
func TestLineWriter ¶
func TestLineWriter(tb testing.TB, prefix string) io.WriteCloser
TestLineWriter is an io.Writer that logs full lines of serial to tb.
Types ¶
type Options ¶
type Options struct { // BuildOpts are u-root initramfs options. // // Fields that are not set are populated by QEMU and QEMUTest as // possible. BuildOpts uroot.Opts // QEMUOpts are QEMU VM options for the test. // // Fields that are not set are populated by QEMU and QEMUTest as // possible. QEMUOpts qemu.Options // DontSetEnv doesn't set the BuildOpts.Env and uses the user-supplied one. // // TODO: make uroot.Opts.Env a pointer? DontSetEnv bool // Name is the test's name. // // If name is left empty, the calling function's function name will be // used as determined by runtime.Caller. Name string // Uinit are commands to execute after init. // // If populated, a uinit.go will be generated from these and added to // the busybox generated in BuildOpts.Commands. Uinit []string // Logger logs build statements. Logger logger.Logger // Extra environment variables to set when building (used by u-bmc) ExtraBuildEnv []string // Use virtual vfat rather than 9pfs UseVVFAT bool }
Options are integration test options.