package test
import "github.com/mmcloughlin/avo/internal/test"
Package test provides testing utilities.
Index ¶
- func Assembles(t *testing.T, asm []byte)
- func Exec(t *testing.T, name string, arg ...string)
- func ExecCommand(t *testing.T, cmd *exec.Cmd)
- func GoTool() string
- func Logger(tb testing.TB) *log.Logger
- func RequiresNetwork(t *testing.T)
- func TempDir(t *testing.T) (string, func())
- func Writer(tb testing.TB) io.Writer
Functions ¶
func Assembles ¶
Assembles asserts that the given assembly code passes the go assembler.
func Exec ¶
Exec executes the named program with the given arguments, logging the command and output and failing the test on error.
func ExecCommand ¶
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 ¶
Logger builds a logger that writes to the test object.
func RequiresNetwork ¶
RequiresNetwork declares that a test requires network access. The test is skipped if network access isn't enabled with the -net flag.
func TempDir ¶
TempDir creates a temp directory. Returns the path to the directory and a cleanup function.
func Writer ¶
Writer builds a writer that logs all writes to the test object.
Source Files ¶
- Version
- v0.6.0 (latest)
- Published
- Jan 7, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 month ago –
Tools for package owners.