package test

import "github.com/mmcloughlin/avo/internal/test"

Package test provides testing utilities.

Index

Functions

func Assembles

func Assembles(t *testing.T, asm []byte)

Assembles asserts that the given assembly code passes the go assembler.

func Exec

func Exec(t *testing.T, name string, arg ...string)

Exec executes the named program with the given arguments, logging the command and output and failing the test on error.

func ExecCommand

func ExecCommand(t *testing.T, cmd *exec.Cmd)

ExecCommand executes the command, logging the command and output and failing the test on error.

func GoTool

func GoTool() string

GoTool returns a best guess path to the "go" binary.

func Logger

func Logger(tb testing.TB) *log.Logger

Logger builds a logger that writes to the test object.

func RequiresNetwork

func RequiresNetwork(t *testing.T)

RequiresNetwork declares that a test requires network access. The test is skipped if network access isn't enabled with the -net flag.

func TempDir

func TempDir(t *testing.T) (string, func())

TempDir creates a temp directory. Returns the path to the directory and a cleanup function.

func Writer

func Writer(tb testing.TB) io.Writer

Writer builds a writer that logs all writes to the test object.

Source Files

utils.go

Version
v0.6.0 (latest)
Published
Jan 7, 2024
Platform
linux/amd64
Imports
8 packages
Last checked
1 month ago

Tools for package owners.