Documentation
¶
Overview ¶
Package console provides an API to interact with the serial console of a DUT.
To capture the contents of the serial console to a file, use the Console.StartCapture method:
stdoutFile, err := os.Create("stdout.log") if err != nil { return err } stderrFile, err := os.Create("stderr.log") if err != nil { return err } dut.Console().StartCapture(t, stdoutFile, stderrFile)
StartCapture automatically registers a test cleanup function to stop the capture, but if a test needs fine-grained control over when precisely it is stopped, it can call the StopCaptureFunc function returned by StartCapture:
stopFn := dut.Console().StartCapture(t, stdoutFile, stderrFile) doStuffToTriggerConsoleOutput() stopFn(t)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console is the device Console API.
func (*Console) StartCapture ¶
StartCapture starts copying console stdout and stderr to outw and errw, respectively. It registers a cleanup function to stop the capture but also returns that same function, in case the user wants to stop it earlier.
type StopCaptureFunc ¶
StopCaptureFunc is a function that stops copying console stdout and stderr