testbin

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testbin hand-builds tiny, byte-for-byte deterministic binaries for tests.

It exists because the alternatives aren't reproducible. Compiling a fixture (internal/binfile's buildSample) depends on the host toolchain, and opening a system binary (/bin/ls) depends on the host OS and libc. Neither can back a golden-frame test, whose whole premise is that the same input renders the same bytes on every machine.

Nothing outside tests imports this package, so it does not link into exex.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TinyELF64

func TinyELF64() []byte

TinyELF64 returns a complete, deterministic ET_EXEC ELF64 image for x86-64. The same bytes every call, on every platform.

func WriteTinyELF64

func WriteTinyELF64(t *testing.T) string

WriteTinyELF64 writes the fixture into t.TempDir() and returns its path.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL